Salome HOME
Merge remote-tracking branch 'origin/BR_1323_0' into BR_2017
[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 HYDROData_Document;
37 class HYDROData_CalculationCase;
38
39 namespace HYDROGUI_Tool
40 {
41   int GetActiveStudyId();
42
43   void SetActiveViewManager( HYDROGUI_Module* theModule,
44                              SUIT_ViewManager* theViewManager );
45
46   void GetPrsSubObjects( HYDROGUI_Module* theModule,
47                          HYDROData_SequenceOfObjects& theSeq );
48
49   HYDROGUI_Prs* GetPresentation( const Handle(HYDROData_Entity)& theObj,
50                                  const GraphicsView_ObjectList& theObjects );
51
52   GraphicsView_ObjectList GetPrsList( GraphicsView_ViewPort* theViewPort );
53
54   HYDROData_SequenceOfObjects GetSelectedObjects( HYDROGUI_Module* theModule );
55
56   bool IsObjectHasPresentation( const Handle(HYDROData_Entity)& theObject,
57                                 const QString&                 theViewerType = "" );
58
59   Handle(HYDROData_Entity) GetSelectedObject( HYDROGUI_Module* theModule );
60
61   HYDROData_SequenceOfObjects GetGeometryObjects( HYDROGUI_Module* theModule );
62
63   ObjectKind GetSelectedPartition( HYDROGUI_Module* theModule );
64
65   bool IsSelectedPartOfCalcCase( HYDROGUI_Module* theModule, Handle(HYDROData_CalculationCase)& theOutCalCase,
66                                  QString& theOutPart);
67
68   Handle(HYDROData_Entity) FindObjectByName( HYDROGUI_Module* theModule,
69                                              const QString& theName,
70                                              const ObjectKind theObjectKind = KIND_UNKNOWN );
71
72   HYDROData_SequenceOfObjects FindObjectsByNames( HYDROGUI_Module*   theModule,
73                                                   const QStringList& theNames,
74                                                   const ObjectKind   theObjectKind = KIND_UNKNOWN );
75
76   QString GenerateObjectName( HYDROGUI_Module*   theModule,
77                               const QString&     thePrefix,
78                               const QStringList& theUsedNames = QStringList(),
79                               const bool         theIsTryToUsePurePrefix = false );
80
81   size_t GetActiveViewId( HYDROGUI_Module* theModule,
82                           const QString&   theViewId = QString() );
83
84   size_t GetActiveGraphicsViewId( HYDROGUI_Module* theModule );
85
86   size_t GetActiveOCCViewId( HYDROGUI_Module* theModule );
87
88   QList<size_t> GetGraphicsViewIdList( HYDROGUI_Module* theModule );
89
90   QList<size_t> GetOCCViewIdList( HYDROGUI_Module* theModule );
91
92   void setOCCActionShown( OCCViewer_ViewFrame* theViewFrame,
93                           const int theActionId,
94                           const bool isShown );
95
96   void setOCCActionShown( HYDROGUI_Module* theModule,
97                           const int theActionId,
98                           const bool isShown );
99
100   QColor GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames );
101
102   QColor GenerateFillingColor( const Handle(HYDROData_Document)& theDoc,
103                                const QStringList& theZoneNames );
104
105   QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
106                                       QList<GEOM::shape_type> theTypes );
107
108   void DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries );
109 };