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 HYDROData_GeomTool_HeaderFile
20 #define HYDROData_GeomTool_HeaderFile
22 #include "HYDROData.h"
23 #include <NCollection_IndexedDataMap.hxx>
24 #include <TopTools_ShapeMapHasher.hxx>
27 #pragma warning ( disable: 4251 )
31 #include <GEOM_Client.hxx>
34 #pragma warning ( default: 4251 )
40 class HYDRODATA_EXPORT HYDROData_GeomTool {
45 * \brief Set the Container Name to use when not default (FactoryServer).
46 * \param theContainerName the name of the container used for GEOM
47 * (to be used by scripts for distributed execution)
49 static void SetContainerName( const QString& theContainerName );
52 * \brief Get shape by the specified IOR.
53 * \param theIOR the GEOM object IOR
56 static TopoDS_Shape GetShapeFromIOR( const QString& theIOR );
59 * \brief Get GEOM engine.
60 * \return the GEOM engine
62 static GEOM::GEOM_Gen_var GetGeomGen();
68 static SALOMEDS::Study_var GetStudy();
71 * \brief Get free name for GEOM object.
72 * \param theBaseName the base name
73 * \return the default name
75 static QString GetFreeName( const QString& theBaseName );
78 * Publish the given shape in GEOM as a GEOM object.
79 * \param theGeomEngine GEOM module engine
80 * \param theShape the shape to publish as a GEOM object
81 * \param theName the name of the published object
82 * \param theGeomObjEntry the entry of the published object
83 * \return the published GEOM object
85 static GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
86 const TopoDS_Shape& theShape,
87 const QString& theName,
88 QString& theGeomObjEntry );
91 * Create and publish face in GEOM as a GEOM object.
92 * \param theGeomEngine GEOM module engine
93 * \param theWidth the face width
94 * \param theHeight the face height
95 * \param theName the name of the published face
96 * \param theFaceEntry the entry of the published face
97 * \return the published GEOM object
99 static GEOM::GEOM_Object_ptr createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
102 const QString& theName,
103 QString& theFaceEntry );
106 * Publish the given GEOM object in the study.
107 * \param theGeomEngine GEOM module engine
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)
112 static QString publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine,
113 GEOM::GEOM_Object_ptr theGeomObj,
114 const QString& theName );
116 static GEOM::GEOM_Object_ptr ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine,
117 const TopoDS_Shape& theShape,
118 const NCollection_IndexedDataMap<TopoDS_Shape, QString, TopTools_ShapeMapHasher>& aShToNameModif,
119 const QString& theName,
120 QString& theGeomObjEntry);
123 static QString myContainerName;