]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Merge branch 'BR_HYDRO_IMPS_2016' of ssh://gitolite3@git.salome-platform.org/modules...
authorasl <asl@opencascade.com>
Mon, 12 Dec 2016 08:22:34 +0000 (11:22 +0300)
committerasl <asl@opencascade.com>
Mon, 12 Dec 2016 08:22:34 +0000 (11:22 +0300)
Conflicts:
src/HYDROData/HYDROData_DTM.cxx

17 files changed:
1  2 
src/HYDROData/HYDROData_Bathymetry.cxx
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_DTM.cxx
src/HYDROData/HYDROData_DTM.h
src/HYDROData/HYDROData_ImmersibleZone.cxx
src/HYDROData/HYDROData_LCM_FaceClassifier.h
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDROData/HYDROData_LandCoverMap.h
src/HYDROData/HYDROData_Profile.cxx
src/HYDROData/HYDROData_Profile.h
src/HYDROPy/HYDROData_CalculationCase.sip
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/TestViewer.h
src/HYDRO_tests/test_HYDROData_CalcCase.cxx
src/HYDRO_tests/test_HYDROData_DTM.cxx
src/HYDRO_tests/test_HYDROData_Stream.cxx

index f04cff9751161bf2198d7c3749e9d64b722918a3,d3a3c441f534fb99688bbb7dba1f9b68a892cbf7..d5bc74800d12b0255f4e4bd79f5018205a8fc4d8
@@@ -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)();
  }
  
 -bool IsCooriented( const Handle_HYDROData_Profile& theProfile1,
 -                   const Handle_HYDROData_Profile& theProfile2 ) 
+ #include <GCE2d_MakeSegment.hxx>
+ #include <Geom2dAPI_InterCurveCurve.hxx>
 -Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis( 
 -  const std::vector<Handle_HYDROData_Profile>& theProfiles,
++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<Handle(HYDROData_Profile)>& theProfiles,
    std::vector<double>& theDistances )
  {
    size_t n = theProfiles.size();
  
    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;
index 844e4e8913156f18dc60e77e6503e54f3a779a54,0ac618d4b47f0f9f7718e303159a9b82c184b789..7b67be1a59ff06e93cf35c3953c2ef771457d911
@@@ -114,20 -111,19 +114,19 @@@ 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,
-                              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,
index 1a83a7efede3c8bee1c7bc8de75bb241eba396ff,30e788867d6c384945d9c9c7fce07a32742ec179..2096e8ce9730969286e97f2f80c7a83a61dc605d
@@@ -30,6 -30,6 +30,7 @@@
  #include <NCollection_IndexedDataMap.hxx>
  #include <TopoDS_Face.hxx>
  #include <NCollection_Map.hxx>
++#include <Geom_Plane.hxx>
  
  class BRepTopAdaptor_FClass2d;
  class HYDROData_LandCoverMap;
Simple merge
Simple merge
Simple merge
index c27e5d36482fe67b1f7a12c48beb5650a3fac2d3,fd470bbd78976b2b1fa3bf90e5bae2bc8e8979e9..90aac8407416c022026ab94f02608623e11edf2b
@@@ -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);