From: nds Date: Tue, 3 Dec 2013 08:41:44 +0000 (+0000) Subject: OCC functionality moving out from the widget X-Git-Tag: BR_hydro_v_0_4~87 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c14457122ecd6d826df184d5ec0f3e030e6b8ba;p=modules%2Fhydro.git OCC functionality moving out from the widget --- diff --git a/src/HYDROCurveCreator/CurveCreator_Utils.cxx b/src/HYDROCurveCreator/CurveCreator_Utils.cxx index 15396cdc..17751678 100644 --- a/src/HYDROCurveCreator/CurveCreator_Utils.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Utils.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,35 @@ void CurveCreator_Utils::setLocalPointContext( } } +bool CurveCreator_Utils::getNeighbourPoints( Handle(AIS_InteractiveContext) theContext, + Handle(V3d_View) theView, + const int theX, const int theY, + gp_Pnt& thePoint, gp_Pnt& thePoint1, + gp_Pnt& thePoint2 ) +{ + bool isFoundPoint = false; + if ( theContext.IsNull() ) + return isFoundPoint; + + for ( theContext->InitSelected(); theContext->MoreSelected() && !isFoundPoint; + theContext->NextSelected() ) { + TopoDS_Shape aTShape = theContext->SelectedShape(); + if ( !aTShape.IsNull() && aTShape.ShapeType() == TopAbs_VERTEX ) + continue; + else { + Handle(SelectMgr_EntityOwner) anOwner = theContext->SelectedOwner(); + if ( anOwner.IsNull() ) + continue; + const TopLoc_Location& aLocation = anOwner->Location(); + Handle(AIS_InteractiveObject) anAIS = + Handle(AIS_InteractiveObject)::DownCast( anOwner->Selectable() ); + isFoundPoint = CurveCreator_Utils::pointOnObject( theView, anAIS, theX, theY, thePoint, + thePoint1, thePoint2 ); + } + } + return isFoundPoint; +} + bool CurveCreator_Utils::pointOnObject( Handle(V3d_View) theView, Handle(AIS_InteractiveObject) theObject, const int theX, const int theY,