diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index c238c7c4a..11cd75ec6 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -505,7 +505,6 @@ ADD_ASSIMP_IMPORTER( XGL XGLLoader.h ) - ADD_ASSIMP_IMPORTER( FBX FBXImporter.cpp FBXCompileConfig.h @@ -722,9 +721,11 @@ ADD_ASSIMP_IMPORTER( MMD ) SET( Step_SRCS - STEPFile.h - StepExporter.h - StepExporter.cpp + STEPFile.h + Importer/StepFile/StepFileImporter.h + Importer/StepFile/StepFileImporter.cpp + StepExporter.h + StepExporter.cpp ) SOURCE_GROUP( Step FILES ${Step_SRCS}) diff --git a/code/EmbedTexturesProcess.cpp b/code/EmbedTexturesProcess.cpp index 2fafc2de7..1c04a34f0 100644 --- a/code/EmbedTexturesProcess.cpp +++ b/code/EmbedTexturesProcess.cpp @@ -119,9 +119,9 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const { } } - aiTexel* imageContent = new aiTexel[1u + imageSize / sizeof(aiTexel)]; - file.seekg(0, std::ios::beg); - file.read(reinterpret_cast(imageContent), imageSize); + aiTexel* imageContent = new aiTexel[1u + static_cast( imageSize) / sizeof(aiTexel)]; + file.seekg( 0, std::ios::beg ); + file.read( reinterpret_cast(imageContent), imageSize ); // Enlarging the textures table auto textureId = pScene->mNumTextures++; diff --git a/code/Importer/StepFile/StepFileImporter.cpp b/code/Importer/StepFile/StepFileImporter.cpp new file mode 100644 index 000000000..35d70384c --- /dev/null +++ b/code/Importer/StepFile/StepFileImporter.cpp @@ -0,0 +1,48 @@ +#include "StepFileImporter.h" + +namespace Assimp { +namespace STEP { + +static const aiImporterDesc desc = { "StepFile Importer", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + "stp" }; + +StepFileImporter::StepFileImporter() +: BaseImporter() { + +} + +StepFileImporter::~StepFileImporter() { + +} + +bool StepFileImporter::CanRead(const std::string& file, IOSystem* pIOHandler, bool checkSig) const { + const std::string &extension = GetExtension(file); + if ( extension == "stp" ) { + return true; + } else if ((!extension.length() || checkSig) && pIOHandler) { + const char* tokens[] = { "ISO-10303-21" }; + const bool found(SearchFileHeaderForToken(pIOHandler, file, tokens, 1)); + return found; + } + + return false; +} + +const aiImporterDesc *StepFileImporter::GetInfo() const { + return &desc; +} + +void StepFileImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { + +} + +} +} diff --git a/code/Importer/StepFile/StepFileImporter.h b/code/Importer/StepFile/StepFileImporter.h new file mode 100644 index 000000000..08ca3d508 --- /dev/null +++ b/code/Importer/StepFile/StepFileImporter.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +namespace Assimp { +namespace STEP { + +class StepFileImporter : public BaseImporter { +public: + StepFileImporter(); + ~StepFileImporter(); + bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override; + const aiImporterDesc* GetInfo() const override; + +protected: + void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler ) override; + +private: +}; + +} +} diff --git a/code/STEPFile.h b/code/STEPFile.h index 492150658..1f24dbc6b 100644 --- a/code/STEPFile.h +++ b/code/STEPFile.h @@ -416,7 +416,6 @@ namespace STEP { } private: - ConverterMap converters; }; }