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