Salome HOME
new presentation using DTM
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Tool2.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROGUI_TOOL2_H
20 #define HYDROGUI_TOOL2_H
21
22 #include <HYDROData_Entity.h>
23 #include <GraphicsView_Defs.h>
24 #include <QStringList>
25
26 // IDL includes
27 #include <SALOMEconfig.h>
28 #include CORBA_SERVER_HEADER(GEOM_Gen)
29 #endif
30
31 class HYDROGUI_Module;
32 class HYDROGUI_Prs;
33 class SUIT_ViewManager;
34 class GraphicsView_ViewPort;
35 class OCCViewer_ViewFrame;
36 class Handle_HYDROData_Document;
37
38 namespace HYDROGUI_Tool
39 {
40   int GetActiveStudyId();
41
42   void SetActiveViewManager( HYDROGUI_Module* theModule,
43                              SUIT_ViewManager* theViewManager );
44
45   void GetPrsSubObjects( HYDROGUI_Module* theModule,
46                          HYDROData_SequenceOfObjects& theSeq );
47
48   HYDROGUI_Prs* GetPresentation( const Handle(HYDROData_Entity)& theObj,
49                                  const GraphicsView_ObjectList& theObjects );
50
51   GraphicsView_ObjectList GetPrsList( GraphicsView_ViewPort* theViewPort );
52
53   HYDROData_SequenceOfObjects GetSelectedObjects( HYDROGUI_Module* theModule );
54
55   bool IsObjectHasPresentation( const Handle_HYDROData_Entity& theObject,
56                                 const QString&                 theViewerType = "" );
57
58   Handle(HYDROData_Entity) GetSelectedObject( HYDROGUI_Module* theModule );
59
60   HYDROData_SequenceOfObjects GetGeometryObjects( HYDROGUI_Module* theModule );
61
62   ObjectKind GetSelectedPartition( HYDROGUI_Module* theModule );
63
64   Handle(HYDROData_Entity) FindObjectByName( HYDROGUI_Module* theModule,
65                                              const QString& theName,
66                                              const ObjectKind theObjectKind = KIND_UNKNOWN );
67
68   HYDROData_SequenceOfObjects FindObjectsByNames( HYDROGUI_Module*   theModule,
69                                                   const QStringList& theNames,
70                                                   const ObjectKind   theObjectKind = KIND_UNKNOWN );
71
72   QString GenerateObjectName( HYDROGUI_Module*   theModule,
73                               const QString&     thePrefix,
74                               const QStringList& theUsedNames = QStringList(),
75                               const bool         theIsTryToUsePurePrefix = false );
76
77   size_t GetActiveViewId( HYDROGUI_Module* theModule,
78                           const QString&   theViewId = QString() );
79
80   size_t GetActiveGraphicsViewId( HYDROGUI_Module* theModule );
81
82   size_t GetActiveOCCViewId( HYDROGUI_Module* theModule );
83
84   QList<size_t> GetGraphicsViewIdList( HYDROGUI_Module* theModule );
85
86   QList<size_t> GetOCCViewIdList( HYDROGUI_Module* theModule );
87
88   void setOCCActionShown( OCCViewer_ViewFrame* theViewFrame,
89                           const int theActionId,
90                           const bool isShown );
91
92   void setOCCActionShown( HYDROGUI_Module* theModule,
93                           const int theActionId,
94                           const bool isShown );
95
96   QColor GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames );
97
98   QColor GenerateFillingColor( const Handle_HYDROData_Document& theDoc,
99                                const QStringList& theZoneNames );
100
101   QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
102                                       QList<GEOM::shape_type> theTypes );
103
104   void DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries );
105 };