1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // VISU VISUGUI : GUI of VISU component
24 // File : VisuGUI_Selection.cxx
25 // Author : Sergey Anikin
28 #include "VisuGUI_Selection.h"
30 #include "VisuGUI_ViewTools.h"
31 #include "VisuGUI_Tools.h"
33 #include "VISU_Result_i.hh"
34 #include "VISU_Gen_i.hh"
36 #include "VISU_Actor.h"
37 #include "VISU_ScalarMapAct.h"
38 #include "VISU_GaussPtsAct.h"
40 #include "SalomeApp_Study.h"
41 #include "LightApp_Study.h"
42 #include "LightApp_Displayer.h"
46 //////////////////////////////////////////////////
47 // Class: VisuGUI_Selection
48 //////////////////////////////////////////////////
51 //---------------------------------------------------------------
52 QVariant VisuGUI_Selection::parameter( const int ind, const QString& p ) const
54 QVariant val( LightApp_Selection::parameter( ind, p ) );
55 if ( !val.isValid() ) {
56 if ( p == "type" ) val = QVariant( type( ind ) );
57 else if ( p == "isFieldPrs" ) val = QVariant( isFieldPrs( ind ) );
58 else if ( p == "nbComponents" ) val = QVariant( nbComponents( ind ) );
59 else if ( p == "medEntity" ) val = QVariant( medEntity( ind ) );
60 else if ( p == "medSource" ) val = QVariant( medSource( ind ) );
61 else if ( p == "representation" ) val = QVariant( representation( ind ) );
62 else if ( p == "nbTimeStamps" ) val = QVariant( nbTimeStamps( ind ) );
63 else if ( p == "nbChildren" ) val = QVariant( nbChildren( ind ) );
64 else if ( p == "nbNamedChildren") val = QVariant( nbNamedChildren( ind ) );
65 else if ( p == "isVisible" ) val = QVariant( isVisible( ind ) );
66 else if ( p == "isShrunk" ) val = QVariant( isShrunk( ind ) );
67 else if ( p == "hasActor" ) val = QVariant( hasActor( ind ) );
68 else if ( p == "isShading" ) val = QVariant( isShading( ind ) );
69 else if ( p == "isScalarMapAct" ) val = QVariant( isScalarMapAct( ind ) );
70 else if ( p == "isGaussPtsAct" ) val = QVariant( isGaussPtsAct( ind ) );
71 else if ( p == "isVisuComponent") val = QVariant( isVisuComponent( ind ) );
72 else if ( p == "fullResolution" ) val = QVariant( fullResolution( ind ) );
73 else if ( p == "mediumResolution" ) val = QVariant( mediumResolution( ind ) );
74 else if ( p == "lowResolution" ) val = QVariant( lowResolution( ind ) );
75 else if ( p == "resolutionState" ) val = QVariant( resolutionState( ind ) );
76 else if ( p == "isThereAreVisibleCurves" ) val = QVariant( findDisplayedCurves( ind, false ) );
77 else if ( p == "isThereAreHiddenCurves" ) val = QVariant( findDisplayedCurves( ind, true ) );
78 else if ( p == "hasCurves" ) val = QVariant( hasCurves( ind ) );
79 else if ( p == "isPlot2dViewer" ) val = QVariant( Plot2dViewerType( ind ) );
80 else if ( p == "isValuesLabeled" ) val = QVariant( isValuesLabeled( ind ) );
81 else if ( p == "isScalarBarVisible" ) val = QVariant( isScalarBarVisible( ind ) );
82 else if ( p == "quadratic2DMode" ) val = QVariant( quadratic2DMode(ind) );
89 //---------------------------------------------------------------
90 // Macro for converting VISU enumeration items into corresponding strings
91 #define ENUM2STRING( x, y ) \
96 QString VisuGUI_Selection::type( const int ind ) const
99 SalomeApp_Study* aStudy = GetStudy();
103 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
104 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
106 VISU::Base_i* aBase = anObjectInfo.myBase;
108 VISU::VISUType aType = aBase->GetType();
109 if(aType == VISU::TCOLOREDPRS3DHOLDER){
110 CORBA::Object_var anObject = ClientSObjectToObject(anObjectInfo.mySObject);
111 VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
112 aType = aHolder->GetPrsType();
115 ENUM2STRING( aResStr, VISU::TVISUGEN );
116 ENUM2STRING( aResStr, VISU::TRESULT );
117 ENUM2STRING( aResStr, VISU::TTABLE );
118 ENUM2STRING( aResStr, VISU::TCURVE );
119 ENUM2STRING( aResStr, VISU::TCONTAINER );
120 ENUM2STRING( aResStr, VISU::TMESH );
121 ENUM2STRING( aResStr, VISU::TSCALARMAP );
122 ENUM2STRING( aResStr, VISU::TISOSURFACES );
123 ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
124 ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
125 ENUM2STRING( aResStr, VISU::TCUTPLANES );
126 ENUM2STRING( aResStr, VISU::TCUTLINES );
127 ENUM2STRING( aResStr, VISU::TCUTSEGMENT );
128 ENUM2STRING( aResStr, VISU::TVECTORS );
129 ENUM2STRING( aResStr, VISU::TSTREAMLINES );
130 ENUM2STRING( aResStr, VISU::TPLOT3D );
131 ENUM2STRING( aResStr, VISU::TANIMATION );
132 ENUM2STRING( aResStr, VISU::TPOINTMAP3D );
136 if(aResStr.isNull()){
137 VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aMap);
139 ENUM2STRING( aResStr, VISU::TENTITY );
140 ENUM2STRING( aResStr, VISU::TFAMILY );
141 ENUM2STRING( aResStr, VISU::TGROUP );
142 ENUM2STRING( aResStr, VISU::TVIEW3D );
143 ENUM2STRING( aResStr, VISU::TFIELD );
144 ENUM2STRING( aResStr, VISU::TTIMESTAMP );
148 if(aResStr.isNull()){
150 QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist);
151 if ( anIsExist && aVal != "MESH" )
152 aResStr = "VISU::T" + aVal;
159 //---------------------------------------------------------------
160 bool VisuGUI_Selection::isFieldPrs( const int ind ) const
162 SalomeApp_Study* aStudy = GetStudy();
166 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
167 VISU::Base_i* aBase = anObjectInfo.myBase;
168 return ( aBase && aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER );
172 //---------------------------------------------------------------
173 QString VisuGUI_Selection::nbComponents( const int ind ) const
176 SalomeApp_Study* aStudy = GetStudy();
180 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
181 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
184 QString aVal = VISU::Storable::FindValue(aMap,"myNumComponent",&isExist);
191 //---------------------------------------------------------------
192 QString VisuGUI_Selection::resolutions( const int ind ) const
195 SalomeApp_Study* aStudy = GetStudy();
199 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ).toLatin1().data());
200 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
203 QString aVal = VISU::Storable::FindValue(aMap,"myResolutions",&isExist);
211 //---------------------------------------------------------------
212 QString VisuGUI_Selection::resolution( const int ind, char theResoltuion ) const
216 QString aResolutions = resolutions( ind );
217 if(aResolutions.isEmpty())
220 if(aResolutions.indexOf(theResoltuion) != -1)
229 //---------------------------------------------------------------
230 QString VisuGUI_Selection::fullResolution( const int ind ) const
232 return resolution( ind, 'F');
236 //---------------------------------------------------------------
237 QString VisuGUI_Selection::mediumResolution( const int ind ) const
239 return resolution( ind, 'M');
243 //---------------------------------------------------------------
244 QString VisuGUI_Selection::lowResolution( const int ind ) const
246 return resolution( ind, 'L');
250 //---------------------------------------------------------------
251 QString VisuGUI_Selection::resolutionState( const int ind ) const
254 SalomeApp_Study* aStudy = GetStudy();
258 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ).toLatin1().data());
259 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
262 QString aVal = VISU::Storable::FindValue(aMap,"myState",&isExist);
264 if ( aVal.toInt() == VISU::Result::FULL )
266 if ( aVal.toInt() == VISU::Result::MEDIUM )
268 if ( aVal.toInt() == VISU::Result::LOW )
270 if ( aVal.toInt() == VISU::Result::HIDDEN )
278 //---------------------------------------------------------------
279 QString VisuGUI_Selection::medEntity( const int ind ) const
281 SalomeApp_Study* aStudy = GetStudy();
285 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
286 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
289 QString aVal = VISU::Storable::FindValue(aMap,"myEntityId",&isExist);
291 using namespace VISU;
292 TEntity anEntityId = TEntity(aVal.toInt());
295 return "NODE_ENTITY";
297 return "EDGE_ENTITY";
299 return "FACE_ENTITY";
301 return "CELL_ENTITY";
309 QString VisuGUI_Selection::medSource( const int ind ) const
311 _PTR(Study) aStudyDS = GetStudy()->studyDS();
312 if(_PTR(SObject) aSObject = aStudyDS->FindObjectID((const char*)entry(ind).toLatin1())){
313 VISU::Result_var aRes;
314 if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){
315 using namespace VISU;
316 Result_i::ECreationId aCreationId = aResult->GetCreationId();
318 case Result_i::eImportFile :
319 return "eImportFile";
320 case Result_i::eCopyAndImportFile :
321 return "eCopyAndImportFile";
322 case Result_i::eImportMed :
324 case Result_i::eImportMedField :
325 return "eImportMedField";
334 QString VisuGUI_Selection::nbTimeStamps( const int ind ) const
337 SalomeApp_Study* aStudy = GetStudy();
341 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
342 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
345 const QString& aVal = VISU::Storable::FindValue(aMap,"myNbTimeStamps",&isExist);
352 //----------------------------------------------------------------------------
353 template<class TPopupFunctor>
354 struct TPopupDispatcher
357 operator()(const SalomeApp_Module* theModule,
358 const QString& theEntry)
360 if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
361 QString aType = aViewManager->getType();
362 TPopupFunctor aFunctor;
363 if(aType == SVTK_Viewer::Type())
364 return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
365 //else if(aType == VVTK_Viewer::Type())
366 //return aFunctor.template Get<VVTK_Viewer>(theModule, theEntry);
373 //----------------------------------------------------------------------------
374 template<class TViewer>
376 GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
377 const QString& theEntry,
378 VISU::Prs3d_i*& thePrs3d,
379 SVTK_ViewWindow*& theViewWindow,
380 VISU_Actor*& thenActor)
382 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), (const char*)theEntry.toLatin1());
383 thePrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
387 typedef typename TViewer::TViewWindow TViewWindow;
388 theViewWindow = GetActiveViewWindow<TViewWindow>(theModule);
392 thenActor = FindActor(theViewWindow, thePrs3d);
400 //----------------------------------------------------------------------------
403 template<class TViewer>
405 Get(const SalomeApp_Module* theModule,
406 const QString& theEntry)
408 VISU_Actor* anActor = NULL;
409 VISU::Prs3d_i* aPrs3d = NULL;
410 VISU_ActorBase* anActorBase = NULL;
411 VISU::PointMap3d_i* aPointMap3d = NULL;
412 SVTK_ViewWindow* aViewWindow = NULL;
413 if(GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor))
414 return get(aPrs3d, aViewWindow, anActor);
416 aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
417 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
418 if ( aSelectionInfo.empty() )
420 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
421 aPointMap3d = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
422 anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d);
423 return getPointMap(aPointMap3d, aViewWindow, anActorBase);
429 get(VISU::Prs3d_i* thePrs3d,
430 SVTK_ViewWindow* theViewWindow,
431 VISU_Actor* theActor)
438 getPointMap(VISU::PointMap3d_i* thePrs3d,
439 SVTK_ViewWindow* theViewWindow,
440 VISU_ActorBase* theActor)
447 //----------------------------------------------------------------------------
448 struct TGetRepesentationFunctor: TViewFunctor
452 get(VISU::Prs3d_i* thePrs3d,
453 SVTK_ViewWindow* theViewWindow,
454 VISU_Actor* theActor)
457 switch (theActor->GetRepresentation()) {
458 ENUM2STRING( aResStr, VISU::POINT );
459 ENUM2STRING( aResStr, VISU::WIREFRAME );
460 ENUM2STRING( aResStr, VISU::SHADED );
461 ENUM2STRING( aResStr, VISU::INSIDEFRAME );
462 ENUM2STRING( aResStr, VISU::SURFACEFRAME );
463 ENUM2STRING( aResStr, VISU::FEATURE_EDGES );
470 getPointMap(VISU::PointMap3d_i* thePrs3d,
471 SVTK_ViewWindow* theViewWindow,
472 VISU_ActorBase* theActorBase)
474 QString aResStr = "";
476 switch (theActorBase->GetRepresentation()) {
477 ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
478 ENUM2STRING( aResStr, VISU::SHADED ); // = 2
485 QString VisuGUI_Selection::representation( const int ind ) const
487 return TPopupDispatcher<TGetRepesentationFunctor>()(myModule, entry(ind));
490 //----------------------------------------------------------------------------
491 SalomeApp_Study* VisuGUI_Selection::GetStudy() const
494 LightApp_Study* aLightStudy = const_cast<LightApp_Study*>( study() );
495 return dynamic_cast<SalomeApp_Study*>( aLightStudy );
498 //----------------------------------------------------------------------------
499 int VisuGUI_Selection::nbChild( const int ind, const bool named ) const
502 SalomeApp_Study* aSStudy = GetStudy();
505 _PTR(Study) aStudy = GetCStudy( aSStudy );
507 _PTR(SObject) SO = aStudy->FindObjectID( (const char*)entry( ind ).toLatin1() );
509 for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
511 if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
519 //----------------------------------------------------------------------------
520 int VisuGUI_Selection::nbChildren( const int ind ) const
522 return nbChild( ind, false );
525 //----------------------------------------------------------------------------
526 int VisuGUI_Selection::nbNamedChildren( const int ind ) const
528 return nbChild( ind, true );
532 //----------------------------------------------------------------------------
533 struct TIsVisibleFunctor: TViewFunctor
537 get(VISU::Prs3d_i* thePrs3d,
538 SVTK_ViewWindow* theViewWindow,
539 VISU_Actor* theActor)
541 return theActor->GetVisibility() ? "true" : "false";
545 QString VisuGUI_Selection::isVisible( const int ind ) const
547 return TPopupDispatcher<TIsVisibleFunctor>()(myModule, entry(ind));
551 //----------------------------------------------------------------------------
552 struct TIsShrunkFunctor: TViewFunctor
556 get(VISU::Prs3d_i* thePrs3d,
557 SVTK_ViewWindow* theViewWindow,
558 VISU_Actor* theActor)
560 return theActor->IsShrunk() ? "1" : "0";
565 getPointMap(VISU::PointMap3d_i* thePointMap,
566 SVTK_ViewWindow* theViewWindow,
567 VISU_ActorBase* theActorBase)
570 return theActorBase->IsShrunk() ? "1" : "0";
575 QString VisuGUI_Selection::isShrunk( const int ind ) const
577 return TPopupDispatcher<TIsShrunkFunctor>()(myModule, entry(ind));
581 //----------------------------------------------------------------------------
582 bool VisuGUI_Selection::hasActor( const int ind ) const
584 return !representation( ind ).isEmpty();
588 //----------------------------------------------------------------------------
589 struct TIsShadingFunctor: TViewFunctor
593 get(VISU::Prs3d_i* thePrs3d,
594 SVTK_ViewWindow* theViewWindow,
595 VISU_Actor* theActor)
597 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
598 return anActor->IsShading() ? "1" : "0";
603 QString VisuGUI_Selection::isShading( const int ind ) const
605 return TPopupDispatcher<TIsShadingFunctor>()(myModule, entry(ind));
609 //----------------------------------------------------------------------------
610 struct TIsScalarMapActFunctor: TViewFunctor
614 get(VISU::Prs3d_i* thePrs3d,
615 SVTK_ViewWindow* theViewWindow,
616 VISU_Actor* theActor)
618 return dynamic_cast<VISU_ScalarMapAct*>(theActor)? "1" : "0";
623 //---------------------------------------------------------------
624 QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
626 return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
629 //----------------------------------------------------------------------------
630 struct TIsGaussPtsActFunctor: TViewFunctor
634 get(VISU::Prs3d_i* thePrs3d,
635 SVTK_ViewWindow* theViewWindow,
636 VISU_Actor* theActor)
638 return dynamic_cast<VISU_GaussPtsAct*>(theActor)? "1" : "0";
643 //---------------------------------------------------------------
644 QString VisuGUI_Selection::isGaussPtsAct( const int ind ) const
646 return TPopupDispatcher<TIsGaussPtsActFunctor>()(myModule, entry(ind));
649 //----------------------------------------------------------------------------
650 bool VisuGUI_Selection::isVisuComponent( const int ind ) const
652 SalomeApp_Study* study = GetStudy();
656 _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry( ind ).toLatin1() );
659 CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
660 if( CORBA::is_nil( anObj ) )
663 return dynamic_cast<VISU::VISU_Gen_i*>( VISU::GetServant( anObj ).in() );
666 //---------------------------------------------------------------------------
667 bool VisuGUI_Selection::findDisplayedCurves( const int ind, bool findHidden ) const
669 // findHidden == false - find at least one Visible curve in the childs of ind
670 // findHidden == true - find at least one Hidden curve in the childs of ind
671 SalomeApp_Study* aSStudy = GetStudy();
676 _PTR(Study) aStudy = GetCStudy( aSStudy );
678 _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
680 for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
682 if ( Iter->Value()->ReferencedObject(refSO) )
683 entryId = refSO->GetID().c_str();
685 entryId = Iter->Value()->GetID().c_str();
687 LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
688 if ( displayer->IsDisplayed( entryId ) && findHidden == false )
690 else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
698 //---------------------------------------------------------------------------
699 bool VisuGUI_Selection::hasCurves( const int ind ) const
701 SalomeApp_Study* aSStudy = GetStudy();
706 _PTR(Study) aStudy = GetCStudy( aSStudy );
708 _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
710 for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
712 if ( Iter->Value()->ReferencedObject(refSO) ) {
713 // reference on curve
716 refSO = Iter->Value();
718 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
719 if(!CORBA::is_nil(aCORBAObject)){
720 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
721 if(dynamic_cast<VISU::Curve_i*>(aServant.in()))
730 //---------------------------------------------------------------------------
731 bool VisuGUI_Selection::Plot2dViewerType( const int ind ) const
734 SUIT_Session* session = SUIT_Session::session();
735 if( SUIT_Application* app = session->activeApplication() )
736 if( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) )
737 if( SUIT_ViewManager* vman = sApp->activeViewManager() )
738 if( SUIT_ViewModel* vmod = vman->getViewModel() ) {
739 viewerType = vmod->getType();
740 if (viewerType ==SPlot2d_Viewer::Type())
746 //----------------------------------------------------------------------------
747 struct TIsValuesLabeled : TViewFunctor
751 get(VISU::Prs3d_i* thePrs3d,
752 SVTK_ViewWindow* theViewWindow,
753 VISU_Actor* theActor)
755 return theActor && theActor->GetValuesLabeled() ? "true" : "false";
759 QString VisuGUI_Selection::isValuesLabeled( const int ind ) const
761 return TPopupDispatcher<TIsValuesLabeled>()(myModule, entry(ind));
764 //----------------------------------------------------------------------------
765 struct TIsScalarBarVisibleFunctor: TViewFunctor
769 get(VISU::Prs3d_i* thePrs3d,
770 SVTK_ViewWindow* theViewWindow,
771 VISU_Actor* theActor)
773 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
774 return anActor->GetBarVisibility() ? "true" : "false";
775 else if ( VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor))
776 return anActor->GetBarVisibility() ? "true" : "false";
781 bool VisuGUI_Selection::isScalarBarVisible( const int ind ) const
783 return TPopupDispatcher<TIsScalarBarVisibleFunctor>()(myModule, entry(ind)) == "true";
786 struct TGetQuadratic2DRepresentation: TViewFunctor
788 QString virtual get (VISU::Prs3d_i* thePrs3d,
789 SVTK_ViewWindow* theViewWindow,
790 VISU_Actor* theActor)
792 if(theActor->GetQuadratic2DRepresentation() == VISU_Actor::eLines)
793 return "VISU::LINES";
794 else if (theActor->GetQuadratic2DRepresentation() == VISU_Actor::eArcs)
802 QString VisuGUI_Selection::quadratic2DMode( const int ind) const
804 return TPopupDispatcher<TGetQuadratic2DRepresentation>()(myModule, entry(ind));