X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_DTM.h;h=59d3cd6811e8a7f60c67620e63f6512661e8cc50;hb=e2faff1d724922e34c3e8613906380ac5e3fbd7d;hp=0dc1a89191f7627b285e4272a43f9278a84de0f4;hpb=3627a8d6abf2c69fa15adc51056578fb41100841;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_DTM.h b/src/HYDROData/HYDROData_DTM.h index 0dc1a891..59d3cd68 100644 --- a/src/HYDROData/HYDROData_DTM.h +++ b/src/HYDROData/HYDROData_DTM.h @@ -20,23 +20,28 @@ #define HYDROData_DTM_HeaderFile #include "HYDROData_Bathymetry.h" +#include "HYDROData_Profile.h" + +#include + +#include +#include +#include + +#include +#include +#include + #include #include -#include -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; -DEFINE_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry ) /**\class HYDROData_DTM * \brief Class that represents the Digital Terrain Model @@ -62,7 +67,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& ); @@ -85,11 +90,13 @@ public: class CurveUZ : public std::vector { public: - CurveUZ( double theXcurv, const gp_Vec2d& theProfileDir = gp_Vec2d() ); + CurveUZ( double theXcurv, const gp_Vec2d& theProfileDir, double theDeltaZ, double theMaxZ ); ~CurveUZ(); double Xcurv() const; - gp_Vec2d ProfileDir() const; + gp_Vec2d ProfileDir() const; + double DeltaZ() const; + double MaxZ() const; CurveUZ operator + ( const CurveUZ& ) const; CurveUZ operator * ( double ) const; @@ -97,6 +104,8 @@ public: private: double myXcurv; gp_Vec2d myProfileDir; + double myDeltaZ; + double myMaxZ; }; protected: @@ -107,59 +116,64 @@ protected: HYDRODATA_EXPORT HYDROData_DTM(); virtual HYDRODATA_EXPORT ~HYDROData_DTM(); - static Handle_Geom2d_BSplineCurve CreateHydraulicAxis( - const std::vector& theProfiles, + static Handle(Geom2d_BSplineCurve) CreateHydraulicAxis( + const std::vector& theProfiles, std::vector& theDistances ); - static std::vector ProfileToParametric( const Handle_HYDROData_Profile& theProfile, - double& theUMin, double& theUMax, - gp_Vec2d& theDir ); + static std::vector 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, - bool isNormalDir, 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 ); - static void CurveTo3D( const Handle_Geom2d_BSplineCurve& theHydraulicAxis, + static void CurveTo3D( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis, const CurveUZ& theMidCurve, const CurveUZ& theWidthCurve, - AltitudePoints& thePoints, double dz ); + AltitudePoints& thePoints ); static void Interpolate( const CurveUZ& theCurveA, const CurveUZ& theCurveB, int theNbSteps, std::vector& theInterpolation, bool isAddSecond ); static std::vector 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 ); - static AltitudePoints Interpolate( const std::vector& theProfiles, + static AltitudePoints Interpolate( const std::vector& theProfiles, double theDDZ, double theSpatialStep, AltitudePoints& theLeft, AltitudePoints& theRight, std::vector& theMainProfiles, - std::set invalInd ); + std::set& invalInd ); + + 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_Wire& inpWire, const Handle_Geom_Plane& RefPlane, TopoDS_Wire& outWire); + 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& main_profiles); - static void CreateProfiles(const std::vector& theProfiles, + static void CreateProfiles(const std::vector& theProfiles, double theDDZ, double theSpatialStep, AltitudePoints& theOutLeft, @@ -174,10 +188,15 @@ protected: TopoDS_Shape& OutOutlet, bool Create3dPres, bool Create2dPres, - std::set InvInd ); + std::set& InvInd, + bool& ProjStat); + + //static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF, + //TopTools_SequenceOfShape* Boundr = NULL, std::set ind = std::set() ); + + static int EstimateNbPoints( const std::vector& theProfiles, + double theDDZ, double theSpatialStep ); - static void Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF ); - void GetPresentationShapes( TopoDS_Shape& Out3dPres, TopoDS_Shape& Out2dPres, TopoDS_Shape& OutLeftB, @@ -187,18 +206,20 @@ protected: public: HYDRODATA_EXPORT static void CreateProfilesFromDTM ( const HYDROData_SequenceOfObjects& InpProfiles, - double ddz, - double step, - AltitudePoints& points, - TopoDS_Shape& Out3dPres, - TopoDS_Shape& Out2dPres, - TopoDS_Shape& OutLeftB, - TopoDS_Shape& OutRightB, - TopoDS_Shape& OutInlet, - TopoDS_Shape& OutOutlet, - bool Create3dPres, - bool Create2dPres, - std::set InvInd ); + double ddz, + double step, + AltitudePoints& points, + TopoDS_Shape& Out3dPres, + TopoDS_Shape& Out2dPres, + TopoDS_Shape& OutLeftB, + TopoDS_Shape& OutRightB, + TopoDS_Shape& OutInlet, + TopoDS_Shape& OutOutlet, + bool Create3dPres, + bool Create2dPres, + std::set& InvInd, + int thePntsLimit, + bool& WireIntersections); };