1 // Copyright (C) 2007-2008 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
22 // VISU VISUGUI : GUI of VISU component
23 // File : VisuGUI_Selection.cxx
24 // Author : Sergey Anikin
27 #include "VisuGUI_Selection.h"
29 #include "VisuGUI_ViewTools.h"
30 #include "VisuGUI_Tools.h"
32 #include "VISU_Result_i.hh"
33 #include "VISU_Gen_i.hh"
35 #include "VISU_Actor.h"
36 #include "VISU_ScalarMapAct.h"
37 #include "VISU_GaussPtsAct.h"
39 #include "SalomeApp_Study.h"
40 #include "LightApp_Study.h"
41 #include "LightApp_Displayer.h"
45 //////////////////////////////////////////////////
46 // Class: VisuGUI_Selection
47 //////////////////////////////////////////////////
50 //---------------------------------------------------------------
51 QVariant VisuGUI_Selection::parameter( const int ind, const QString& p ) const
53 QVariant val( LightApp_Selection::parameter( ind, p ) );
54 if ( !val.isValid() ) {
55 if ( p == "type" ) val = QVariant( type( ind ) );
56 else if ( p == "isFieldPrs" ) val = QVariant( isFieldPrs( ind ) );
57 else if ( p == "nbComponents" ) val = QVariant( nbComponents( ind ) );
58 else if ( p == "medEntity" ) val = QVariant( medEntity( ind ) );
59 else if ( p == "medSource" ) val = QVariant( medSource( ind ) );
60 else if ( p == "representation" ) val = QVariant( representation( ind ) );
61 else if ( p == "nbTimeStamps" ) val = QVariant( nbTimeStamps( ind ) );
62 else if ( p == "nbChildren" ) val = QVariant( nbChildren( ind ) );
63 else if ( p == "nbNamedChildren") val = QVariant( nbNamedChildren( ind ) );
64 else if ( p == "isVisible" ) val = QVariant( isVisible( ind ) );
65 else if ( p == "isShrunk" ) val = QVariant( isShrunk( ind ) );
66 else if ( p == "hasActor" ) val = QVariant( hasActor( ind ) );
67 else if ( p == "isShading" ) val = QVariant( isShading( ind ) );
68 else if ( p == "isScalarMapAct" ) val = QVariant( isScalarMapAct( ind ) );
69 else if ( p == "isGaussPtsAct" ) val = QVariant( isGaussPtsAct( ind ) );
70 else if ( p == "isVisuComponent") val = QVariant( isVisuComponent( ind ) );
71 else if ( p == "fullResolution" ) val = QVariant( fullResolution( ind ) );
72 else if ( p == "mediumResolution" ) val = QVariant( mediumResolution( ind ) );
73 else if ( p == "lowResolution" ) val = QVariant( lowResolution( ind ) );
74 else if ( p == "resolutionState" ) val = QVariant( resolutionState( ind ) );
75 else if ( p == "isThereAreVisibleCurves" ) val = QVariant( findDisplayedCurves( ind, false ) );
76 else if ( p == "isThereAreHiddenCurves" ) val = QVariant( findDisplayedCurves( ind, true ) );
77 else if ( p == "hasCurves" ) val = QVariant( hasCurves( ind ) );
78 else if ( p == "isPlot2dViewer" ) val = QVariant( Plot2dViewerType( ind ) );
79 else if ( p == "isValuesLabeled" ) val = QVariant( isValuesLabeled( ind ) );
80 else if ( p == "isScalarBarVisible" ) val = QVariant( isScalarBarVisible( ind ) );
81 else if ( p == "quadratic2DMode" ) val = QVariant( quadratic2DMode(ind) );
88 //---------------------------------------------------------------
89 // Macro for converting VISU enumeration items into corresponding strings
90 #define ENUM2STRING( x, y ) \
95 QString VisuGUI_Selection::type( const int ind ) const
98 SalomeApp_Study* aStudy = GetStudy();
102 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
103 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
105 VISU::Base_i* aBase = anObjectInfo.myBase;
107 VISU::VISUType aType = aBase->GetType();
108 if(aType == VISU::TCOLOREDPRS3DHOLDER){
109 CORBA::Object_var anObject = ClientSObjectToObject(anObjectInfo.mySObject);
110 VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
111 aType = aHolder->GetPrsType();
114 ENUM2STRING( aResStr, VISU::TVISUGEN );
115 ENUM2STRING( aResStr, VISU::TRESULT );
116 ENUM2STRING( aResStr, VISU::TTABLE );
117 ENUM2STRING( aResStr, VISU::TCURVE );
118 ENUM2STRING( aResStr, VISU::TCONTAINER );
119 ENUM2STRING( aResStr, VISU::TMESH );
120 ENUM2STRING( aResStr, VISU::TSCALARMAP );
121 ENUM2STRING( aResStr, VISU::TISOSURFACES );
122 ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
123 ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
124 ENUM2STRING( aResStr, VISU::TCUTPLANES );
125 ENUM2STRING( aResStr, VISU::TCUTLINES );
126 ENUM2STRING( aResStr, VISU::TCUTSEGMENT );
127 ENUM2STRING( aResStr, VISU::TVECTORS );
128 ENUM2STRING( aResStr, VISU::TSTREAMLINES );
129 ENUM2STRING( aResStr, VISU::TPLOT3D );
130 ENUM2STRING( aResStr, VISU::TANIMATION );
131 ENUM2STRING( aResStr, VISU::TPOINTMAP3D );
135 if(aResStr.isNull()){
136 VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aMap);
138 ENUM2STRING( aResStr, VISU::TENTITY );
139 ENUM2STRING( aResStr, VISU::TFAMILY );
140 ENUM2STRING( aResStr, VISU::TGROUP );
141 ENUM2STRING( aResStr, VISU::TVIEW3D );
142 ENUM2STRING( aResStr, VISU::TFIELD );
143 ENUM2STRING( aResStr, VISU::TTIMESTAMP );
147 if(aResStr.isNull()){
149 QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist);
150 if ( anIsExist && aVal != "MESH" )
151 aResStr = "VISU::T" + aVal;
158 //---------------------------------------------------------------
159 bool VisuGUI_Selection::isFieldPrs( const int ind ) const
161 SalomeApp_Study* aStudy = GetStudy();
165 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
166 VISU::Base_i* aBase = anObjectInfo.myBase;
167 return ( aBase && aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER );
171 //---------------------------------------------------------------
172 QString VisuGUI_Selection::nbComponents( const int ind ) const
175 SalomeApp_Study* aStudy = GetStudy();
179 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
180 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
183 QString aVal = VISU::Storable::FindValue(aMap,"myNumComponent",&isExist);
190 //---------------------------------------------------------------
191 QString VisuGUI_Selection::resolutions( const int ind ) const
194 SalomeApp_Study* aStudy = GetStudy();
198 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ).toLatin1().data());
199 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
202 QString aVal = VISU::Storable::FindValue(aMap,"myResolutions",&isExist);
210 //---------------------------------------------------------------
211 QString VisuGUI_Selection::resolution( const int ind, char theResoltuion ) const
215 QString aResolutions = resolutions( ind );
216 if(aResolutions.isEmpty())
219 if(aResolutions.indexOf(theResoltuion) != -1)
228 //---------------------------------------------------------------
229 QString VisuGUI_Selection::fullResolution( const int ind ) const
231 return resolution( ind, 'F');
235 //---------------------------------------------------------------
236 QString VisuGUI_Selection::mediumResolution( const int ind ) const
238 return resolution( ind, 'M');
242 //---------------------------------------------------------------
243 QString VisuGUI_Selection::lowResolution( const int ind ) const
245 return resolution( ind, 'L');
249 //---------------------------------------------------------------
250 QString VisuGUI_Selection::resolutionState( const int ind ) const
253 SalomeApp_Study* aStudy = GetStudy();
257 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ).toLatin1().data());
258 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
261 QString aVal = VISU::Storable::FindValue(aMap,"myState",&isExist);
263 if ( aVal.toInt() == VISU::Result::FULL )
265 if ( aVal.toInt() == VISU::Result::MEDIUM )
267 if ( aVal.toInt() == VISU::Result::LOW )
269 if ( aVal.toInt() == VISU::Result::HIDDEN )
277 //---------------------------------------------------------------
278 QString VisuGUI_Selection::medEntity( const int ind ) const
280 SalomeApp_Study* aStudy = GetStudy();
284 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
285 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
288 QString aVal = VISU::Storable::FindValue(aMap,"myEntityId",&isExist);
290 using namespace VISU;
291 TEntity anEntityId = TEntity(aVal.toInt());
294 return "NODE_ENTITY";
296 return "EDGE_ENTITY";
298 return "FACE_ENTITY";
300 return "CELL_ENTITY";
308 QString VisuGUI_Selection::medSource( const int ind ) const
310 _PTR(Study) aStudyDS = GetStudy()->studyDS();
311 if(_PTR(SObject) aSObject = aStudyDS->FindObjectID((const char*)entry(ind).toLatin1())){
312 VISU::Result_var aRes;
313 if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){
314 using namespace VISU;
315 Result_i::ECreationId aCreationId = aResult->GetCreationId();
317 case Result_i::eImportFile :
318 return "eImportFile";
319 case Result_i::eCopyAndImportFile :
320 return "eCopyAndImportFile";
321 case Result_i::eImportMed :
323 case Result_i::eImportMedField :
324 return "eImportMedField";
333 QString VisuGUI_Selection::nbTimeStamps( const int ind ) const
336 SalomeApp_Study* aStudy = GetStudy();
340 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
341 VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
344 const QString& aVal = VISU::Storable::FindValue(aMap,"myNbTimeStamps",&isExist);
351 //----------------------------------------------------------------------------
352 template<class TPopupFunctor>
353 struct TPopupDispatcher
356 operator()(const SalomeApp_Module* theModule,
357 const QString& theEntry)
359 if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
360 QString aType = aViewManager->getType();
361 TPopupFunctor aFunctor;
362 if(aType == SVTK_Viewer::Type())
363 return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
364 //else if(aType == VVTK_Viewer::Type())
365 //return aFunctor.template Get<VVTK_Viewer>(theModule, theEntry);
372 //----------------------------------------------------------------------------
373 template<class TViewer>
375 GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
376 const QString& theEntry,
377 VISU::Prs3d_i*& thePrs3d,
378 SVTK_ViewWindow*& theViewWindow,
379 VISU_Actor*& thenActor)
381 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), (const char*)theEntry.toLatin1());
382 thePrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
386 typedef typename TViewer::TViewWindow TViewWindow;
387 theViewWindow = GetActiveViewWindow<TViewWindow>(theModule);
391 thenActor = FindActor(theViewWindow, thePrs3d);
399 //----------------------------------------------------------------------------
402 template<class TViewer>
404 Get(const SalomeApp_Module* theModule,
405 const QString& theEntry)
407 VISU_Actor* anActor = NULL;
408 VISU::Prs3d_i* aPrs3d = NULL;
409 VISU_ActorBase* anActorBase = NULL;
410 VISU::PointMap3d_i* aPointMap3d = NULL;
411 SVTK_ViewWindow* aViewWindow = NULL;
412 if(GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor))
413 return get(aPrs3d, aViewWindow, anActor);
415 aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
416 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
417 if ( aSelectionInfo.empty() )
419 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
420 aPointMap3d = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
421 anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d);
422 return getPointMap(aPointMap3d, aViewWindow, anActorBase);
428 get(VISU::Prs3d_i* thePrs3d,
429 SVTK_ViewWindow* theViewWindow,
430 VISU_Actor* theActor)
437 getPointMap(VISU::PointMap3d_i* thePrs3d,
438 SVTK_ViewWindow* theViewWindow,
439 VISU_ActorBase* theActor)
446 //----------------------------------------------------------------------------
447 struct TGetRepesentationFunctor: TViewFunctor
451 get(VISU::Prs3d_i* thePrs3d,
452 SVTK_ViewWindow* theViewWindow,
453 VISU_Actor* theActor)
456 switch (theActor->GetRepresentation()) {
457 ENUM2STRING( aResStr, VISU::POINT );
458 ENUM2STRING( aResStr, VISU::WIREFRAME );
459 ENUM2STRING( aResStr, VISU::SHADED );
460 ENUM2STRING( aResStr, VISU::INSIDEFRAME );
461 ENUM2STRING( aResStr, VISU::SURFACEFRAME );
462 ENUM2STRING( aResStr, VISU::FEATURE_EDGES );
469 getPointMap(VISU::PointMap3d_i* thePrs3d,
470 SVTK_ViewWindow* theViewWindow,
471 VISU_ActorBase* theActorBase)
473 QString aResStr = "";
475 switch (theActorBase->GetRepresentation()) {
476 ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
477 ENUM2STRING( aResStr, VISU::SHADED ); // = 2
484 QString VisuGUI_Selection::representation( const int ind ) const
486 return TPopupDispatcher<TGetRepesentationFunctor>()(myModule, entry(ind));
489 //----------------------------------------------------------------------------
490 SalomeApp_Study* VisuGUI_Selection::GetStudy() const
493 LightApp_Study* aLightStudy = const_cast<LightApp_Study*>( study() );
494 return dynamic_cast<SalomeApp_Study*>( aLightStudy );
497 //----------------------------------------------------------------------------
498 int VisuGUI_Selection::nbChild( const int ind, const bool named ) const
501 SalomeApp_Study* aSStudy = GetStudy();
504 _PTR(Study) aStudy = GetCStudy( aSStudy );
506 _PTR(SObject) SO = aStudy->FindObjectID( (const char*)entry( ind ).toLatin1() );
508 for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
510 if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
518 //----------------------------------------------------------------------------
519 int VisuGUI_Selection::nbChildren( const int ind ) const
521 return nbChild( ind, false );
524 //----------------------------------------------------------------------------
525 int VisuGUI_Selection::nbNamedChildren( const int ind ) const
527 return nbChild( ind, true );
531 //----------------------------------------------------------------------------
532 struct TIsVisibleFunctor: TViewFunctor
536 get(VISU::Prs3d_i* thePrs3d,
537 SVTK_ViewWindow* theViewWindow,
538 VISU_Actor* theActor)
540 return theActor->GetVisibility() ? "true" : "false";
544 QString VisuGUI_Selection::isVisible( const int ind ) const
546 return TPopupDispatcher<TIsVisibleFunctor>()(myModule, entry(ind));
550 //----------------------------------------------------------------------------
551 struct TIsShrunkFunctor: TViewFunctor
555 get(VISU::Prs3d_i* thePrs3d,
556 SVTK_ViewWindow* theViewWindow,
557 VISU_Actor* theActor)
559 return theActor->IsShrunk() ? "1" : "0";
564 getPointMap(VISU::PointMap3d_i* thePointMap,
565 SVTK_ViewWindow* theViewWindow,
566 VISU_ActorBase* theActorBase)
569 return theActorBase->IsShrunk() ? "1" : "0";
574 QString VisuGUI_Selection::isShrunk( const int ind ) const
576 return TPopupDispatcher<TIsShrunkFunctor>()(myModule, entry(ind));
580 //----------------------------------------------------------------------------
581 bool VisuGUI_Selection::hasActor( const int ind ) const
583 return !representation( ind ).isEmpty();
587 //----------------------------------------------------------------------------
588 struct TIsShadingFunctor: TViewFunctor
592 get(VISU::Prs3d_i* thePrs3d,
593 SVTK_ViewWindow* theViewWindow,
594 VISU_Actor* theActor)
596 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
597 return anActor->IsShading() ? "1" : "0";
602 QString VisuGUI_Selection::isShading( const int ind ) const
604 return TPopupDispatcher<TIsShadingFunctor>()(myModule, entry(ind));
608 //----------------------------------------------------------------------------
609 struct TIsScalarMapActFunctor: TViewFunctor
613 get(VISU::Prs3d_i* thePrs3d,
614 SVTK_ViewWindow* theViewWindow,
615 VISU_Actor* theActor)
617 return dynamic_cast<VISU_ScalarMapAct*>(theActor)? "1" : "0";
622 //---------------------------------------------------------------
623 QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
625 return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
628 //----------------------------------------------------------------------------
629 struct TIsGaussPtsActFunctor: TViewFunctor
633 get(VISU::Prs3d_i* thePrs3d,
634 SVTK_ViewWindow* theViewWindow,
635 VISU_Actor* theActor)
637 return dynamic_cast<VISU_GaussPtsAct*>(theActor)? "1" : "0";
642 //---------------------------------------------------------------
643 QString VisuGUI_Selection::isGaussPtsAct( const int ind ) const
645 return TPopupDispatcher<TIsGaussPtsActFunctor>()(myModule, entry(ind));
648 //----------------------------------------------------------------------------
649 bool VisuGUI_Selection::isVisuComponent( const int ind ) const
651 SalomeApp_Study* study = GetStudy();
655 _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry( ind ).toLatin1() );
658 CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
659 if( CORBA::is_nil( anObj ) )
662 return dynamic_cast<VISU::VISU_Gen_i*>( VISU::GetServant( anObj ).in() );
665 //---------------------------------------------------------------------------
666 bool VisuGUI_Selection::findDisplayedCurves( const int ind, bool findHidden ) const
668 // findHidden == false - find at least one Visible curve in the childs of ind
669 // findHidden == true - find at least one Hidden curve in the childs of ind
670 SalomeApp_Study* aSStudy = GetStudy();
675 _PTR(Study) aStudy = GetCStudy( aSStudy );
677 _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
679 for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
681 if ( Iter->Value()->ReferencedObject(refSO) )
682 entryId = refSO->GetID().c_str();
684 entryId = Iter->Value()->GetID().c_str();
686 LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
687 if ( displayer->IsDisplayed( entryId ) && findHidden == false )
689 else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
697 //---------------------------------------------------------------------------
698 bool VisuGUI_Selection::hasCurves( const int ind ) const
700 SalomeApp_Study* aSStudy = GetStudy();
705 _PTR(Study) aStudy = GetCStudy( aSStudy );
707 _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
709 for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
711 if ( Iter->Value()->ReferencedObject(refSO) ) {
712 // reference on curve
715 refSO = Iter->Value();
717 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
718 if(!CORBA::is_nil(aCORBAObject)){
719 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
720 if(dynamic_cast<VISU::Curve_i*>(aServant.in()))
729 //---------------------------------------------------------------------------
730 bool VisuGUI_Selection::Plot2dViewerType( const int ind ) const
733 SUIT_Session* session = SUIT_Session::session();
734 if( SUIT_Application* app = session->activeApplication() )
735 if( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) )
736 if( SUIT_ViewManager* vman = sApp->activeViewManager() )
737 if( SUIT_ViewModel* vmod = vman->getViewModel() ) {
738 viewerType = vmod->getType();
739 if (viewerType ==SPlot2d_Viewer::Type())
745 //----------------------------------------------------------------------------
746 struct TIsValuesLabeled : TViewFunctor
750 get(VISU::Prs3d_i* thePrs3d,
751 SVTK_ViewWindow* theViewWindow,
752 VISU_Actor* theActor)
754 return theActor && theActor->GetValuesLabeled() ? "true" : "false";
758 QString VisuGUI_Selection::isValuesLabeled( const int ind ) const
760 return TPopupDispatcher<TIsValuesLabeled>()(myModule, entry(ind));
763 //----------------------------------------------------------------------------
764 struct TIsScalarBarVisibleFunctor: TViewFunctor
768 get(VISU::Prs3d_i* thePrs3d,
769 SVTK_ViewWindow* theViewWindow,
770 VISU_Actor* theActor)
772 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
773 return anActor->GetBarVisibility() ? "true" : "false";
774 else if ( VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor))
775 return anActor->GetBarVisibility() ? "true" : "false";
780 bool VisuGUI_Selection::isScalarBarVisible( const int ind ) const
782 return TPopupDispatcher<TIsScalarBarVisibleFunctor>()(myModule, entry(ind)) == "true";
785 struct TGetQuadratic2DRepresentation: TViewFunctor
787 QString virtual get (VISU::Prs3d_i* thePrs3d,
788 SVTK_ViewWindow* theViewWindow,
789 VISU_Actor* theActor)
791 if(theActor->GetQuadratic2DRepresentation() == VISU_Actor::eLines)
792 return "VISU::LINES";
793 else if (theActor->GetQuadratic2DRepresentation() == VISU_Actor::eArcs)
801 QString VisuGUI_Selection::quadratic2DMode( const int ind) const
803 return TPopupDispatcher<TGetQuadratic2DRepresentation>()(myModule, entry(ind));