2 #ifndef HYDROData_Stream_HeaderFile
3 #define HYDROData_Stream_HeaderFile
5 #include "HYDROData_NaturalObject.h"
6 #include <TopoDS_Face.hxx>
7 DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject)
9 class Handle(HYDROData_PolylineXY);
10 class Handle(HYDROData_Profile);
11 class TColStd_Array1OfReal;
13 /**\class HYDROData_Stream
17 class HYDROData_Stream : public HYDROData_NaturalObject
21 * Enumeration of tags corresponding to the persistent object parameters.
25 DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve
26 DataTag_HydraulicAxis, ///< reference hydraulic axis
27 DataTag_Profile, ///< reference profiles
28 DataTag_ParamsArray ///< parameters array
32 DEFINE_STANDARD_RTTI(HYDROData_Stream);
35 * Returns the kind of this object. Must be redefined in all objects of known type.
37 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_STREAM;}
40 * Dump object to Python script representation.
42 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
45 * Returns the list of all reference objects of this object.
47 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
50 * Returns the top shape of the object.
52 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
55 * Returns the 3d shape of the object.
57 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
60 * Update the shape presentations of stream.
61 * Call this method whenever you made changes for stream data.
63 HYDRODATA_EXPORT virtual void Update();
67 // Public methods to work with Stream
70 * Sets reference hydraulic axis object for stream.
72 HYDRODATA_EXPORT virtual bool SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis );
75 * Returns reference hydraulic axis object of stream.
77 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetHydraulicAxis() const;
80 * Remove reference hydraulic axis object from stream.
82 HYDRODATA_EXPORT virtual void RemoveHydraulicAxis();
86 * Returns true if profile has the intersection with reference hydraulic axis.
87 * Returns the parameter of inresection point on axis if axis is presented by one curve,
88 * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point.
90 HYDRODATA_EXPORT virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
91 Standard_Real& outPar) const;
94 * Builds a planar face
96 HYDRODATA_EXPORT virtual bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
99 * Add new one reference profile object for stream.
101 HYDRODATA_EXPORT virtual bool AddProfile( const Handle(HYDROData_Profile)& theProfile );
104 * Returns all reference profile objects of stream.
106 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetProfiles() const;
109 * Removes reference profile object from stream.
111 HYDRODATA_EXPORT virtual bool RemoveProfile( const Handle(HYDROData_Profile)& theProfile );
114 * Removes all reference profile objects from stream.
116 HYDRODATA_EXPORT virtual void RemoveProfiles();
122 * Insert one profile in to the stream profiles order.
124 void insertProfileInToOrder( const Handle(HYDROData_Profile)& theProfile,
125 const int theBeforeIndex = -1 );
128 * Fully recompute the order of all profiles in accordance with reference hydraulic axis.
129 * If hydraulic axis is not set all profiles will be removed from order.
131 void updateProfilesOrder();
135 void setParametersArray( const TColStd_Array1OfReal& theArray );
137 TColStd_Array1OfReal* getParametersArray() const;
139 void removeParametersArray();
141 int insertParameter( const Standard_Real& theParam );
143 void removeParameter( const int& theIndex );
147 friend class HYDROData_Iterator;
150 * Creates new object in the internal data structure. Use higher level objects
151 * to create objects with real content.
153 HYDRODATA_EXPORT HYDROData_Stream();
156 * Destructs properties of the object and object itself, removes it from the document.
158 virtual HYDRODATA_EXPORT ~HYDROData_Stream();