• ### Popular Now

• 13
• 15
• 27
• 9
• 9

This topic is 2760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello.
I have a class that controls the importation and a class that imports data from collada with colladaDom.
This because i can import from collada ,fbx and 3ds with polimorphism
I would structure my collada importer to scroll through the scene and , each node would like to see what kind of node is: light, mesh, etc. ... controller and call the import functions that are in the control class.
In this class, depending on the type of node called the Import function found on, for example Importlight (), ImportMesh (), Importcontroller ().
Only it did not succeed.
This is the test code:

//import manager
//.hGenericImporter m_pApi;//.cppImportManager::ImportManager(nTypeImporter){    switch(nTypeImporter)    {       case COLLADA_MY:          m_pApi = new colladaImporter();       break;       case FBX_MY:          m_pApi = new FBXImporter();       break;       case 3DS_MY:          m_pApi new 3DSImporter();         break;    }}int nType = 0;ImportSceneNode(string* strID, string* strIDParent, bool* bISJoint, DX_POSITION* pos, int* pType/*pType is returned by the function to the controller class*/)   switch(pType){   case MESH_MY:       m_pApi->importMesh();       break;   case CONTROLLER_MY:       m_pApi->importController();       break;   case SKELETON_MY:       m_pApi->importSkeleton();       break;}

bool CColladaSkinMeshImporter::ImportSceneNode(string* strID, string* strIDParent, bool* bISJoint, DX_POSITION* pos, int* pNNodeType/*pNNodeType is returned by the function to the controller class*/)   {   if(m_CurrentNode->getType() == NODETYPE_NODE )   {      int n =m_CurrentNode->getElementType();      switch(   m_CurrentNode->getType()){         case COLLADA_TYPE::INSTANCE_GEOMETRY:            *pNNodeType = MESH_MY;         break;         case COLLADA_TYPE::INSTANCE_CONTROLLER:            *pNNodeType = MESH_MY;         break;         case COLLADA_TYPE::INSTANCE_NODE:             *pNNodeType = SKELETON_MY;         return true;      }   }   return false;}			I saw that you could also count the number of instances of a node and import with a switch on the panel, would work equally, but I would do one thing clear: how can I "control" the import depending on the type of node?Thank you.