]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_Channel.h
Salome HOME
b3b4483ce07ec7c867987331734f1e0ac45e358b
[modules/hydro.git] / src / HYDROData / HYDROData_Channel.h
1
2 #ifndef HYDROData_Channel_HeaderFile
3 #define HYDROData_Channel_HeaderFile
4
5 #include "HYDROData_ArtificialObject.h"
6
7 class Handle(HYDROData_Polyline3D);
8 class Handle(HYDROData_Profile);
9 class TopTools_SequenceOfShape;
10 class TopTools_ListOfShape;
11
12 DEFINE_STANDARD_HANDLE(HYDROData_Channel, HYDROData_ArtificialObject)
13
14 /**\class HYDROData_Channel
15  * \brief 
16  *
17  */
18 class HYDROData_Channel : public HYDROData_ArtificialObject
19 {
20 protected:
21   /**
22    * Enumeration of tags corresponding to the persistent object parameters.
23    */
24   enum DataTag
25   {
26     DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
27     DataTag_GuideLine, 
28     DataTag_Profile,
29   };
30
31 public:
32   DEFINE_STANDARD_RTTI(HYDROData_Channel);
33
34   /**
35    * Returns the kind of this object. Must be redefined in all objects of known type.
36    */
37   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_CHANNEL;}
38
39   /**
40    * Dump object to Python script representation.
41    */
42   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
43
44   /**
45    * Returns the list of all reference objects of this object.
46    */
47   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
48
49   /**
50    * Returns the top shape of the object.
51    */
52   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
53
54   /**
55    * Returns the 3d shape of the object.
56    */
57   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
58
59   /**
60    * Update the shape presentations of stream.
61    * Call this method whenever you made changes for channel data.
62    */
63   HYDRODATA_EXPORT virtual void Update();
64
65   /**
66    * Checks that object has 2D presentation. Reimlemented to retun true.
67    */
68   HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
69
70   /**
71    * Returns default filling color for new channel.
72    */
73   HYDRODATA_EXPORT static QColor DefaultFillingColor();
74
75   /**
76    * Returns default border color for new channel.
77    */
78   HYDRODATA_EXPORT static QColor DefaultBorderColor();
79
80
81 public:      
82   // Public methods to work with Channel
83   
84   /**
85    * Sets reference guide line object for channel.
86    */
87   HYDRODATA_EXPORT virtual bool SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine );
88
89   /**
90    * Returns reference guide line object of channel.
91    */
92   HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline3D) GetGuideLine() const;
93
94   /**
95    * Remove reference guide line object from channel.
96    */
97   HYDRODATA_EXPORT virtual void RemoveGuideLine();
98
99
100   /**
101    * Sets reference profile object for channel.
102    */
103   HYDRODATA_EXPORT virtual bool SetProfile( const Handle(HYDROData_Profile)& theProfile );
104
105   /**
106    * Returns reference profile object of channel.
107    */
108   HYDRODATA_EXPORT virtual Handle(HYDROData_Profile) GetProfile() const;
109
110   /**
111    * Remove reference profile object from channel.
112    */
113   HYDRODATA_EXPORT virtual void RemoveProfile();
114
115
116 protected:
117
118   /**
119    * Returns default filling color for new object.
120    */
121   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
122
123   /**
124    * Returns default border color for new object.
125    */
126   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
127
128   /**
129    * Returns the type of child altitude object.
130    * Reimplemented to create chanel altitude object.
131    */
132   HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
133
134 protected:
135
136   friend class HYDROData_Iterator;
137
138   /**
139    * Creates new object in the internal data structure. Use higher level objects 
140    * to create objects with real content.
141    */
142   HYDRODATA_EXPORT HYDROData_Channel();
143
144   /**
145    * Destructs properties of the object and object itself, removes it from the document.
146    */
147   virtual HYDRODATA_EXPORT ~HYDROData_Channel();
148 };
149
150 #endif