#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <SelectMgr_EntityOwner.hxx>
#include <ProjLib.hxx>
#include <ElSLib.hxx>
}
}
+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,