Salome HOME
merge master
[modules/hydro.git] / src / HYDROData / HYDROData_Stream.h
index 45a81943493c1a8cb4c07474f372e15bded0bc13..73691575c13f3d943568859068000ad378c15d29 100644 (file)
@@ -1,8 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject)
 
 class Handle(HYDROData_PolylineXY);
+class Handle(HYDROData_Polyline3D);
 class Handle(HYDROData_Profile);
+class HYDROData_IProfilesInterpolator;
 class TColStd_Array1OfReal;
+class Handle(TopTools_HArray1OfShape);
+
 
 /**\class HYDROData_Stream
  * \brief 
@@ -63,7 +63,8 @@ protected:
     DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve
     DataTag_HydraulicAxis,     ///< reference hydraulic axis
     DataTag_Profile,           ///< reference profiles
-    DataTag_ParamsArray        ///< parameters array
+    DataTag_ParamsArray,       ///< parameters array
+    DataTag_BottomPolyline     ///< reference bottom polyline
   };
 
 public:
@@ -79,6 +80,16 @@ public:
                                                     const HYDROData_SequenceOfObjects&  theProfiles,
                                                     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 );
+
 public:
 
   /**
@@ -89,23 +100,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.
@@ -122,15 +124,22 @@ public:
    */
   HYDRODATA_EXPORT virtual void UpdatePrs();
 
+  /**
+   *
+   */
+  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.
@@ -229,6 +238,31 @@ public:
    * Removes all reference profile objects from stream.
    */
   HYDRODATA_EXPORT virtual void RemoveProfiles();
+
+  /**
+   * Generates bottom polyline for stream or update the existing bottom polyline.
+   * \return true in case of success
+   */
+  HYDRODATA_EXPORT virtual bool GenerateBottomPolyline();
+
+  /**
+   * Returns reference bottom polyline object of stream.
+   */
+  HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline3D) GetBottomPolyline() const;
+  
+  /**
+   * Sets reference bottom polyline object for stream.
+   * \param theBottom the polyline 3D
+   * \return true in case of success
+   */
+  HYDRODATA_EXPORT virtual bool SetBottomPolyline( const Handle(HYDROData_Polyline3D)& theBottom );
+
+  /**
+   * Add interpolated profiles into the stream.
+   * \param theInterpolator the interpolator
+   * \return true in case of success
+   */
+  HYDRODATA_EXPORT virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator );
   
 protected:
 
@@ -256,16 +290,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 );