aViewWindow->Repaint();
break;
}
- else
+ else {
+ if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
+ aPlot2d->Repaint();
displayer()->Display(anIO->getEntry());
+ }
case VISU::TCURVE:
case VISU::TCONTAINER:
case VISU::TTABLE:
VisuGUI
::OnDisplayOnlyPrs()
{
+ /// to correct IMP 0016100
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ if (!aSelectionMgr)
+ return;
+
+ SALOME_ListIO aSel, aList;
+ aSelectionMgr->selectedObjects(aSel);
+ extractContainers(aSel, aList);
+ Handle(SALOME_InteractiveObject) anIO = aList.First();
+ activateAppropriateViewer(anIO);
OnEraseAll();
OnDisplayPrs();
}
+void VisuGUI::activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO )
+{
+ TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), theIO->getEntry());
+ VISU::Base_i* aBase = anObjectInfo.myBase;
+ if(!aBase)
+ return;
+
+ std::string anEntry = theIO->getEntry();
+ _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+ _PTR(SObject) SO = aCStudy->FindObjectID( theIO->getEntry() );
+
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(SO);
+ if(CORBA::is_nil(aCORBAObject))
+ return;
+
+ VISU::VISUType aType = aBase->GetType();
+
+ if ( VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase) ) {
+ // activate SVTK Viewer
+ getApp()->getViewManager( SVTK_Viewer::Type(), true );
+ return;
+ }
+
+ switch (aType) {
+ case VISU::TCURVE:
+ case VISU::TCONTAINER:
+ case VISU::TTABLE: {
+ // Activate Plot2d
+ GetPlot2dViewer(this, true);
+ }
+ case VISU::TCOLOREDPRS3DHOLDER :
+ case VISU::TPOINTMAP3D : {
+ //find curves under pointmap 3d
+ bool hasCurvesChildren = false;
+
+ SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
+ QString aViewerType = aViewMgr->getType();
+
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(SO);
+ _PTR(SObject) aChild;
+ for (; anIter->More(); anIter->Next()) {
+ aChild = anIter->Value();
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aChild);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if( VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in()))
+ hasCurvesChildren = true;
+ }
+ }
+
+ if (hasCurvesChildren && ( aViewerType == SPlot2d_Viewer::Type() || aViewerType == SVTK_Viewer::Type() ) ) {
+ return;
+ } else {
+ // activate SVTK Viewer
+ cout << "NO CURVES!!!!!!!!!!" << endl;
+ getApp()->getViewManager( SVTK_Viewer::Type(), true );
+ return;
+ }
+ break;
+ }
+ }
+}
+
void
VisuGUI
::OnErasePrs()