2727
2828#include " ../ifcgeom_schema_agnostic/IfcGeomIterator.h"
2929#include " ../ifcgeom_schema_agnostic/IfcGeomMaterial.h"
30- #include " ../ifcgeom /IfcGeomElement.h"
30+ #include " ../ifcgeom_schema_agnostic /IfcGeomElement.h"
3131
3232static const int NUM_MATERIAL_SLOTS = 24 ;
3333
@@ -46,6 +46,11 @@ static class IFCImpClassDesc :public ClassDesc {
4646 void * Create (BOOL /* loading = FALSE*/ ) { return new IFCImp; }
4747 // TODO Delete() function?
4848 const TCHAR * ClassName () { return _T (" IFCImp" ); }
49+
50+ #if MAX_VERSION_MAJOR >= 24
51+ const TCHAR * NonLocalizedClassName () { return ClassName (); }
52+ #endif
53+
4954 SClass_ID SuperClassID () { return SCENE_IMPORT_CLASS_ID; }
5055 Class_ID ClassID () { return Class_ID (0x3f230dbf , 0x5b3015c2 ); }
5156 const TCHAR* Category () { return _T (" Chrutilities" ); }
@@ -230,9 +235,13 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc,
230235#endif
231236
232237 IfcParse::IfcFile file (fn_mb);
233- IfcGeom::Iterator<float > iterator (settings, &file);
238+
239+ // IfcGeom::Iterator<float> iterator(settings, &file);
240+
241+ IfcGeom::Iterator* iterator = new IfcGeom::Iterator ( settings, &file);
242+
234243 delete fn_mb;
235- if (!iterator. initialize ()) return false ;
244+ if (!iterator-> initialize ()) return false ;
236245
237246 itfc->ProgressStart (_T (" Importing file..." ), TRUE , fn, NULL );
238247
@@ -242,10 +251,12 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc,
242251 std::map<std::vector<std::string>, Mtl*> material_cache;
243252
244253 do {
245- const IfcGeom::TriangulationElement<float >* o = static_cast <const IfcGeom::TriangulationElement<float >*>(iterator.get ());
254+ const IfcGeom::Element* element = static_cast <const IfcGeom::Element*>(iterator->get ());
255+ const IfcGeom::TriangulationElement* o = static_cast <const IfcGeom::TriangulationElement*>(iterator->get ());
246256
247257 TSTR o_type = S (o->type ());
248258 TSTR o_guid = S (o->guid ());
259+ TSTR o_name = S (o->name ());
249260
250261 Mtl *m = ComposeMultiMaterial (material_cache, mats, itfc, slot, o->geometry ().materials (), o->type (), o->geometry ().material_ids ());
251262
@@ -307,19 +318,22 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc,
307318
308319 ImpNode* node = impitfc->CreateNode ();
309320 node->Reference (tri);
310- node->SetName (o_guid);
321+
322+ node->SetName ( o_name );
323+
311324 node->GetINode ()->Hide (o->type () == " IfcOpeningElement" || o->type () == " IfcSpace" );
312325 if (m) {
313326 node->GetINode ()->SetMtl (m);
314327 }
315- const std::vector<float >& matrix_data = o->transformation ().matrix ().data ();
328+ const std::vector<double >& matrix_data = o->transformation ().matrix ().data ();
329+
316330 node->SetTransform (0 ,Matrix3 ( Point3 (matrix_data[0 ],matrix_data[1 ],matrix_data[2 ]),Point3 (matrix_data[3 ],matrix_data[4 ],matrix_data[5 ]),
317331 Point3 (matrix_data[6 ],matrix_data[7 ],matrix_data[8 ]),Point3 (matrix_data[9 ],matrix_data[10 ],matrix_data[11 ]) ));
318332 impitfc->AddNodeToScene (node);
319333
320- itfc->ProgressUpdate (iterator. progress (), true , _T (" " ));
334+ itfc->ProgressUpdate (iterator-> progress (), true , _T (" " ));
321335
322- } while (iterator. next ());
336+ } while (iterator-> next ());
323337
324338 itfc->ProgressEnd ();
325339
0 commit comments