Salome HOME
Dump of 3D polyline defined on bathymetry corrected.
[modules/hydro.git] / src / HYDROData / HYDROData_Polyline3D.h
1
2 #ifndef HYDROData_Polyline3D_HeaderFile
3 #define HYDROData_Polyline3D_HeaderFile
4
5 #include "HYDROData_Object.h"
6
7 DEFINE_STANDARD_HANDLE(HYDROData_Polyline3D, HYDROData_Object)
8
9 class Handle(HYDROData_PolylineXY);
10 class Handle(HYDROData_ProfileUZ);
11 class gp_XYZ;
12
13 /**\class HYDROData_Polyline3D
14  * \brief 
15  *
16  */
17 class HYDROData_Polyline3D : public HYDROData_Object
18 {
19 public:
20
21   typedef gp_XYZ                                Polyline3DPoint;
22   typedef NCollection_Sequence<Polyline3DPoint> Polyline3DPoints;
23
24 protected:
25   /**
26    * Enumeration of tags corresponding to the persistent object parameters.
27    */
28   enum DataTag
29   {
30     DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
31     DataTag_PolylineXY,          ///< reference hydraulic axis
32     DataTag_ProfileUZ,           ///< reference profile
33     DataTag_ChildProfileUZ,      ///< reference profile
34   };
35
36 public:
37   DEFINE_STANDARD_RTTI(HYDROData_Polyline3D);
38
39   /**
40    * Returns the kind of this object. Must be redefined in all objects of known type.
41    */
42   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
43
44   /**
45    * Dump object to Python script representation.
46    */
47   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
48
49   /**
50    * Returns the list of all reference objects of this object.
51    */
52   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
53
54   /**
55    * Returns the top shape of the object.
56    */
57   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
58
59   /**
60    * Returns the 3d shape of the object.
61    */
62   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
63
64   /**
65    * Update the shape presentations of stream.
66    * Call this method whenever you made changes for stream data.
67    */
68   HYDRODATA_EXPORT virtual void Update();
69
70   /**
71    * Returns default filling color for new 3D polyline.
72    */
73   HYDRODATA_EXPORT static QColor DefaultFillingColor();
74
75   /**
76    * Returns default border color for new 3D polyline.
77    */
78   HYDRODATA_EXPORT static QColor DefaultBorderColor();
79
80
81 public:      
82   // Public methods to work with 3D polyline
83   
84   /**
85    * Sets reference x,y polyline object for 3D polyline.
86    */
87   HYDRODATA_EXPORT virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline,
88                                                const bool                          theIsUpdateProfile = true );
89
90   /**
91    * Returns reference x,y polyline object of 3D polyline.
92    */
93   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const;
94
95   /**
96    * Remove reference x,y polyline object from 3D polyline.
97    */
98   HYDRODATA_EXPORT virtual void RemovePolylineXY();
99
100
101   /**
102    * Sets reference u,z profile object for 3D polyline.
103    */
104   HYDRODATA_EXPORT virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
105
106   /**
107    * Returns reference u,z profile object of 3D polyline.
108    */
109   HYDRODATA_EXPORT virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const;
110
111   /**
112    * Remove reference u,z profile object from 3D polyline.
113    */
114   HYDRODATA_EXPORT virtual void RemoveProfileUZ();
115
116
117   /**
118    * Set reference bathymetry object for geometry object.
119    * Reimplemented to remove reference u,z profile.
120    */
121   HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
122
123   /**
124    * Clear the reference bathymetry object for geometry object.
125    * Reimplemented to remove child u,z profile.
126    */
127   HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
128
129
130   /**
131    * Returns the child u,z profile which has been generated from bathymetry.
132    */
133   HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const;
134
135   /**
136    * Sets the child u,z profile for polyline.
137    */
138   HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
139
140
141 protected:
142
143   /**
144    * Returns default filling color for new object.
145    */
146   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
147
148   /**
149    * Returns default border color for new object.
150    */
151   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
152
153   /**
154    * Checks and if necessary create child 3D object.
155    * Reimplemented to prevent creation of 3D child object.
156    */
157   HYDRODATA_EXPORT virtual void checkAndSetObject3D() {}
158
159
160 protected:
161
162
163   void updateChildProfilePoints();
164
165   void removeChildProfileUZ();
166
167
168 protected:
169
170   friend class HYDROData_Iterator;
171
172   /**
173    * Creates new object in the internal data structure. Use higher level objects 
174    * to create objects with real content.
175    */
176   HYDRODATA_EXPORT HYDROData_Polyline3D();
177
178   /**
179    * Destructs properties of the object and object itself, removes it from the document.
180    */
181   virtual HYDRODATA_EXPORT ~HYDROData_Polyline3D();
182 };
183
184 #endif