Merge branch 'master' into patch-1

pull/1827/head
Kim Kulling 2018-03-23 19:43:58 +01:00 committed by GitHub
commit d810446bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 37 deletions

View File

@ -110,7 +110,6 @@ if (WIN32)
endif() endif()
IF(MSVC) IF(MSVC)
SET (CMAKE_PREFIX_PATH "D:\\libs\\devil")
OPTION( ASSIMP_INSTALL_PDB OPTION( ASSIMP_INSTALL_PDB
"Install MSVC debug files." "Install MSVC debug files."
ON ON

View File

@ -485,9 +485,9 @@ ADD_ASSIMP_IMPORTER( IFC
) )
if (ASSIMP_BUILD_IFC_IMPORTER) if (ASSIMP_BUILD_IFC_IMPORTER)
if (MSVC) if (MSVC)
set_source_files_properties(IFCReaderGen1.cpp IFCReaderGen2.cpp PROPERTIES COMPILE_FLAGS "/bigobj") set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
elseif(CMAKE_COMPILER_IS_MINGW) elseif(CMAKE_COMPILER_IS_MINGW)
set_source_files_properties(IFCReaderGen1.cpp IFCReaderGen2.cpp PROPERTIES COMPILE_FLAGS "-O2 -Wa,-mbig-obj") set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "-O2 -Wa,-mbig-obj")
endif() endif()
endif (ASSIMP_BUILD_IFC_IMPORTER) endif (ASSIMP_BUILD_IFC_IMPORTER)

View File

@ -79,14 +79,13 @@ Geometry::Geometry(uint64_t id, const Element& element, const std::string& name,
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
Geometry::~Geometry() Geometry::~Geometry()
{ {
// empty
} }
const Skin* Geometry::DeformerSkin() const { const Skin* Geometry::DeformerSkin() const {
return skin; return skin;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc) MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc)
: Geometry(id, element,name, doc) : Geometry(id, element,name, doc)
@ -186,9 +185,8 @@ MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::strin
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
MeshGeometry::~MeshGeometry() MeshGeometry::~MeshGeometry() {
{ // empty
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -308,7 +306,6 @@ void MeshGeometry::ReadLayerElement(const Scope& layerElement)
<< type << ", index: " << typedIndex); << type << ", index: " << typedIndex);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scope& source) void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scope& source)
{ {
@ -412,7 +409,6 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop
} }
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Lengthy utility function to read and resolve a FBX vertex data array - that is, the // Lengthy utility function to read and resolve a FBX vertex data array - that is, the
// output is in polygon vertex order. This logic is used for reading normals, UVs, colors, // output is in polygon vertex order. This logic is used for reading normals, UVs, colors,
@ -431,7 +427,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
bool isDirect = ReferenceInformationType == "Direct"; bool isDirect = ReferenceInformationType == "Direct";
bool isIndexToDirect = ReferenceInformationType == "IndexToDirect"; bool isIndexToDirect = ReferenceInformationType == "IndexToDirect";
// fallback to direct data if there is no index data element // fall-back to direct data if there is no index data element
if ( isIndexToDirect && !HasElement( source, indexDataElementName ) ) { if ( isIndexToDirect && !HasElement( source, indexDataElementName ) ) {
isDirect = true; isDirect = true;
isIndexToDirect = false; isIndexToDirect = false;
@ -499,9 +495,14 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
return; return;
} }
const T empty;
unsigned int next = 0; unsigned int next = 0;
for(int i : uvIndices) { for(int i : uvIndices) {
if (static_cast<size_t>(i) >= tempData.size()) { if ( -1 == i ) {
data_out[ next++ ] = empty;
continue;
}
if (static_cast<size_t>(i) >= tempData.size()) {
DOMError("index out of range",&GetRequiredElement(source,indexDataElementName)); DOMError("index out of range",&GetRequiredElement(source,indexDataElementName));
} }
@ -528,7 +529,6 @@ void MeshGeometry::ReadVertexDataNormals(std::vector<aiVector3D>& normals_out, c
m_mappings); m_mappings);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope& source, void MeshGeometry::ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope& source,
const std::string& MappingInformationType, const std::string& MappingInformationType,
@ -543,7 +543,6 @@ void MeshGeometry::ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope
m_mappings); m_mappings);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataColors(std::vector<aiColor4D>& colors_out, const Scope& source, void MeshGeometry::ReadVertexDataColors(std::vector<aiColor4D>& colors_out, const Scope& source,
const std::string& MappingInformationType, const std::string& MappingInformationType,

View File

@ -68,7 +68,6 @@ private:
const Skin* skin; const Skin* skin;
}; };
typedef std::vector<int> MatIndexArray; typedef std::vector<int> MatIndexArray;
@ -95,8 +94,8 @@ public:
* if no tangents are specified */ * if no tangents are specified */
const std::vector<aiVector3D>& GetTangents() const; const std::vector<aiVector3D>& GetTangents() const;
/** Get a list of all vertex binormals or an empty array /** Get a list of all vertex bi-normals or an empty array
* if no binormals are specified */ * if no bi-normals are specified */
const std::vector<aiVector3D>& GetBinormals() const; const std::vector<aiVector3D>& GetBinormals() const;
/** Return list of faces - each entry denotes a face and specifies /** Return list of faces - each entry denotes a face and specifies

View File

@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/types.h> #include <assimp/types.h>
#include <assimp/IOStream.hpp> #include <assimp/IOStream.hpp>
#include "ParsingUtils.h" #include "ParsingUtils.h"
#include <vector> #include <vector>
@ -270,8 +271,8 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
} }
buffer[ i ] = m_cache[ m_cachePos ]; buffer[ i ] = m_cache[ m_cachePos ];
m_cachePos++; ++m_cachePos;
i++; ++i;
if ( m_cachePos >= m_cacheSize ) { if ( m_cachePos >= m_cacheSize ) {
if ( !readNextBlock() ) { if ( !readNextBlock() ) {
return false; return false;
@ -280,13 +281,12 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
} }
buffer[ i ] = '\n'; buffer[ i ] = '\n';
m_cachePos++; ++m_cachePos;
return true; return true;
} }
static static inline
inline
bool isEndOfCache( size_t pos, size_t cacheSize ) { bool isEndOfCache( size_t pos, size_t cacheSize ) {
return ( pos == cacheSize ); return ( pos == cacheSize );
} }
@ -314,11 +314,11 @@ bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
} }
} }
size_t i = 0; size_t i( 0 );
while (!IsLineEnd(m_cache[ m_cachePos ])) { while (!IsLineEnd(m_cache[ m_cachePos ])) {
buffer[i] = m_cache[ m_cachePos ]; buffer[i] = m_cache[ m_cachePos ];
m_cachePos++; ++m_cachePos;
i++; ++i;
if (m_cachePos >= m_cacheSize) { if (m_cachePos >= m_cacheSize) {
if (!readNextBlock()) { if (!readNextBlock()) {
return false; return false;
@ -326,7 +326,7 @@ bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
} }
} }
buffer[i] = '\n'; buffer[i] = '\n';
m_cachePos++; ++m_cachePos;
return true; return true;
} }
@ -334,18 +334,19 @@ bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
template<class T> template<class T>
inline inline
bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) { bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) {
//just return the last blockvalue if getNextLine was used before // Return the last block-value if getNextLine was used before
if ( m_cachePos != 0) { if ( 0 != m_cachePos ) {
buffer = std::vector<T>(m_cache.begin() + m_cachePos, m_cache.end()); buffer = std::vector<T>( m_cache.begin() + m_cachePos, m_cache.end() );
m_cachePos = 0; m_cachePos = 0;
} } else {
else { if ( !readNextBlock() ) {
if ( !readNextBlock() ) return false;
return false; }
buffer = std::vector<T>(m_cache.begin(), m_cache.end()); buffer = std::vector<T>(m_cache.begin(), m_cache.end());
} }
return true;
return true;
} }
} // !ns Assimp } // !ns Assimp