]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_Obstacle.h
Salome HOME
Comments moved.
[modules/hydro.git] / src / HYDROData / HYDROData_Obstacle.h
1
2 #ifndef HYDROData_Obstacle_HeaderFile
3 #define HYDROData_Obstacle_HeaderFile
4
5 #include "HYDROData_ArtificialObject.h"
6
7 DEFINE_STANDARD_HANDLE(HYDROData_Obstacle, HYDROData_ArtificialObject)
8
9 /**\class HYDROData_Obstacle
10  * \brief 
11  *
12  */
13 class HYDROData_Obstacle : public HYDROData_ArtificialObject
14 {
15 protected:
16   /**
17    * Enumeration of tags corresponding to the persistent object parameters.
18    */
19   enum DataTag
20   {
21     DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
22     DataTag_GeomObjectEntry, ///< study entry of the imported GEOM object
23     DataTag_FilePath ///< imported file path
24   };
25
26 public:
27   DEFINE_STANDARD_RTTI(HYDROData_Obstacle);
28
29   /**
30    * Returns the kind of this object. Must be redefined in all objects of known type.
31    */
32   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_OBSTACLE;}
33
34   /**
35    * Dump object to Python script representation.
36    */
37   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
38
39   /**
40    * Returns the top shape of the object.
41    */
42   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
43
44   /**
45    * Returns the 3d shape of the object.
46    */
47   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
48
49   /**
50    * Returns default filling color for new obstacle.
51    */
52   HYDRODATA_EXPORT static QColor DefaultFillingColor();
53
54   /**
55    * Returns default border color for new obstacle.
56    */
57   HYDRODATA_EXPORT static QColor DefaultBorderColor();
58
59
60   /**
61    * Sets the 3d shape of the object.
62    */
63   HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
64
65 public:
66
67   /**
68    * Imports shape from file containing geometrical object and sets this
69    * shape as the obstacle shape.
70    * The supported file types:
71    *  - BREP
72    *  - IGES
73    *  - STEP
74    *  - ACIS
75    * \param theFilePath the path to file
76    * \return \c true if file has been successfully read
77    */
78   HYDRODATA_EXPORT virtual bool ImportFromFile( const QString& theFilePath );
79
80   /**
81    * Stores the file path of the imported file.
82    * \param theFilePath file path
83    */
84   HYDRODATA_EXPORT void SetFilePath(const QString& theFilePath);
85
86   /**
87    * Returns the imported file path.
88    */
89   HYDRODATA_EXPORT QString GetFilePath() const;
90
91    /**
92    * Stores the study entry of the imported GEOM object.
93    * \param theEntry GEOM object entry
94    */
95   HYDRODATA_EXPORT void SetGeomObjectEntry(const QString& theEntry);
96
97   /**
98    * Returns the imported GEOM object entry.
99    */
100   HYDRODATA_EXPORT QString GetGeomObjectEntry() const;
101
102 protected:
103
104   /**
105    * Returns default filling color for new object.
106    */
107   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
108
109   /**
110    * Returns default border color for new object.
111    */
112   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
113
114 protected:
115
116   friend class HYDROData_Iterator;
117
118   /**
119    * Creates new object in the internal data structure. Use higher level objects 
120    * to create objects with real content.
121    */
122   HYDRODATA_EXPORT HYDROData_Obstacle();
123
124   /**
125    * Destructs properties of the object and object itself, removes it from the document.
126    */
127   virtual HYDRODATA_EXPORT ~HYDROData_Obstacle();
128
129 private:
130   /**
131    * Imports shape from the BREP file.
132    * \param theFilePath the path to file
133    * \return shape as TopoDS_Shape (null shape if import was failed)
134    */
135   TopoDS_Shape ImportBREP( const QString& theFilePath ) const;
136
137   /**
138    * Imports shape from the IGES file.
139    * \param theFilePath the path to file
140    * \return shape as TopoDS_Shape (null shape if import was failed)
141    */
142   TopoDS_Shape ImportIGES( const QString& theFilePath ) const;
143
144   /**
145    * Imports shape from the STEP file.
146    * \param theFilePath the path to file
147    * \return shape as TopoDS_Shape (null shape if import was failed)
148    */
149   TopoDS_Shape ImportSTEP( const QString& theFilePath ) const;
150 };
151
152 #endif