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