- _salomeModule->engine()->registerPresentation(_CAST(Study, studyDS)->GetStudy(), fieldId,
- oss.str().c_str(), type.c_str(),ico.c_str(), presentationId);
-
-
- // MEDCALC::ViewModeType viewMode = MEDFactoryClient::getPresentationManager()->getPresentationViewMode(presentationId);
- //
- // // Remove sibling presentations if view mode is set to REPLACE
- // if (viewMode == MEDCALC::VIEW_MODE_REPLACE) {
- // MED_ORB::PresentationsList* presList = _salomeModule->engine()->getSiblingPresentations(_CAST(Study, studyDS)->GetStudy(), presentationId);
- // CORBA::ULong size = presList->length();
- //
- // std::stringstream sstm;
- // sstm << "Removing sibling presentation(s): ";
- // for (int i = 0; i < size; ++i)
- // sstm << (*presList)[i] << " ";
- // STDLOG(sstm.str());
- //
- // for (int i = 0; i < size; ++i) {
- // PresentationEvent* event = new PresentationEvent();
- // event->eventtype = PresentationEvent::EVENT_DELETE_PRESENTATION;
- // XmedDataObject* dataObject = new XmedDataObject();
- // dataObject->setPresentationId((*presList)[i]);
- // event->objectdata = dataObject;
- // emit presentationSignal(event); // --> WorkspaceController::processPresentationEvent
- // }
- //
- // delete presList;
- // }
+ // Mesh views are always registered at the mesh level:
+ if (type == MEDPresentationMeshView::TYPE_NAME)
+ {
+ _salomeModule->engine()->registerPresentationMesh(_CAST(Study, studyDS)->GetStudy(), dataId,
+ oss.str().c_str(), type.c_str(),ico.c_str(), presentationId);
+ }
+ else
+ _salomeModule->engine()->registerPresentationField(_CAST(Study, studyDS)->GetStudy(), dataId,
+ oss.str().c_str(), type.c_str(),ico.c_str(), presentationId);