Salome HOME
Import of profiles corrected.
[modules/hydro.git] / src / HYDROData / HYDROData_Object.h
1
2 #ifndef HYDROData_Object_HeaderFile
3 #define HYDROData_Object_HeaderFile
4
5 #include <HYDROData_Entity.h>
6
7 class TopoDS_Shape;
8
9 DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity)
10
11 class Handle(HYDROData_Bathymetry);
12
13 /**\class HYDROData_Object
14  * \brief The base class for all geometrical objects in the HYDRO module.
15  *
16  */
17 class HYDROData_Object : public HYDROData_Entity
18 {
19 protected:
20   /**
21    * Enumeration of tags corresponding to the persistent object parameters.
22    */
23   enum DataTag
24   {
25     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
26     DataTag_TopShape,
27     DataTag_Shape3D,
28     DataTag_Bathymetry,   ///< reference bathymetry
29     DataTag_FillingColor, ///< filling color of geometrical object
30     DataTag_BorderColor   ///< border color of geometrical object
31   };
32
33 public:
34   DEFINE_STANDARD_RTTI(HYDROData_Object);
35
36   /**
37    * Sets the top(2d projection) shape of the object.
38    */
39   HYDRODATA_EXPORT virtual void SetTopShape( const TopoDS_Shape& theShape );
40
41   /**
42    * Returns the top shape of the object.
43    */
44   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0;
45
46   /**
47    * Sets the 3d shape of the object.
48    */
49   HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
50
51   /**
52    * Returns the 3d shape of the object.
53    */
54   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0;
55
56   
57   /**
58    * Set reference bathymetry object for geometry object.
59    */
60   HYDRODATA_EXPORT virtual void SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
61
62   /**
63    * Returns reference bathymetry object of geometry object.
64    */
65   HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const;
66
67   /**
68    * Clear the reference bathymetry object for geometry object.
69    */
70   HYDRODATA_EXPORT virtual void RemoveBathymetry();
71
72    /**
73    * Sets filling color for object.
74    */
75   HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
76
77   /**
78    * Returns filling color of object.
79    */
80   HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
81
82    /**
83    * Sets border color for object.
84    */
85   HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
86
87   /**
88    * Returns border color of object.
89    */
90   HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
91
92   /**
93    * Returns default filling color for new object.
94    */
95   HYDRODATA_EXPORT static QColor DefaultFillingColor();
96
97   /**
98    * Returns default border color for new object.
99    */
100   HYDRODATA_EXPORT static QColor DefaultBorderColor();
101
102 protected:
103
104   /**
105    * Creates new object in the internal data structure. Use higher level objects 
106    * to create objects with real content.
107    */
108   HYDRODATA_EXPORT HYDROData_Object();
109
110   /**
111    * Destructs properties of the object and object itself, removes it from the document.
112    */
113   virtual HYDRODATA_EXPORT ~HYDROData_Object();
114
115 protected:
116
117   /**
118    * Retrieve the top shape of the object from data label.
119    */
120   HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
121
122   /**
123    * Removes the top shape from data label of the object.
124    */
125   HYDRODATA_EXPORT void removeTopShape();
126
127
128   /**
129    * Retrieve the 3d shape of the object from data label.
130    */
131   HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
132
133   /**
134    * Removes the 3d shape from data label of the object.
135    */
136   HYDRODATA_EXPORT void removeShape3D();
137 };
138
139 #endif