Salome HOME
fix test on stream linear interpolation
[modules/hydro.git] / src / HYDROData / HYDROData_GeomTool.h
index ea4cb95d39dad7d48fbecb721958a8cbc6418aea..9f7d85ff25e3bb2b8c093dce80406ffab4d2fa75 100644 (file)
 #define HYDROData_GeomTool_HeaderFile
 
 #include "HYDROData.h"
+#include <NCollection_IndexedDataMap.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
 
+#ifdef WIN32
+  #pragma warning ( disable: 4251 )
+#endif
+
+#ifndef LIGHT_MODE
 #include <GEOM_Client.hxx>
 
+#ifdef WIN32
+  #pragma warning ( default: 4251 )
+#endif
+
 class TopoDS_Shape;
 class QString;
 
@@ -30,13 +41,19 @@ class HYDRODATA_EXPORT HYDROData_GeomTool {
 
 public:
 
+  /**
+   * \brief Set the Container Name to use when not default (FactoryServer).
+   * \param theContainerName the name of the container used for GEOM 
+   *        (to be used by scripts for distributed execution)
+   */
+  static void SetContainerName( const QString& theContainerName );
+  
   /**
    * \brief Get shape by the specified IOR.
    * \param theIOR the GEOM object IOR
-   * \param theStudyId the study ID
    * \return the shape
    */
-  static TopoDS_Shape GetShapeFromIOR( const int theStudyId, const QString& theIOR );
+  static TopoDS_Shape GetShapeFromIOR( const QString& theIOR );
 
   /**
    * \brief Get GEOM engine.
@@ -45,21 +62,69 @@ public:
   static GEOM::GEOM_Gen_var GetGeomGen();
 
   /**
-   * \brief Get shape by the specified study ID.
-   * \param theStudyId the study ID
+   * \brief Get Study.
    * \return the study
    */
-  static SALOMEDS::Study_var GetStudyByID( const int theStudyId );
+  static SALOMEDS::Study_var GetStudy();
 
   /**
    * \brief Get free name for GEOM object.
-   * \param theStudy the study
    * \param theBaseName the base name
    * \return the default name
    */
-  static QString GetFreeName( SALOMEDS::Study_ptr theStudy, const QString& theBaseName );
+  static QString GetFreeName( const QString& theBaseName );
+
+  /**
+   * Publish the given shape in GEOM as a GEOM object.
+   * \param theGeomEngine GEOM module engine
+   * \param theShape the shape to publish as a GEOM object
+   * \param theName the name of the published object
+   * \param theGeomObjEntry the entry of the published object
+   * \return the published GEOM object
+   */
+  static GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var  theGeomEngine,
+                                                   const TopoDS_Shape& theShape, 
+                                                   const QString&      theName,
+                                                   QString& theGeomObjEntry );
+
+  /**
+   * Create and publish face in GEOM as a GEOM object.
+   * \param theGeomEngine GEOM module engine
+   * \param theWidth the face width
+   * \param theHeight the face height
+   * \param theName the name of the published face
+   * \param theFaceEntry the entry of the published face
+   * \return the published GEOM object
+   */
+  static GEOM::GEOM_Object_ptr createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
+                                                 const int theWidth,
+                                                 const int theHeight,
+                                                 const QString& theName,
+                                                 QString& theFaceEntry );
+
+  /**
+   * Publish the given GEOM object in the study.
+   * \param theGeomEngine GEOM module engine
+   * \param theGeomObj the GEOM object
+   * \param theName the object name
+   * \return the entry of the published object (empty string in case of fail)
+   */
+  static QString publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine,
+                                    GEOM::GEOM_Object_ptr theGeomObj,
+                                    const QString& theName );
+
+  static GEOM::GEOM_Object_ptr ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine, 
+                                                      const TopoDS_Shape& theShape, 
+                                                      const NCollection_IndexedDataMap<TopoDS_Shape, QString, TopTools_ShapeMapHasher>& aShToNameModif,
+                                                      const QString& theName,
+                                                      QString& theGeomObjEntry);
+
+protected:
+  static QString myContainerName;
 };
 
 #endif
 
+#endif
+