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