-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();
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;
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,
#include <NCollection_IndexedDataMap.hxx>
#include <TopoDS_Face.hxx>
#include <NCollection_Map.hxx>
++#include <Geom_Plane.hxx>
class BRepTopAdaptor_FClass2d;
class HYDROData_LandCoverMap;
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);