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