Open gsohler opened 6 months ago
I tried to read all BaseMaterialGroups when importing a 3MF Model
I tried this:
Lib3MF::PBaseMaterialGroupIterator basematerial_it = model->GetBaseMaterialGroups(); while (true) { if(!basematerial_it->MoveNext()) break; std::shared_ptr<Lib3MF::CResource> cr = basematerial_it->GetCurrent(); std::shared_ptr<Lib3MF::CBaseMaterialGroup> mat = std::dynamic_pointer_cast<Lib3MF::CBaseMaterialGroup>(cr); if(mat != nullptr) { cout << "worked\n"; } else cout << "Pointer cast not working\n"; }
However, the dynamic_pointer_cast does not work even though, reading the header file, CBaseMaterialGroup is derived from CResource ?
So whats wrong in my strategy ? How can I get all MaterialGroups ?
class CBaseMaterialGroup : public CResource
I tried to read all BaseMaterialGroups when importing a 3MF Model
I tried this:
However, the dynamic_pointer_cast does not work even though, reading the header file, CBaseMaterialGroup is derived from CResource ?
So whats wrong in my strategy ? How can I get all MaterialGroups ?
class CBaseMaterialGroup : public CResource