- OCCViewer_Viewer* aViewer = getOCCViewer();
- if ( theObject.IsNull() || !aViewer )
- return isFound;
-
- OCCViewer_ViewWindow* aWindow =
- (OCCViewer_ViewWindow*)aViewer->getViewManager()->getActiveView();
- thePoint = GEOMUtils::ConvertClickToPoint( theX, theY,
- aWindow->getViewPort()->getView() );
-
- Handle(AIS_Line) aLine = Handle(AIS_Line)::DownCast( theObject );
- if ( !aLine.IsNull() ) {
- Handle(Geom_Point) aPStart;
- Handle(Geom_Point) aPEnd;
- aLine->Points( aPStart, aPEnd );
-
- Standard_Real aStartX = aPStart->X(),
- aStartY = aPStart->Y(),
- aStartZ = aPStart->Z();
- Standard_Real anEndX = aPEnd->X(),
- anEndY = aPEnd->Y(),
- anEndZ = aPEnd->Z();
- // TODO: check whether the point belong to the selected line
- gp_Lin aLin( gp_Pnt( aPStart->X(), aPStart->Y(), aPStart->Z() ),
- gp_Dir( gp_Vec( gp_Pnt( aPStart->X(), aPStart->Y(), aPStart->Z() ),
- gp_Pnt( aPEnd->X(), aPEnd->Y(), aPEnd->Z() ) ) ) );
- double aDistance = aLin.Distance( thePoint );
-
-
- if ( aLin.Contains( thePoint, LOCAL_SELECTION_TOLERANCE ) ) {
- // find the neighbour points
- thePoint1 = findLocalPointIndex( 0, aPStart->X(), aPStart->Y() );
- thePoint2 = findLocalPointIndex( 0, aPEnd->X(), aPEnd->Y() );
-
- isFound = thePoint1 >= 0 && thePoint2 >= 0;
- }
- }
- else {
- Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast( theObject );
- if ( !aShape.IsNull() ) {
- // find the neighbour points
- }
- }
- return isFound;
+/**
+ * Returns a point index from the table
+ * \param theRowId a table row
+ */
+int CurveCreator_Widget::getPointId( const int theRowId ) const
+{
+ return myLocalPointView->item( theRowId, 1 )->data( Qt::UserRole ).toInt();
+}
+
+/**
+ * Returns whethe the container has the value
+ * \param theList a container of values
+ * \param theValue a value
+ */
+bool CurveCreator_Widget::contains( const CurveCreator_ICurve::SectionToPointList& theList,
+ const CurveCreator_ICurve::SectionToPoint& theValue ) const
+{
+ return CurveCreator_UtilsICurve::contains( theList, theValue );