+ // MED file object
+ std::string lMEDFile = obj->getFilename();
+ std::string lMEDFileName = multipr::getFilenameWithoutPath(lMEDFile.c_str());
+ MULTIPR_GUI_DataObject_Mesh* dataObjectMED =
+ new MULTIPR_GUI_DataObject_Mesh(modelRoot, lMEDFileName.c_str());
+
+ // MESH object
+ MULTIPR_ORB::string_array* listParts = obj->getParts();
+
+ if (listParts->length() >= 1)
+ {
+ const char* strPartName0 = (*listParts)[0];
+ char* strPartInfo0 = obj->getPartInfo(strPartName0);
+
+ char lMeshName[256];
+ int lId;
+ char lPartName[256];
+ char lPath[256];
+ char lMEDFileName[256];
+
+ // parse infos
+ int ret = sscanf(strPartInfo0, "%s %d %s %s %s",
+ lMeshName,
+ &lId,
+ lPartName,
+ lPath,
+ lMEDFileName);
+
+ if (ret != 5)
+ {
+ cout << "MULTIPR: build() tree; error while parsing part info" << endl;
+ std::runtime_error("MULTIPR: build() tree; error while parsing part info");
+ return;
+ }
+
+ MULTIPR_GUI_DataObject_Mesh* dataObjectMesh =
+ new MULTIPR_GUI_DataObject_Mesh(dataObjectMED, lMeshName);
+
+ // PART and RESOLUTION objects
+ MULTIPR_GUI_DataObject_Part* dataObjectPart_prev = NULL;
+
+ for (int i = 0 ; i < listParts->length() ; i++)
+ {
+ const char* strItem = (*listParts)[i];
+ char* strPartInfo = obj->getPartInfo(strItem);
+
+ // parse infos
+ int ret = sscanf(strPartInfo, "%s %d %s %s %s",
+ lMeshName,
+ &lId,
+ lPartName,
+ lPath,
+ lMEDFileName);
+
+ if (ret != 5) return;
+
+ if ((strstr(lPartName,"_MED") != NULL) || (strstr(lPartName,"_LOW") != NULL))
+ {
+ new MULTIPR_GUI_DataObject_Resolution(dataObjectPart_prev, strItem, strPartInfo);
+ }
+ else
+ {
+ dataObjectPart_prev = new MULTIPR_GUI_DataObject_Part(dataObjectMesh, strItem, strPartInfo);
+ }
+ }
+ }