From: asl Date: Mon, 12 Dec 2016 08:22:34 +0000 (+0300) Subject: Merge branch 'BR_HYDRO_IMPS_2016' of ssh://gitolite3@git.salome-platform.org/modules... X-Git-Tag: Salome_8_3_Hydro_1_1rc1~58^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ad4482443835973ac9ee0ce2024f60f91adff716;p=modules%2Fhydro.git Merge branch 'BR_HYDRO_IMPS_2016' of ssh://gitolite3@git.salome-platform.org/modules/hydro.git into BR_PORTING_OCCT_7 Conflicts: src/HYDROData/HYDROData_DTM.cxx --- ad4482443835973ac9ee0ce2024f60f91adff716 diff --cc src/HYDROData/HYDROData_DTM.cxx index f04cff97,d3a3c441..d5bc7480 --- a/src/HYDROData/HYDROData_DTM.cxx +++ b/src/HYDROData/HYDROData_DTM.cxx @@@ -523,9 -530,8 +526,8 @@@ void HYDROData_DTM::CreateProfiles(cons -void HYDROData_DTM::GetProperties( const Handle_HYDROData_Profile& theProfile, +void HYDROData_DTM::GetProperties( const Handle(HYDROData_Profile)& theProfile, gp_Pnt& theLowestPoint, gp_Vec2d& theDir, - bool isNormalDir, double& theZMin, double& theZMax ) { theLowestPoint = theProfile->GetBottomPoint(); @@@ -614,8 -617,33 +613,33 @@@ Handle(Geom2d_Curve) CurveTo2D( const H return Handle(Geom2d_Curve)(); } + #include + #include -bool IsCooriented( const Handle_HYDROData_Profile& theProfile1, - const Handle_HYDROData_Profile& theProfile2 ) ++bool IsCooriented( const Handle(HYDROData_Profile)& theProfile1, ++ const Handle(HYDROData_Profile)& theProfile2 ) + { + if( theProfile1==theProfile2 ) + return true; + + gp_XY lp1, rp1, lp2, rp2; + theProfile1->GetLeftPoint(lp1); + theProfile1->GetRightPoint(rp1); + theProfile2->GetLeftPoint(lp2); + theProfile2->GetRightPoint(rp2); + + GCE2d_MakeSegment s1(lp1, lp2); + GCE2d_MakeSegment s2(rp1, rp2); + + Geom2dAPI_InterCurveCurve inter; + inter.Init(s1, s2); + if (inter.NbPoints() == 0) + return true; + else + return false; + } + -Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis( - const std::vector& theProfiles, +Handle(Geom2d_BSplineCurve) HYDROData_DTM::CreateHydraulicAxis( + const std::vector& theProfiles, std::vector& theDistances ) { size_t n = theProfiles.size(); @@@ -627,7 -658,18 +654,18 @@@ for( size_t i = 1; i <= n; i++ ) { - Handle_HYDROData_Profile aProfile = theProfiles[i-1]; - Handle_HYDROData_Profile aPrevProfile = i==1 ? theProfiles[i-1] : theProfiles[i-2]; - Handle_HYDROData_Profile aNextProfile = i==n ? theProfiles[i-1] : theProfiles[i]; + Handle(HYDROData_Profile) aProfile = theProfiles[i-1]; ++ Handle(HYDROData_Profile) aPrevProfile = i==1 ? theProfiles[i-1] : theProfiles[i-2]; ++ Handle(HYDROData_Profile) aNextProfile = i==n ? theProfiles[i-1] : theProfiles[i]; + + if( !IsCooriented( aProfile, aNextProfile ) ) + { + gp_XY lp, rp; + aProfile->GetLeftPoint( lp, true ); + aProfile->GetRightPoint( rp, true ); + aProfile->SetLeftPoint( rp, true ); + aProfile->SetRightPoint( lp, true ); + } aProfile->Update(); gp_Pnt aLowest; diff --cc src/HYDROData/HYDROData_DTM.h index 844e4e89,0ac618d4..7b67be1a --- a/src/HYDROData/HYDROData_DTM.h +++ b/src/HYDROData/HYDROData_DTM.h @@@ -114,20 -111,19 +114,19 @@@ 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, + static void ProfileDiscretization( const Handle(HYDROData_Profile)& theProfile, double theXCurv, double theMinZ, double theMaxZ, double theDDZ, CurveUZ& theMidPointCurve, CurveUZ& theWidthCurve, diff --cc src/HYDROData/HYDROData_LCM_FaceClassifier.h index 1a83a7ef,30e78886..2096e8ce --- a/src/HYDROData/HYDROData_LCM_FaceClassifier.h +++ b/src/HYDROData/HYDROData_LCM_FaceClassifier.h @@@ -30,6 -30,6 +30,7 @@@ #include #include #include ++#include class BRepTopAdaptor_FClass2d; class HYDROData_LandCoverMap; diff --cc src/HYDRO_tests/TestViewer.h index c27e5d36,fd470bbd..90aac840 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@@ -36,13 -35,15 +36,15 @@@ public static OCCViewer_ViewManager* viewManager(); static OCCViewer_Viewer* viewer(); static OCCViewer_ViewWindow* viewWindow(); - static Handle_AIS_InteractiveContext context(); + static Handle(AIS_InteractiveContext) context(); static void eraseAll( bool isUpdate ); - static void show( const Handle_AIS_InteractiveObject& theObject, + static void show( const Handle(AIS_InteractiveObject)& theObject, int theMode, int theSelectionMode, bool isFitAll, const char* theKey ); - static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor ); - static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey ); + static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor, + int theUIANb = 10, int theVIANb = 10); + static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey, + int theUIANb = 10, int theVIANb = 10); static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0 ); static QColor GetColor(int i);