Salome HOME
lot6 / publish exploded shell right in the hydro
[modules/hydro.git] / src / HYDROData / HYDROData_GeomTool.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 HYDROData_GeomTool_HeaderFile
20 #define HYDROData_GeomTool_HeaderFile
21
22 #include "HYDROData.h"
23 #include <NCollection_IndexedDataMap.hxx>
24
25 #ifdef WIN32
26   #pragma warning ( disable: 4251 )
27 #endif
28
29 #ifndef LIGHT_MODE
30 #include <GEOM_Client.hxx>
31
32 #ifdef WIN32
33   #pragma warning ( default: 4251 )
34 #endif
35
36 class TopoDS_Shape;
37 class QString;
38
39 class HYDRODATA_EXPORT HYDROData_GeomTool {
40
41 public:
42
43   /**
44    * \brief Get shape by the specified IOR.
45    * \param theIOR the GEOM object IOR
46    * \param theStudyId the study ID
47    * \return the shape
48    */
49   static TopoDS_Shape GetShapeFromIOR( const int theStudyId, const QString& theIOR );
50
51   /**
52    * \brief Get GEOM engine.
53    * \return the GEOM engine
54    */
55   static GEOM::GEOM_Gen_var GetGeomGen();
56
57   /**
58    * \brief Get shape by the specified study ID.
59    * \param theStudyId the study ID
60    * \return the study
61    */
62   static SALOMEDS::Study_var GetStudyByID( const int theStudyId );
63
64   /**
65    * \brief Get free name for GEOM object.
66    * \param theStudy the study
67    * \param theBaseName the base name
68    * \return the default name
69    */
70   static QString GetFreeName( SALOMEDS::Study_ptr theStudy, const QString& theBaseName );
71
72   /**
73    * Publish the given shape in GEOM as a GEOM object.
74    * \param theGeomEngine GEOM module engine
75    * \param theStudy SALOMEDS study, used for publishing of the shape
76    * \param theShape the shape to publish as a GEOM object
77    * \param theName the name of the published object
78    * \param theGeomObjEntry the entry of the published object
79    * \return the published GEOM object
80    */
81   static GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var  theGeomEngine,
82                                                    SALOMEDS::Study_ptr theStudy,
83                                                    const TopoDS_Shape& theShape, 
84                                                    const QString&      theName,
85                                                    QString& theGeomObjEntry );
86
87   /**
88    * Create and publish face in GEOM as a GEOM object.
89    * \param theGeomEngine GEOM module engine
90    * \param theStudy SALOMEDS study, used for publishing of the face
91    * \param theWidth the face width
92    * \param theHeight the face height
93    * \param theName the name of the published face
94    * \param theFaceEntry the entry of the published face
95    * \return the published GEOM object
96    */
97   static GEOM::GEOM_Object_ptr createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
98                                                  SALOMEDS::Study_ptr theStudy,
99                                                  const int theWidth,
100                                                  const int theHeight,
101                                                  const QString& theName,
102                                                  QString& theFaceEntry );
103
104   /**
105    * Publish the given GEOM object in the study.
106    * \param theGeomEngine GEOM module engine
107    * \param theStudy SALOMEDS study, used for publishing of the object
108    * \param theGeomObj the GEOM object
109    * \param theName the object name
110    * \return the entry of the published object (empty string in case of fail)
111    */
112   static QString publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine,
113                                     SALOMEDS::Study_ptr theStudy,
114                                     GEOM::GEOM_Object_ptr theGeomObj,
115                                     const QString& theName );
116
117   static GEOM::GEOM_Object_ptr ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine, 
118                                                       SALOMEDS::Study_ptr theStudy, 
119                                                       const TopoDS_Shape& theShape, 
120                                                       const NCollection_IndexedDataMap<TopoDS_Shape, QString>& aFacesToNameModif,
121                                                       const QString& theName,
122                                                       QString& theGeomObjEntry);
123
124 };
125
126 #endif
127
128 #endif
129
130