Salome HOME
debug of tests for DTM
[modules/hydro.git] / src / HYDROData / HYDROData_Stream.h
index 1aa0b30feb8c72352c8da78a12013b51f9503dc6..7abc7c299b94730c6b3a22911b830413b201de6e 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)
 
@@ -34,6 +36,8 @@ class Handle(HYDROData_Profile);
 class HYDROData_IProfilesInterpolator;
 class TColStd_Array1OfReal;
 class Handle(TopTools_HArray1OfShape);
+class Handle_HYDROData_DTM;
+class TopTools_ListOfShape;
 
 
 /**\class HYDROData_Stream
@@ -48,10 +52,10 @@ public:
   {
     TopoDS_Shape myPrs3D;
     TopoDS_Shape myPrs2D;
-    TopoDS_Edge  myLeftBank;
-    TopoDS_Edge  myRightBank;
-    TopoDS_Edge  myInlet;
-    TopoDS_Edge  myOutlet;
+    TopoDS_Edge  myLeftBank;   // 3d curve of the left bank
+    TopoDS_Edge  myRightBank;  // 3d curve of the right bank
+    TopoDS_Edge  myInlet;      // first (inlet) 2d profile 
+    TopoDS_Edge  myOutlet;     // last (inlet) 2d profile 
   };
 
 protected:
@@ -76,19 +80,17 @@ 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 );
 
   /**
    * Creates the presentations(2D and 3D) by given first points, last points and profiles.
    * If 2D profiles is null - they will not used in the presentation.
    */
-  HYDRODATA_EXPORT static bool CreatePresentations( const Handle(TColgp_HArray1OfPnt)     theArrayOfFPnt,
-                                                    const Handle(TColgp_HArray1OfPnt)     theArrayOfLPnt,
-                                                    const Handle(TopTools_HArray1OfShape) theArrOfProfiles,
-                                                    const Handle(TopTools_HArray1OfShape) theArrOf2DProfiles,
-                                                    PrsDefinition&                        thePrs );
+  HYDRODATA_EXPORT static bool CreatePresentations( const TopoDS_Edge&          theLeftBank,
+                                                    const TopoDS_Edge&          theRightBank,
+                                                    const std::vector<TopoDS_Wire>& theProfiles3d,
+                                                    PrsDefinition&              thePrs );
 
 public:
 
@@ -100,7 +102,8 @@ 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.
@@ -121,7 +124,7 @@ public:
   /**
    * Update the shape presentations of stream.
    */
-  HYDRODATA_EXPORT virtual void UpdatePrs();
+  HYDRODATA_EXPORT void UpdatePrs( const Handle_HYDROData_DTM& );
 
   /**
    *
@@ -133,12 +136,12 @@ public:
   /**
    * 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.
@@ -263,6 +266,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:
 
   /**
@@ -289,16 +299,6 @@ 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 );
@@ -311,9 +311,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