Salome HOME
Lot 2: change bathy associated to natural object propagated to all cases without...
[modules/hydro.git] / src / HYDROData / HYDROData_DTM.h
index 0ac618d4b47f0f9f7718e303159a9b82c184b789..d564d56c6728771cca43caaad7fdc0268ca6d791 100644 (file)
 #define HYDROData_DTM_HeaderFile
 
 #include "HYDROData_Bathymetry.h"
+#include "HYDROData_Profile.h"
+
+#include <gp_Pnt2d.hxx>
+
+#include<Geom2d_BSplineCurve.hxx>
+#include<Geom2d_Curve.hxx>
+#include<Geom_Plane.hxx>
+
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfOrientedShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+
 #include <vector>
 #include <set>
-#include <gp_Pnt2d.hxx>
+#include <NCollection_DataMap.hxx>
 
-class Handle_HYDROData_Profile;
-class Handle_Geom2d_BSplineCurve;
-class Handle_Geom2d_Curve;
 class gp_Pnt;
 class gp_Vec2d;
 class TopoDS_Edge;
 class TopoDS_Wire;
 class TopoDS_Face;
 class TopoDS_Compound;
-class Handle_Geom_Plane;
-class TopTools_IndexedMapOfOrientedShape;
-class TopTools_DataMapOfShapeListOfShape;
-class TopTools_SequenceOfShape;
 
-DEFINE_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry )
 
 /**\class HYDROData_DTM
  * \brief Class that represents the Digital Terrain Model
@@ -64,7 +68,7 @@ protected:
   };
 
 public:
-  DEFINE_STANDARD_RTTI( HYDROData_DTM );
+  DEFINE_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry );
 
   HYDRODATA_EXPORT HYDROData_SequenceOfObjects GetProfiles() const;
   HYDRODATA_EXPORT void SetProfiles( const HYDROData_SequenceOfObjects& );
@@ -87,12 +91,13 @@ public:
   class CurveUZ : public std::vector<PointUZ>
   {
   public:
-    CurveUZ( double theXcurv, const gp_Vec2d& theProfileDir, double theDeltaZ );
+    CurveUZ( double theXcurv, const gp_Vec2d& theProfileDir, double theDeltaZ, double theMaxZ );
     ~CurveUZ();
 
     double Xcurv() const;
     gp_Vec2d ProfileDir() const;
     double DeltaZ() const;
+    double MaxZ() const;
 
     CurveUZ operator + ( const CurveUZ& ) const;
     CurveUZ operator * ( double ) const;
@@ -101,6 +106,7 @@ public:
     double myXcurv;
     gp_Vec2d myProfileDir;
     double myDeltaZ;
+    double myMaxZ;
   };
 
 protected:
@@ -111,59 +117,69 @@ protected:
   HYDRODATA_EXPORT HYDROData_DTM();
   virtual HYDRODATA_EXPORT ~HYDROData_DTM();
 
-  static Handle_Geom2d_BSplineCurve CreateHydraulicAxis( 
-    const std::vector<Handle_HYDROData_Profile>& theProfiles,
+  static Handle(Geom2d_BSplineCurve) CreateHydraulicAxis( 
+    const std::vector<Handle(HYDROData_Profile)>& theProfiles,
     std::vector<double>& theDistances );
 
-  static std::vector<Handle_Geom2d_Curve> ProfileToParametric( const Handle_HYDROData_Profile& theProfile,
-                                                               double& theUMin, double& theUMax,
-                                                               gp_Vec2d& theDir );
+  static std::vector<Handle(Geom2d_Curve)> ProfileToParametric( const Handle(HYDROData_Profile)& theProfile,
+                                                                double& theUMin, double& theUMax,
+                                                                gp_Vec2d& theDir );
 
-  static void GetProperties( const Handle_HYDROData_Profile& theProfile,
+  static void GetProperties( const Handle(HYDROData_Profile)& theProfile,
                              gp_Pnt& theLowestPoint, gp_Vec2d& theDir,
                              double& theZMin, double& theZMax );
 
-  static void ProfileDiscretization( const Handle_HYDROData_Profile& theProfile,
-                                     double theXCurv, double theMinZ, double theMaxZ, double theDDZ,
+  static void ProfileDiscretization( const Handle(HYDROData_Profile)& theProfile,
+                                     double theXCurv, double theMinZ, double theMaxZ, double theTopZ, double theDDZ,
                                      CurveUZ& theMidPointCurve,
                                      CurveUZ& theWidthCurve,
                                      int& intersection_nb,
-                                     double theTolerance = 1E-6 );
+                                     double theTolerance,
+                                     QSet<QString>& warnings);
 
-  static void CurveTo3D( const Handle_Geom2d_BSplineCurve& theHydraulicAxis,
+  static void CurveTo3D( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis,
                          const CurveUZ& theMidCurve, const CurveUZ& theWidthCurve,
                          AltitudePoints& thePoints );
   
   static void Interpolate( const CurveUZ& theCurveA, const CurveUZ& theCurveB, 
                            int theNbSteps, std::vector<CurveUZ>& theInterpolation,
-                           bool isAddSecond );
+                           bool isAddSecond);
 
   static std::vector<AltitudePoints> Interpolate
-    ( const Handle_Geom2d_BSplineCurve& theHydraulicAxis,
-      const Handle_HYDROData_Profile& theProfileA,
+    ( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis,
+      const Handle(HYDROData_Profile)& theProfileA,
       double theXCurvA,
-      const Handle_HYDROData_Profile& theProfileB,
+      const Handle(HYDROData_Profile)& theProfileB,
       double theXCurvB,
       double theDDZ, int theNbSteps, bool isAddSecond,
-      int& inter_nb_1, int& inter_nb_2 );
+      int& inter_nb_1, int& inter_nb_2,
+      NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>>& warnings,
+      bool ToEstimateWarningsOnly);
 
-  static AltitudePoints Interpolate( const std::vector<Handle_HYDROData_Profile>& theProfiles,
+  static AltitudePoints Interpolate( const std::vector<Handle(HYDROData_Profile)>& theProfiles,
                                      double theDDZ, double theSpatialStep,
                                      AltitudePoints& theLeft,
                                      AltitudePoints& theRight,
                                      std::vector<AltitudePoints>& theMainProfiles,
-                                     std::set<int>& invalInd );
+                                     std::set<int>& invalInd, 
+                                     NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>>& warnings,
+                                     bool ToEstimateWarningsOnly);
+
+  static void PointsToWire(const AltitudePoints& pnts, TopoDS_Wire& W );
+
+  static void PointsToEdge(const AltitudePoints& pnts, TopoDS_Edge& E );
 
-  static void PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W );
+  //static void ProjWireOnPlane(const TopoDS_Shape& inpWire, const Handle_Geom_Plane& RefPlane,
+    //TopTools_DataMapOfShapeListOfShape* E2PE);
 
-  static void ProjWireOnPlane(const TopoDS_Shape& inpWire, const Handle_Geom_Plane& RefPlane,
-    TopTools_DataMapOfShapeListOfShape* E2PE);
+  static bool GetPlanarFaceFromBanks(const TopoDS_Edge& LB, const TopoDS_Edge& RB, TopoDS_Face& outF,
+    TopTools_SequenceOfShape* Boundr);
 
   static TopTools_IndexedMapOfOrientedShape Create3DShape(const AltitudePoints& left,
                                                           const AltitudePoints& right,
                                                           const std::vector<AltitudePoints>& main_profiles);
 
-  static void CreateProfiles(const std::vector<Handle_HYDROData_Profile>& theProfiles,
+  static void CreateProfiles(const std::vector<Handle(HYDROData_Profile)>& theProfiles,
                              double theDDZ,
                              double theSpatialStep,
                              AltitudePoints& theOutLeft,
@@ -179,12 +195,14 @@ protected:
                              bool Create3dPres,
                              bool Create2dPres,
                              std::set<int>& InvInd,
-                             bool& WireIntersections);
+                             bool& ProjStat,
+                             NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>>& warnings,
+                             bool ToEstimateWarningsOnly);
 
-  static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF, 
-    TopTools_SequenceOfShape* Boundr = NULL, std::set<int> ind = std::set<int>() );
+  //static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF, 
+    //TopTools_SequenceOfShape* Boundr = NULL, std::set<int> ind = std::set<int>() );
   
-  static int EstimateNbPoints( const std::vector<Handle_HYDROData_Profile>& theProfiles,
+  static int EstimateNbPoints( const std::vector<Handle(HYDROData_Profile)>& theProfiles,
                                double theDDZ, double theSpatialStep );
 
   void GetPresentationShapes( TopoDS_Shape& Out3dPres,
@@ -209,7 +227,14 @@ public:
                                                        bool Create2dPres,
                                                        std::set<int>& InvInd,
                                                        int thePntsLimit,
-                                                       bool& WireIntersections);
+                                                       bool& WireIntersections,
+                                                       NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>>& warnings,
+                                                       bool& ToEstimateWarnings);
+
+  HYDRODATA_EXPORT void GetWarnings(NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>>& warnings);
+
+  protected:
+    NCollection_DataMap<Handle(HYDROData_Profile), QSet<QString>> myWarnings;
 };