]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx
#3514 Move selected point with normal
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / ModelShowNPoints.cxx
index baac364a80e62d4610c0b82ee387a9d15b921240..6deb8aea327a8625eed070b6c9c97eb59a89fa9f 100644 (file)
@@ -8,6 +8,7 @@
 ModelShowNPoints::ModelShowNPoints()
 {
        firsttime=true;
+       currentPoint = -1;
 }
 //----------------------------------------------------------------------
 
@@ -68,6 +69,15 @@ std::vector<std::string> ModelShowNPoints::GetLstLabels()
 void ModelShowNPoints::SetReferencePoint(std::vector<double> ppoint)
 {
        mReferencePoint = ppoint;
+       if(lstPointsX.size() > 0){
+               int idPoint = IdInsidePoint();
+               if(idPoint == -1 && currentPoint >= 0 && currentPoint < lstPointsX.size()){     
+                       currentPoint = currentPoint;
+               }
+               else{
+                       currentPoint = idPoint;
+               }
+       }
 }
 
 //------------------------------------------------------------------------
@@ -428,4 +438,8 @@ void ModelShowNPoints::InversLstPoints()
     } // for i
 }
 
-
+//----------------------------------------------------------------------
+int ModelShowNPoints::GetCurrentPoint()
+{
+       return currentPoint;
+}