Salome HOME
Lot 2: change bathy associated to natural object propagated to all cases without...
[modules/hydro.git] / src / HYDROData / HYDROData_Stream.h
index fd4ffca5f1784e6741e632ade6f93e980a9087a0..fb65c98394ad67afce3c45280d64a7aff39b94e3 100644 (file)
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
 
 #include <Geom_BSplineCurve.hxx>
-
-DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject)
-
-class Handle(HYDROData_PolylineXY);
-class Handle(HYDROData_Polyline3D);
-class Handle(HYDROData_Profile);
+#include <vector>
+#include <NCollection_DataMap.hxx>
+#include <QSet>
+
+class HYDROData_DTM;
+class HYDROData_LISM;
+class HYDROData_PolylineXY;
+class HYDROData_Polyline3D;
+class HYDROData_Profile;
 class HYDROData_IProfilesInterpolator;
-class TColStd_Array1OfReal;
-class Handle(TopTools_HArray1OfShape);
+class TopTools_HArray1OfShape;
 
 
 /**\class HYDROData_Stream
@@ -48,10 +51,10 @@ public:
   {
     TopoDS_Shape myPrs3D;
     TopoDS_Shape myPrs2D;
-    TopoDS_Edge  myLeftBank;
-    TopoDS_Edge  myRightBank;
-    TopoDS_Edge  myInlet;
-    TopoDS_Edge  myOutlet;
+    TopoDS_Shape myLeftBank;   // 3d curve of the left bank
+    TopoDS_Shape myRightBank;  // 3d curve of the right bank
+    TopoDS_Shape myInlet;      // first (inlet) 2d profile 
+    TopoDS_Shape myOutlet;     // last (inlet) 2d profile 
   };
 
 protected:
@@ -64,30 +67,24 @@ protected:
     DataTag_HydraulicAxis,     ///< reference hydraulic axis
     DataTag_Profile,           ///< reference profiles
     DataTag_ParamsArray,       ///< parameters array
-    DataTag_BottomPolyline     ///< reference bottom polyline
+    DataTag_BottomPolyline,    ///< reference bottom polyline
+    DataTag_InterpMethod       ///< interpolation method (via DTM(0) or LISM(1))
   };
 
 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 );
 
-  /**
-   * 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,
+  HYDRODATA_EXPORT static void CreatePresentations( const Handle(TColgp_HArray1OfPnt)     theArrayOfFPnt,
                                                     const Handle(TColgp_HArray1OfPnt)     theArrayOfLPnt,
                                                     const Handle(TopTools_HArray1OfShape) theArrOfProfiles,
-                                                    const Handle(TopTools_HArray1OfShape) theArrOf2DProfiles,
                                                     PrsDefinition&                        thePrs );
 
 public:
@@ -100,23 +97,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.
@@ -131,7 +119,9 @@ public:
   /**
    * Update the shape presentations of stream.
    */
-  HYDRODATA_EXPORT virtual void UpdatePrs();
+  HYDRODATA_EXPORT void UpdatePrs( const Handle(HYDROData_DTM)& );
+
+  HYDRODATA_EXPORT void UpdatePrs( const Handle(HYDROData_LISM)& theLISM );
 
   /**
    *
@@ -143,12 +133,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.
@@ -197,6 +187,13 @@ public:
    */
   HYDRODATA_EXPORT virtual void RemoveHydraulicAxis();
 
+  HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetLeftBank() const;
+
+  HYDRODATA_EXPORT virtual void SetLeftBank( const Handle(HYDROData_PolylineXY)& theBank );
+
+  HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetRightBank() const;
+
+  HYDRODATA_EXPORT virtual void SetRightBank( const Handle(HYDROData_PolylineXY)& theBank );
   /**
    * Returns true if profile has the intersection with the given hydraulic axis.
    * Returns the parameter of inresection point on axis if axis is presented by one curve,
@@ -219,8 +216,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.
@@ -273,6 +269,25 @@ public:
    */
   HYDRODATA_EXPORT virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
   
+
+  HYDRODATA_EXPORT double GetDDZ() const;
+  HYDRODATA_EXPORT void   SetDDZ( double theDDZ );
+  
+  HYDRODATA_EXPORT int    GetInterpolationMethod() const;
+  HYDRODATA_EXPORT void   SetInterpolationMethod( int theMode );
+
+  HYDRODATA_EXPORT double GetSpatialStep() const;
+  HYDRODATA_EXPORT void   SetSpatialStep( double theSpatialStep );
+
+  HYDRODATA_EXPORT double GetHaxStep() const;
+  HYDRODATA_EXPORT void   SetHaxStep( double theHaxStep );
+
+  HYDRODATA_EXPORT int    GetNbProfilePoints() const;
+  HYDRODATA_EXPORT void   SetNbProfilePoints( int theNbPoints );  
+
+  HYDRODATA_EXPORT void   GetWarnings(NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>>& warnings);
+
+  
 protected:
 
   /**
@@ -299,19 +314,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;
 
@@ -321,9 +326,16 @@ private:
 
   void removeParameter( const int& theIndex );
 
-protected:
+  Handle(HYDROData_DTM) DTM() const;
 
+  Handle(HYDROData_LISM) LISM() const;
+
+  void internalUpdatePrs( const PrsDefinition& aResultPrs );
+  
+
+protected:
   friend class HYDROData_Iterator;
+  friend class test_HYDROData_Stream;
 
   /**
    * Creates new object in the internal data structure. Use higher level objects 
@@ -335,6 +347,9 @@ protected:
    * Destructs properties of the object and object itself, removes it from the document.
    */
   virtual HYDRODATA_EXPORT ~HYDROData_Stream();
+
+protected:
+  NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>> myWarnings;
 };
 
 #endif