Salome HOME
9e0b929db973e7ee00af9b12098851049200e4d4
[modules/hydro.git] / src / HYDROData / HYDROData_ImmersibleZone.h
1
2 #ifndef HYDROData_ImmersibleZone_HeaderFile
3 #define HYDROData_ImmersibleZone_HeaderFile
4
5 #include <HYDROData_NaturalObject.h>
6
7 DEFINE_STANDARD_HANDLE(HYDROData_ImmersibleZone, HYDROData_NaturalObject)
8
9 class Handle(HYDROData_PolylineXY);
10
11 /**\class HYDROData_ImmersibleZone
12  * \brief 
13  *
14  */
15 class HYDROData_ImmersibleZone : public HYDROData_NaturalObject
16 {
17 protected:
18   /**
19    * Enumeration of tags corresponding to the persistent object parameters.
20    */
21   enum DataTag
22   {
23     DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve
24     DataTag_Polyline,     ///< reference polyline
25 };
26
27 public:
28   DEFINE_STANDARD_RTTI(HYDROData_ImmersibleZone);
29
30   /**
31    * Returns the kind of this object. Must be redefined in all objects of known type.
32    */
33   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_IMMERSIBLE_ZONE;}
34
35   /**
36    * Dump object to Python script representation.
37    */
38   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
39
40   /**
41    * Returns the list of all reference objects of this object.
42    */
43   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
44
45   /**
46    * Update the immersible zone object.
47    * Call this method whenever you made changes for object data.
48    */
49   HYDRODATA_EXPORT virtual void Update();
50
51   /**
52    * Checks that object has 2D presentation. Reimlemented to retun true.
53    */
54   HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
55
56   /**
57    * Returns the top shape of the object.
58    */
59   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
60
61   /**
62    * Returns the 3d shape of the object.
63    */
64   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
65
66   /**
67    * Returns default filling color for new zone.
68    */
69   HYDRODATA_EXPORT static QColor DefaultFillingColor();
70
71   /**
72    * Returns default border color for new zone.
73    */
74   HYDRODATA_EXPORT static QColor DefaultBorderColor();
75
76   /**
77    * Sets reference polyline object for zone.
78    */
79   HYDRODATA_EXPORT virtual void SetPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
80
81   /**
82    * Returns reference polyline object of zone.
83    */
84   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolyline() const;
85
86   /**
87    * Remove reference polyline object of zone.
88    */
89   HYDRODATA_EXPORT virtual void RemovePolyline();
90
91   HYDRODATA_EXPORT TopoDS_Shape generateTopShape() const;
92   HYDRODATA_EXPORT static TopoDS_Shape generateTopShape( const Handle(HYDROData_PolylineXY)& );
93
94 protected:
95
96   /**
97    * Returns default filling color for new object.
98    */
99   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
100
101   /**
102    * Returns default border color for new object.
103    */
104   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
105
106 private:
107
108   /**
109    * Create all necessary child group objects.
110    */
111   HYDRODATA_EXPORT void createGroupObjects();
112
113 protected:
114
115   friend class HYDROData_Iterator;
116
117   /**
118    * Creates new object in the internal data structure. Use higher level objects 
119    * to create objects with real content.
120    */
121   HYDRODATA_EXPORT HYDROData_ImmersibleZone();
122
123   /**
124    * Destructs properties of the object and object itself, removes it from the document.
125    */
126   virtual HYDRODATA_EXPORT ~HYDROData_ImmersibleZone();
127 };
128
129 #endif