Salome HOME
The data model has been rolled back to previous version.
[modules/hydro.git] / src / HYDROData / HYDROData_Obstacle.h
index 0a728c0acd872d39815ff18ba4c63781ebbaa078..66db4c38014608aeb4f06a83c054853ad5ca8768 100644 (file)
@@ -19,6 +19,8 @@ protected:
   enum DataTag
   {
     DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
+    DataTag_GeomObjectEntry, ///< study entry of the imported GEOM object
+    DataTag_FilePath ///< imported file path
   };
 
 public:
@@ -44,6 +46,41 @@ public:
    */
   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
 
+  /**
+   * Imports shape from file containing geometrical object and sets this
+   * shape as the obstacle shape.
+   * The supported file types:
+   *  - BREP
+   *  - IGES
+   *  - STEP
+   *  - ACIS
+   * \param theFilePath the path to file
+   * \return \c true if file has been successfully read
+   */
+  HYDRODATA_EXPORT virtual bool ImportFromFile( const QString& theFilePath );
+
+  /**
+   * Stores the file path of the imported file.
+   * \param theFilePath file path
+   */
+  HYDRODATA_EXPORT void SetFilePath(const QString& theFilePath);
+
+  /**
+   * Returns the imported file path.
+   */
+  HYDRODATA_EXPORT QString GetFilePath() const;
+
+   /**
+   * Stores the study entry of the imported GEOM object.
+   * \param theEntry GEOM object entry
+   */
+  HYDRODATA_EXPORT void SetGeomObjectEntry(const QString& theEntry);
+
+  /**
+   * Returns the imported GEOM object entry.
+   */
+  HYDRODATA_EXPORT QString GetGeomObjectEntry() const;
+
 protected:
 
   friend class HYDROData_Iterator;
@@ -58,6 +95,28 @@ protected:
    * Destructs properties of the object and object itself, removes it from the document.
    */
   virtual HYDRODATA_EXPORT ~HYDROData_Obstacle();
+
+private:
+  /**
+   * Imports shape from the BREP file.
+   * \param theFilePath the path to file
+   * \return shape as TopoDS_Shape (null shape if import was failed)
+   */
+  TopoDS_Shape ImportBREP( const QString& theFilePath ) const;
+
+  /**
+   * Imports shape from the IGES file.
+   * \param theFilePath the path to file
+   * \return shape as TopoDS_Shape (null shape if import was failed)
+   */
+  TopoDS_Shape ImportIGES( const QString& theFilePath ) const;
+
+  /**
+   * Imports shape from the STEP file.
+   * \param theFilePath the path to file
+   * \return shape as TopoDS_Shape (null shape if import was failed)
+   */
+  TopoDS_Shape ImportSTEP( const QString& theFilePath ) const;
 };
 
 #endif