Step-Importer: introduce new files.
parent
8ceca4daaf
commit
c75bc99902
|
@ -505,7 +505,6 @@ ADD_ASSIMP_IMPORTER( XGL
|
||||||
XGLLoader.h
|
XGLLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER( FBX
|
ADD_ASSIMP_IMPORTER( FBX
|
||||||
FBXImporter.cpp
|
FBXImporter.cpp
|
||||||
FBXCompileConfig.h
|
FBXCompileConfig.h
|
||||||
|
@ -722,9 +721,11 @@ ADD_ASSIMP_IMPORTER( MMD
|
||||||
)
|
)
|
||||||
|
|
||||||
SET( Step_SRCS
|
SET( Step_SRCS
|
||||||
STEPFile.h
|
STEPFile.h
|
||||||
StepExporter.h
|
Importer/StepFile/StepFileImporter.h
|
||||||
StepExporter.cpp
|
Importer/StepFile/StepFileImporter.cpp
|
||||||
|
StepExporter.h
|
||||||
|
StepExporter.cpp
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( Step FILES ${Step_SRCS})
|
SOURCE_GROUP( Step FILES ${Step_SRCS})
|
||||||
|
|
||||||
|
|
|
@ -119,9 +119,9 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aiTexel* imageContent = new aiTexel[1u + imageSize / sizeof(aiTexel)];
|
aiTexel* imageContent = new aiTexel[1u + static_cast<size_t>( imageSize) / sizeof(aiTexel)];
|
||||||
file.seekg(0, std::ios::beg);
|
file.seekg( 0, std::ios::beg );
|
||||||
file.read(reinterpret_cast<char*>(imageContent), imageSize);
|
file.read( reinterpret_cast<char*>(imageContent), imageSize );
|
||||||
|
|
||||||
// Enlarging the textures table
|
// Enlarging the textures table
|
||||||
auto textureId = pScene->mNumTextures++;
|
auto textureId = pScene->mNumTextures++;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <assimp/BaseImporter.h>
|
||||||
|
|
||||||
|
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:
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -416,7 +416,6 @@ namespace STEP {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ConverterMap converters;
|
ConverterMap converters;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue