Salome HOME
refs #1331: disabling automatic sorting of points in the GUI table
[modules/geom.git] / src / CurveCreator / CurveCreator_Utils.cxx
index 5f53caea4b9b76b1c622ec05d4b18bc85669d24f..20b16f4c455befdf6d7fc645f21eb15cda741b05 100644 (file)
@@ -311,9 +311,7 @@ void CurveCreator_Utils::constructShape(
     }
 
     // Get the different points.
-    const CurveCreator_ISection* aSection = theCurve->getSection(aSectionI);
-    Handle(TColgp_HArray1OfPnt) aPoints;
-    aSection->GetDifferentPoints(theCurve->getDimension(), aPoints);
+    Handle(TColgp_HArray1OfPnt) aPoints = theCurve->GetDifferentPoints( aSectionI );
     const int aPointCount = aPoints->Length();
     const bool isClosed = theCurve->isClosed(aSectionI);
 
@@ -619,28 +617,28 @@ void CurveCreator_Utils::setSelectedPoints( Handle(AIS_InteractiveContext) theCo
   theContext->SetAutomaticHilight( Standard_False );
 
   Handle(SelectMgr_Selection) aSelection = anAISShape->Selection( AIS_Shape::SelectionMode( TopAbs_VERTEX ) );
-  for( aSelection->Init(); aSelection->More(); aSelection->Next() )
-  {    
+
+  CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
+                                                          aLast = thePoints.end();
+  bool isFound = false;
+  for( int i=0; i<aSize; i++ )
+  {
+    for( aSelection->Init(); aSelection->More(); aSelection->Next() )
+    {    
 #if OCC_VERSION_LARGE > 0x06080100
-    const Handle(SelectMgr_SensitiveEntity) aHSenEntity = aSelection->Sensitive();
-    if( aHSenEntity.IsNull() )
-      continue;
-    Handle(SelectBasics_SensitiveEntity) aSenEntity = aHSenEntity->BaseSensitive();
+      const Handle(SelectMgr_SensitiveEntity) aHSenEntity = aSelection->Sensitive();
+      if( aHSenEntity.IsNull() )
+        continue;
+      Handle(SelectBasics_SensitiveEntity) aSenEntity = aHSenEntity->BaseSensitive();
 #else
-    Handle(SelectBasics_SensitiveEntity) aSenEntity = aSelection->Sensitive();
+      Handle(SelectBasics_SensitiveEntity) aSenEntity = aSelection->Sensitive();
 #endif
 
-    Handle(Select3D_SensitivePoint) aSenPnt = Handle(Select3D_SensitivePoint)::DownCast( aSenEntity );
-
-    gp_Pnt anOwnerPnt = aSenPnt->Point();
-    Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast( aSenPnt->OwnerId() );
+      Handle(Select3D_SensitivePoint) aSenPnt = Handle(Select3D_SensitivePoint)::DownCast( aSenEntity );
+  
+      gp_Pnt anOwnerPnt = aSenPnt->Point();
+      Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast( aSenPnt->OwnerId() );
 
-
-    CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
-                                                                   aLast = thePoints.end();
-    bool isFound = false;
-    for( int i=0; i<aSize; i++ )
-    {
       bool isIntersect = fabs( aPntsToSelect[i].X() - anOwnerPnt.X() ) < LOCAL_SELECTION_TOLERANCE &&
                          fabs( aPntsToSelect[i].Y() - anOwnerPnt.Y() ) < LOCAL_SELECTION_TOLERANCE;
       if( isIntersect )