24 if (mSo3Flags & so3Converter_SplitLargeMeshes)
25 mFlags |= aiProcess_SplitLargeMeshes;
27 if (mSo3Flags & so3Converter_GenSmoothNormals)
28 mFlags |= aiProcess_GenSmoothNormals;
30 if (mSo3Flags & so3Converter_OptimizeMeshes)
31 mFlags |= aiProcess_OptimizeMeshes;
33 if (mSo3Flags & so3Converter_OptimizeGraph)
34 mFlags |= aiProcess_OptimizeGraph;
36 if ((mFlags == 0) || (mFlags != 0 && !(mFlags & aiProcess_GenSmoothNormals)))
37 mFlags |= aiProcess_GenNormals;
39 mFlags |= aiProcess_RemoveComponent;
51 if (mSo3Flags & so3Converter_SplitLargeMeshes)
52 mFlags |= aiProcess_SplitLargeMeshes;
54 if (mSo3Flags & so3Converter_GenSmoothNormals)
55 mFlags |= aiProcess_GenSmoothNormals;
57 if (mSo3Flags & so3Converter_OptimizeMeshes)
58 mFlags |= aiProcess_OptimizeMeshes;
60 if (mSo3Flags & so3Converter_OptimizeGraph)
61 mFlags |= aiProcess_OptimizeGraph;
63 if ((mFlags == 0) || (mFlags != 0 && !(mFlags & aiProcess_GenSmoothNormals)))
64 mFlags |= aiProcess_GenNormals;
66 mFlags |= aiProcess_RemoveComponent;
76 const aiScene* loadedScene = NULL;
78 mImporter.SetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_LINE );
80 mImporter.SetPropertyBool(AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS,
true);
85 unsigned int defFlags = AL_ASSIMP_NULL_FLAGS;
89 if (defFlags & aiProcess_SplitLargeMeshes)
91 mImporter.SetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT, 65535 / 3);
92 mImporter.SetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT, 65535);
95 if (defFlags & aiProcess_OptimizeMeshes)
96 defFlags = defFlags | aiProcess_JoinIdenticalVertices;
98 if ((defFlags & aiProcess_GenSmoothNormals) && (defFlags & aiProcess_RemoveComponent))
100 mImporter.SetPropertyFloat(AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE, 45.0f);
101 mImporter.SetPropertyFloat(AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, 30.0f);
102 mImporter.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS, aiComponent_NORMALS | aiComponent_TANGENTS_AND_BITANGENTS);
106 defFlags |= aiProcess_GlobalScale;
107 mImporter.SetPropertyFloat(AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY, mScale);
109 std::string ext = boost::filesystem::extension(mFilename);
110 boost::algorithm::to_lower(ext);
113 loadedScene = mImporter.ReadFile(to_utf8(mFilename).c_str(), AL_ASSIMP_DEFAULT_FLAG | defFlags);
115 loadedScene = mImporter.ReadFile(to_utf8(mFilename).c_str(), AL_ASSIMP_DEFAULT_FLAG | AL_ASSIMP_ADDITIONNAL_FLAG | defFlags);
119 if (loadedScene != 0)
121 mALScene =
ALScene(
this, mScene, mGroup, loadedScene, parent, sceneName,
true);
122 mALScene.
load(objects, materials);
131 const aiScene* loadedScene = NULL;
133 mImporter.SetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_LINE );
135 mImporter.SetPropertyBool(AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS,
true);
140 unsigned int defFlags = AL_ASSIMP_NULL_FLAGS;
144 if (defFlags & aiProcess_SplitLargeMeshes)
146 mImporter.SetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT, 65535 / 3);
147 mImporter.SetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT, 65535);
150 if (defFlags & aiProcess_OptimizeMeshes)
151 defFlags = defFlags | aiProcess_JoinIdenticalVertices;
153 if ((defFlags & aiProcess_GenSmoothNormals) && (defFlags & aiProcess_RemoveComponent))
155 mImporter.SetPropertyFloat(AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE, 45.0f);
156 mImporter.SetPropertyFloat(AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, 30.0f);
157 mImporter.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS, aiComponent_NORMALS | aiComponent_TANGENTS_AND_BITANGENTS);
161 defFlags |= aiProcess_GlobalScale;
162 mImporter.SetPropertyFloat(AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY, mScale);
164 std::string ext = boost::filesystem::extension(mFilename);
165 boost::algorithm::to_lower(ext);
168 loadedScene = mImporter.ReadFile(to_utf8(mFilename).c_str(), AL_ASSIMP_DEFAULT_FLAG | defFlags);
170 loadedScene = mImporter.ReadFile(to_utf8(mFilename).c_str(), AL_ASSIMP_DEFAULT_FLAG | AL_ASSIMP_ADDITIONNAL_FLAG | defFlags);
172 if (loadedScene != 0)
175 mALScene =
ALScene(
this, mScene, mGroup, loadedScene, 0, sceneName);
191 if (!boost::filesystem::exists(path))
192 boost::filesystem::create_directories(path);
194 boost::filesystem::path texPath = path;
195 texPath /=
"textures";
196 boost::filesystem::create_directory(texPath);
198 boost::filesystem::path meshPath = path;
199 meshPath /=
"meshes";
200 boost::filesystem::create_directory(meshPath);
202 boost::filesystem::path matPath = path;
203 matPath /=
"materials";
204 boost::filesystem::create_directory(matPath);