1 // VISU VISUGUI : GUI of VISU component
3 // Copyright (C) 2005 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : VisuGUI_Tools.h
25 // Author : Sergey Anikin
28 #ifndef VisuGUI_Tools_HeaderFile
29 #define VisuGUI_Tools_HeaderFile
31 #include "SALOME_InteractiveObject.hxx"
33 #include "VISUConfig.hh"
35 #include "SALOMEDSClient_Study.hxx"
37 #include "SALOMEconfig.h"
38 #include CORBA_SERVER_HEADER(SALOMEDS)
39 #include CORBA_SERVER_HEADER(VISU_Gen)
40 #include CORBA_SERVER_HEADER(MED_Gen)
43 class SUIT_ViewWindow;
45 class SVTK_ViewWindow;
48 class SalomeApp_Module;
49 class SalomeApp_SelectionMgr;
50 class SalomeApp_Study;
59 typedef std::vector<SVTK_ViewWindow*> TViewWindows;
61 SUIT_Desktop* GetDesktop(const CAM_Module* theModule);
62 SalomeApp_SelectionMgr* GetSelectionMgr(const SalomeApp_Module* theModule);
63 SalomeApp_Study* GetAppStudy(const CAM_Module* theModule);
64 _PTR(Study) GetCStudy(const SalomeApp_Study* theStudy);
65 bool IsStudyLocked( _PTR(Study) theStudy );
66 bool CheckLock( _PTR(Study) theStudy );
67 VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
68 VISU::Storable::TRestoringMap getMapOfValue(_PTR(SObject) theSObject);
69 QString getValue(SALOMEDS::SObject_var theSObject, QString theKey);
70 QString getValue(_PTR(SObject) theSObject, QString theKey);
72 SVTK_ViewWindow* GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate = false );
73 SVTK_ViewWindow* GetViewWindow();
74 SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, QString theType = QString::null);
76 VISU_Actor* PublishInView(const SalomeApp_Module* theModule,
77 VISU::Prs3d_i* thePrs);
78 VISU_Actor* UpdateViewer(const SalomeApp_Module* theModule,
79 VISU::Prs3d_i* thePrs,
80 bool theDispOnly = false);
82 VISU_Actor* FindActor(SVTK_ViewWindow* theViewWindow,
83 const char* theEntry);
84 VISU_Actor* FindActor(SVTK_ViewWindow* theViewWindow,
85 VISU::Prs3d_i* thePrs);
86 void RecreateActor(const SalomeApp_Module* theModule,
87 VISU::Prs3d_i* thePrs);
89 void Add(SalomeApp_SelectionMgr* theSelectionMgr,
90 const Handle(SALOME_InteractiveObject)& theIO);
91 void Remove(SalomeApp_SelectionMgr* theSelectionMgr,
92 const Handle(SALOME_InteractiveObject)& theIO);
94 SALOMEDS::StudyManager_var GetStudyManager();
95 VISU_Gen_i* GetVisuGen(const CAM_Module* theModule);
96 SALOME_MED::MED_Gen_var GetMEDEngine();
97 CORBA::Object_var GetSelectedObj(const SalomeApp_Study* theStudy,
98 const QString& theEntry,
99 VISU::Storable::TRestoringMap* theMap = NULL);
100 CORBA::Object_var GetSelectedObj(const SalomeApp_Module* theModule,
101 Handle(SALOME_InteractiveObject)* theIO = NULL,
102 VISU::Storable::TRestoringMap* theMap = NULL);
103 bool CheckTimeStamp(const SalomeApp_Module* theModule,
104 SALOMEDS::SObject_var& theSObject,
105 Handle(SALOME_InteractiveObject)* theIO = NULL);
106 inline bool IsSObjectTable(_PTR(SObject) theSObject);
107 VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
108 SALOMEDS::SObject_var theSource,
109 VISU::Result_var& theResult);
110 TViewWindows GetViews(const SalomeApp_Module* theModule);
111 void DeletePrs3d(SalomeApp_Module* theModule,
112 VISU::Prs3d_i* thePrs,
113 const Handle(SALOME_InteractiveObject)& theIO);
114 void ErasePrs3d(SalomeApp_Module* theModule,
115 VISU::Prs3d_i* thePrs);
117 SPlot2d_Viewer* GetPlot2dViewer(const SalomeApp_Module* theModule, const bool theCreate = false);
118 void PlotTable( const SalomeApp_Module* theModule,
119 VISU::Table_i* table,
121 void PlotCurve( const SalomeApp_Module* theModule,
122 VISU::Curve_i* curve,
124 void PlotContainer( const SalomeApp_Module* theModule,
125 VISU::Container_i* container,
127 void CreatePlot( SalomeApp_Module* theModule,
128 _PTR(SObject) theSobj );
131 bool VISU::IsSObjectTable( _PTR(SObject) theSObject )
134 _PTR(GenericAttribute) anAttr;
135 if(theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
137 if(theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))