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.
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.
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
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROGUI_TOOL2_H
20 #define HYDROGUI_TOOL2_H
22 #include <HYDROData_Entity.h>
23 #include <GraphicsView_Defs.h>
24 #include <QStringList>
27 #include <SALOMEconfig.h>
28 #include CORBA_SERVER_HEADER(GEOM_Gen)
31 class HYDROGUI_Module;
33 class SUIT_ViewManager;
34 class GraphicsView_ViewPort;
35 class OCCViewer_ViewFrame;
36 class HYDROData_Document;
37 class HYDROData_CalculationCase;
39 namespace HYDROGUI_Tool
41 int GetActiveStudyId();
43 void SetActiveViewManager( HYDROGUI_Module* theModule,
44 SUIT_ViewManager* theViewManager );
46 void GetPrsSubObjects( HYDROGUI_Module* theModule,
47 HYDROData_SequenceOfObjects& theSeq );
49 HYDROGUI_Prs* GetPresentation( const Handle(HYDROData_Entity)& theObj,
50 const GraphicsView_ObjectList& theObjects );
52 GraphicsView_ObjectList GetPrsList( GraphicsView_ViewPort* theViewPort );
54 HYDROData_SequenceOfObjects GetSelectedObjects( HYDROGUI_Module* theModule );
56 bool IsObjectHasPresentation( const Handle(HYDROData_Entity)& theObject,
57 const QString& theViewerType = "" );
59 Handle(HYDROData_Entity) GetSelectedObject( HYDROGUI_Module* theModule );
61 HYDROData_SequenceOfObjects GetGeometryObjects( HYDROGUI_Module* theModule );
63 ObjectKind GetSelectedPartition( HYDROGUI_Module* theModule );
65 bool IsSelectedPartOfCalcCase( HYDROGUI_Module* theModule, Handle(HYDROData_CalculationCase)& theOutCalCase,
68 Handle(HYDROData_Entity) FindObjectByName( HYDROGUI_Module* theModule,
69 const QString& theName,
70 const ObjectKind theObjectKind = KIND_UNKNOWN );
72 HYDROData_SequenceOfObjects FindObjectsByNames( HYDROGUI_Module* theModule,
73 const QStringList& theNames,
74 const ObjectKind theObjectKind = KIND_UNKNOWN );
76 QString GenerateObjectName( HYDROGUI_Module* theModule,
77 const QString& thePrefix,
78 const QStringList& theUsedNames = QStringList(),
79 const bool theIsTryToUsePurePrefix = false );
81 size_t GetActiveViewId( HYDROGUI_Module* theModule,
82 const QString& theViewId = QString() );
84 size_t GetActiveGraphicsViewId( HYDROGUI_Module* theModule );
86 size_t GetActiveOCCViewId( HYDROGUI_Module* theModule );
88 QList<size_t> GetGraphicsViewIdList( HYDROGUI_Module* theModule );
90 QList<size_t> GetOCCViewIdList( HYDROGUI_Module* theModule );
92 void setOCCActionShown( OCCViewer_ViewFrame* theViewFrame,
93 const int theActionId,
96 void setOCCActionShown( HYDROGUI_Module* theModule,
97 const int theActionId,
100 QColor GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames );
102 QColor GenerateFillingColor( const Handle(HYDROData_Document)& theDoc,
103 const QStringList& theZoneNames );
105 QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
106 QList<GEOM::shape_type> theTypes );
108 void DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries );