Salome HOME
Corrections of examples path after install with scbi
[modules/hydro.git] / src / HYDROData / HYDROData_Polyline3D.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROData_Polyline3D_HeaderFile
20 #define HYDROData_Polyline3D_HeaderFile
21
22 #include "HYDROData_Object.h"
23
24 class HYDROData_PolylineXY;
25 class HYDROData_ProfileUZ;
26 class gp_XYZ;
27
28 /**\class HYDROData_Polyline3D
29  * \brief 
30  *
31  */
32 class HYDROData_Polyline3D : public HYDROData_Object
33 {
34 public:
35
36   typedef gp_XYZ                                Polyline3DPoint;
37   typedef NCollection_Sequence<Polyline3DPoint> Polyline3DPoints;
38
39 protected:
40   /**
41    * Enumeration of tags corresponding to the persistent object parameters.
42    */
43   enum DataTag
44   {
45     DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
46     DataTag_PolylineXY,          ///< reference hydraulic axis
47     DataTag_ProfileUZ,           ///< reference profile
48     DataTag_ChildProfileUZ,      ///< reference profile
49   };
50
51 public:
52   DEFINE_STANDARD_RTTIEXT(HYDROData_Polyline3D, HYDROData_Object);
53
54   /**
55    * Returns the kind of this object. Must be redefined in all objects of known type.
56    */
57   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
58
59   /**
60    * Dump object to Python script representation.
61    */
62   HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath,
63                                                      MapOfTreatedObjects& theTreatedObjects ) const;
64
65   /**
66    * Returns the list of all reference objects of this object.
67    */
68   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
69
70   /**
71    * Update the shape presentations of stream.
72    * Call this method whenever you made changes for stream data.
73    */
74   HYDRODATA_EXPORT virtual void Update();
75
76   /**
77    * Returns default filling color for new 3D polyline.
78    */
79   HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const;
80
81   /**
82    * Returns default border color for new 3D polyline.
83    */
84   HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const;
85
86
87 public:      
88   // Public methods to work with 3D polyline
89   
90   /**
91    * Sets reference x,y polyline object for 3D polyline.
92    */
93   HYDRODATA_EXPORT virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline,
94                                                const bool                          theIsUpdateProfile = true );
95
96   /**
97    * Returns reference x,y polyline object of 3D polyline.
98    */
99   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const;
100
101   /**
102    * Remove reference x,y polyline object from 3D polyline.
103    */
104   HYDRODATA_EXPORT virtual void RemovePolylineXY();
105
106
107   /**
108    * Sets reference u,z profile object for 3D polyline.
109    */
110   HYDRODATA_EXPORT virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
111
112   /**
113    * Returns reference u,z profile object of 3D polyline.
114    */
115   HYDRODATA_EXPORT virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const;
116
117   /**
118    * Remove reference u,z profile object from 3D polyline.
119    */
120   HYDRODATA_EXPORT virtual void RemoveProfileUZ();
121
122
123   /**
124    * Set reference bathymetry object for geometry object.
125    * Reimplemented to remove reference u,z profile.
126    */
127   HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
128
129   /**
130    * Clear the reference bathymetry object for geometry object.
131    * Reimplemented to remove child u,z profile.
132    */
133   HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
134
135   HYDRODATA_EXPORT Polyline3DPoints GetProfilePoints3D(bool IsConvertToGlobal);
136
137   /**
138    * Returns the child u,z profile which has been generated from bathymetry.
139    */
140   HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const;
141
142   /**
143    * Sets the child u,z profile for polyline.
144    */
145   HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
146
147   /**
148    * Returns list of polyline points.
149    * \return list of 3D points
150    */
151   HYDRODATA_EXPORT Polyline3DPoints GetPoints( double theEqDistance = -1 ) const;
152
153 protected:
154   /**
155    * Checks and if necessary create child 3D object.
156    * Reimplemented to prevent creation of 3D child object.
157    */
158   HYDRODATA_EXPORT virtual void checkAndSetObject3D() {}
159
160
161 protected:
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