]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_Polyline3D.h
Salome HOME
Projection of polyline on bathymetry object (Feature #234).
[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   };
34
35 public:
36   DEFINE_STANDARD_RTTI(HYDROData_Polyline3D);
37
38   /**
39    * Returns the kind of this object. Must be redefined in all objects of known type.
40    */
41   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
42
43   /**
44    * Dump object to Python script representation.
45    */
46   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
47
48   /**
49    * Returns the list of all reference objects of this object.
50    */
51   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
52
53   /**
54    * Returns the top shape of the object.
55    */
56   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
57
58   /**
59    * Returns the 3d shape of the object.
60    */
61   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
62
63   /**
64    * Update the shape presentations of stream.
65    * Call this method whenever you made changes for stream data.
66    */
67   HYDRODATA_EXPORT virtual void Update();
68
69   /**
70    * Returns default filling color for new 3D polyline.
71    */
72   HYDRODATA_EXPORT static QColor DefaultFillingColor();
73
74   /**
75    * Returns default border color for new 3D polyline.
76    */
77   HYDRODATA_EXPORT static QColor DefaultBorderColor();
78
79
80 public:      
81   // Public methods to work with 3D polyline
82   
83   /**
84    * Sets reference x,y polyline object for 3D polyline.
85    */
86   HYDRODATA_EXPORT virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline );
87
88   /**
89    * Returns reference x,y polyline object of 3D polyline.
90    */
91   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const;
92
93   /**
94    * Remove reference x,y polyline object from 3D polyline.
95    */
96   HYDRODATA_EXPORT virtual void RemovePolylineXY();
97
98
99   /**
100    * Sets reference u,z profile object for 3D polyline.
101    */
102   HYDRODATA_EXPORT virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
103
104   /**
105    * Returns reference u,z profile object of 3D polyline.
106    */
107   HYDRODATA_EXPORT virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const;
108
109   /**
110    * Remove reference u,z profile object from 3D polyline.
111    */
112   HYDRODATA_EXPORT virtual void RemoveProfileUZ();
113
114
115   /**
116    * Set reference bathymetry object for geometry object.
117    * Reimplemented to remove reference u,z profile.
118    */
119   HYDRODATA_EXPORT virtual bool SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
120
121
122 protected:
123
124   /**
125    * Returns default filling color for new object.
126    */
127   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
128
129   /**
130    * Returns default border color for new object.
131    */
132   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
133
134   /**
135    * Checks and if necessary create child 3D object.
136    * Reimplemented to prevent creation of 3D child object.
137    */
138   HYDRODATA_EXPORT virtual void checkAndSetObject3D() {}
139
140
141 protected:
142
143   friend class HYDROData_Iterator;
144
145   /**
146    * Creates new object in the internal data structure. Use higher level objects 
147    * to create objects with real content.
148    */
149   HYDRODATA_EXPORT HYDROData_Polyline3D();
150
151   /**
152    * Destructs properties of the object and object itself, removes it from the document.
153    */
154   virtual HYDRODATA_EXPORT ~HYDROData_Polyline3D();
155 };
156
157 #endif