Salome HOME
Refs #289 - Spline profile is represented in OCC view as polyline profile
[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    * Returns default filling color for new channel.
67    */
68   HYDRODATA_EXPORT static QColor DefaultFillingColor();
69
70   /**
71    * Returns default border color for new channel.
72    */
73   HYDRODATA_EXPORT static QColor DefaultBorderColor();
74
75
76 public:      
77   // Public methods to work with Channel
78   
79   /**
80    * Sets reference guide line object for channel.
81    */
82   HYDRODATA_EXPORT virtual bool SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine );
83
84   /**
85    * Returns reference guide line object of channel.
86    */
87   HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline3D) GetGuideLine() const;
88
89   /**
90    * Remove reference guide line object from channel.
91    */
92   HYDRODATA_EXPORT virtual void RemoveGuideLine();
93
94
95   /**
96    * Sets reference profile object for channel.
97    */
98   HYDRODATA_EXPORT virtual bool SetProfile( const Handle(HYDROData_Profile)& theProfile );
99
100   /**
101    * Returns reference profile object of channel.
102    */
103   HYDRODATA_EXPORT virtual Handle(HYDROData_Profile) GetProfile() const;
104
105   /**
106    * Remove reference profile object from channel.
107    */
108   HYDRODATA_EXPORT virtual void RemoveProfile();
109
110
111 protected:
112
113   /**
114    * Returns default filling color for new object.
115    */
116   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
117
118   /**
119    * Returns default border color for new object.
120    */
121   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
122
123   /**
124    * Returns the type of child altitude object.
125    * Reimplemented to create chanel altitude object.
126    */
127   virtual ObjectKind getAltitudeObjectType() const;
128
129 protected:
130
131   friend class HYDROData_Iterator;
132
133   /**
134    * Creates new object in the internal data structure. Use higher level objects 
135    * to create objects with real content.
136    */
137   HYDRODATA_EXPORT HYDROData_Channel();
138
139   /**
140    * Destructs properties of the object and object itself, removes it from the document.
141    */
142   virtual HYDRODATA_EXPORT ~HYDROData_Channel();
143 };
144
145 #endif