Salome HOME
patch for problems on SALOME 8.2.0
[modules/hydro.git] / src / HYDROData / HYDROData_Stream.h
index 16d76503ebd1539b327ffcc0d4a335c4e4d3c837..923c23f55fe73a390c9809a133781348a4d08793 100644 (file)
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
 
 #include <Geom_BSplineCurve.hxx>
+#include <vector>
 
-DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject)
-
-class Handle(HYDROData_PolylineXY);
-class Handle(HYDROData_Polyline3D);
-class Handle(HYDROData_Profile);
+class HYDROData_DTM;
+class HYDROData_PolylineXY;
+class HYDROData_Polyline3D;
+class HYDROData_Profile;
 class HYDROData_IProfilesInterpolator;
-class TColStd_Array1OfReal;
+class TopTools_HArray1OfShape;
 
 
 /**\class HYDROData_Stream
@@ -47,10 +48,10 @@ public:
   {
     TopoDS_Shape myPrs3D;
     TopoDS_Shape myPrs2D;
-    TopoDS_Edge  myLeftBank;
-    TopoDS_Edge  myRightBank;
-    TopoDS_Edge  myInlet;
-    TopoDS_Edge  myOutlet;
+    TopoDS_Wire  myLeftBank;   // 3d curve of the left bank
+    TopoDS_Wire  myRightBank;  // 3d curve of the right bank
+    TopoDS_Wire  myInlet;      // first (inlet) 2d profile 
+    TopoDS_Wire  myOutlet;     // last (inlet) 2d profile 
   };
 
 protected:
@@ -67,17 +68,20 @@ protected:
   };
 
 public:
-
-  DEFINE_STANDARD_RTTI(HYDROData_Stream);
+  DEFINE_STANDARD_RTTIEXT(HYDROData_Stream, HYDROData_NaturalObject);
 
 public:
 
   /**
    * Creates the presentations(2D and 3D) by given hydraulic axis and profiles.
    */
-  HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_PolylineXY)& theHydAxis,
-                                                    const HYDROData_SequenceOfObjects&  theProfiles,
-                                                    PrsDefinition&                      thePrs );
+  HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_DTM)& theDTM,
+                                                    PrsDefinition&               thePrs );
+
+  HYDRODATA_EXPORT static void CreatePresentations( const Handle(TColgp_HArray1OfPnt)     theArrayOfFPnt,
+                                                    const Handle(TColgp_HArray1OfPnt)     theArrayOfLPnt,
+                                                    const Handle(TopTools_HArray1OfShape) theArrOfProfiles,
+                                                    PrsDefinition&                        thePrs );
 
 public:
 
@@ -89,23 +93,14 @@ public:
   /**
    * Dump object to Python script representation.
    */
-  HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
+  HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath,
+                                                     MapOfTreatedObjects& theTreatedObjects ) const;
 
   /**
    * Returns the list of all reference objects of this object.
    */
   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
 
-  /**
-   * Returns the top shape of the object.
-   */
-  HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
-  /**
-   * Returns the 3d shape of the object.
-   */
-  HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
   /**
    * Update the profiles order and shape presentations of stream.
    * Call this method whenever you made changes for stream data.
@@ -120,23 +115,24 @@ public:
   /**
    * Update the shape presentations of stream.
    */
-  HYDRODATA_EXPORT virtual void UpdatePrs();
+  HYDRODATA_EXPORT void UpdatePrs( const Handle(HYDROData_DTM)& );
 
   /**
    *
    */
-  HYDRODATA_EXPORT virtual void CopyTo( const Handle(HYDROData_Entity)& theDestination ) const;
+  HYDRODATA_EXPORT virtual void CopyTo( const Handle(HYDROData_Entity)& theDestination,
+                                        bool isGenerateNewName ) const;
 
 
   /**
    * Returns default filling color for new stream.
    */
-  HYDRODATA_EXPORT static QColor DefaultFillingColor();
+  HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const;
 
   /**
    * Returns default border color for new stream.
    */
-  HYDRODATA_EXPORT static QColor DefaultBorderColor();
+  HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const;
 
   /**
    * Returns true if given polyline can be used as stream axis.
@@ -207,8 +203,7 @@ public:
   /**
   * Builds a planar face
   */
-  HYDRODATA_EXPORT static bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis,
-                                          TopoDS_Face&                        thePlane );
+  HYDRODATA_EXPORT static void BuildRefFace( TopoDS_Face& thePlane );
 
   /**
    * Add new one reference profile object for stream.
@@ -261,6 +256,13 @@ public:
    */
   HYDRODATA_EXPORT virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
   
+
+  HYDRODATA_EXPORT double GetDDZ() const;
+  HYDRODATA_EXPORT void   SetDDZ( double theDDZ );
+  
+  HYDRODATA_EXPORT double GetSpatialStep() const;
+  HYDRODATA_EXPORT void   SetSpatialStep( double theSpatialStep );
+  
 protected:
 
   /**
@@ -287,19 +289,9 @@ protected:
   static Handle(Geom_BSplineCurve) buildInterpolationCurve(
     const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt );
 
-  /**
-   * Returns default filling color for new object.
-   */
-  HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
-
-  /**
-   * Returns default border color for new object.
-   */
-  HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
-
 private:
   
-  void setParametersArray( const TColStd_Array1OfReal& theArray );
+  void setParametersArray( const QVector<double>& theArray );
 
   TColStd_Array1OfReal* getParametersArray() const;
 
@@ -309,9 +301,12 @@ private:
 
   void removeParameter( const int& theIndex );
 
-protected:
+  Handle(HYDROData_DTM) DTM() const;
 
+
+protected:
   friend class HYDROData_Iterator;
+  friend class test_HYDROData_Stream;
 
   /**
    * Creates new object in the internal data structure. Use higher level objects