]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx
#3504 Integer to double ShowNpoints
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / WidgetShowNPoints.cxx
index 7aba88abfcd0005e85584e704f8cb52c075c1048..1ae46a5f5126fa414c434fd2df7674e10dd22c88 100644 (file)
@@ -506,7 +506,7 @@ void WidgetShowNPoints::AddVtkPoint()
 
 
 //------------------------------------------------------------------------
-void WidgetShowNPoints::AddPoint(int x, int y, int z, std::string label)
+void WidgetShowNPoints::AddPoint(double x, double y, double z, std::string label)
 {
        GetModelShowNPoints()->AddPoint(x,y,z, label );
     // EED 2022-05-19
@@ -516,7 +516,7 @@ void WidgetShowNPoints::AddPoint(int x, int y, int z, std::string label)
 }
 
 //------------------------------------------------------------------------
-void WidgetShowNPoints::InsertPoint(int x, int y, int z, std::string label)//CFT
+void WidgetShowNPoints::InsertPoint(double x, double y, double z, std::string label)//CFT
 {
     // EED 2022-05-19
        //if ( GetModelShowNPoints()->InsertPoint(x,y,z,label) != -1 )
@@ -547,7 +547,7 @@ void WidgetShowNPoints::OnInsertPoint_()
     {
         return;
     }
-    std::vector<int> point = GetModelShowNPoints()->GetReferencePoint();
+    std::vector<double> point = GetModelShowNPoints()->GetReferencePoint();
     if (point.size()==3)
     {
         InsertPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) );
@@ -573,7 +573,7 @@ void WidgetShowNPoints::OnAddPoint__()
        {
                return;
        }
-       std::vector<int> point = GetModelShowNPoints()->GetReferencePoint();
+       std::vector<double> point = GetModelShowNPoints()->GetReferencePoint();
        if (point.size()==3)
        {
                AddPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) );
@@ -954,7 +954,7 @@ void WidgetShowNPoints::UpdatePoints(wxCommandEvent &event)
 }
 
 //------------------------------------------------------------------------
-void  WidgetShowNPoints::SetReferencePoint(std::vector<int> point)
+void  WidgetShowNPoints::SetReferencePoint(std::vector<double> point)
 {
        GetModelShowNPoints()->SetReferencePoint(point);
     int i,size=lstModelShowNPoints.size();
@@ -965,7 +965,7 @@ void  WidgetShowNPoints::SetReferencePoint(std::vector<int> point)
 }
 
 //------------------------------------------------------------------------
-void  WidgetShowNPoints::SetInitLstPoints( std::vector<int> initLstPointsX,  std::vector<int> initLstPointsY, std::vector<int> initLstPointsZ, std::vector<std::string> initLstLabels )
+void  WidgetShowNPoints::SetInitLstPoints( std::vector<double> initLstPointsX,  std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels )
 {
     // EED 2022-05-19
        //if (this->renderer==NULL)
@@ -978,7 +978,7 @@ void  WidgetShowNPoints::SetInitLstPoints( std::vector<int> initLstPointsX,  std
        sizeY = (int)initLstPointsY.size();
        sizeZ = (int)initLstPointsZ.size();
        sizeLabels = (int)initLstLabels.size();
-       int x,y,z;
+       double x,y,z;
        std::string label;
        if ( (sizeX==sizeY) && (sizeX==sizeZ) )
        {
@@ -1363,7 +1363,7 @@ void WidgetShowNPoints::OnLoadCollections(wxCommandEvent &event)
 //------------------------------------------------------------------------
 void WidgetShowNPoints::GetCollectionPoint(int idCol,int idPoint, double *pPoint)
 {
-    int x,y,z;
+    double x,y,z;
     lstModelShowNPoints[idCol]->GetIdPoint(idPoint,&x,&y,&z);
     pPoint[0] = x;
     pPoint[1] = y;
@@ -1373,24 +1373,27 @@ void WidgetShowNPoints::GetCollectionPoint(int idCol,int idPoint, double *pPoint
 void WidgetShowNPoints::SetCollectionPoint(int idCol, int idPoint, std::vector<double> modPoint)
 {
        if(idCol >= 0 && idCol < lstModelShowNPoints.size())
+       {
                lstModelShowNPoints[idCol]->SetPointById(idPoint, modPoint);
+               lstViewShowNPoints[idCol]->RefreshPoint(idPoint);
+       }
        else{
                printf("WidgetShowNPoints::SetCollectionPoint  ...Error... Invalid collection, out of range");
        }
 }
 //------------------------------------------------------------------------
-std::vector<int> WidgetShowNPoints::GetLstPointsX()
+std::vector<double> WidgetShowNPoints::GetLstPointsX()
 {
     if (mtype!=4)
     {
         return GetModelShowNPoints()->GetLstPointsX();
     } else {
-        std::vector<int> lst;
+        std::vector<double> lst;
         int iP,s;
         int iG,sG=lstModelShowNPoints.size();
         for (iG=0 ; iG<sG ; iG++)
         {
-            std::vector<int> lstTmp = lstModelShowNPoints[iG]->GetLstPointsX();
+            std::vector<double> lstTmp = lstModelShowNPoints[iG]->GetLstPointsX();
             s = lstTmp.size();
             for (iP=0 ; iP<s ; iP++)
             {
@@ -1402,18 +1405,18 @@ std::vector<int> WidgetShowNPoints::GetLstPointsX()
 }
 
 //------------------------------------------------------------------------
-std::vector<int> WidgetShowNPoints::GetLstPointsY()
+std::vector<double> WidgetShowNPoints::GetLstPointsY()
 {
     if (mtype!=4)
     {
         return GetModelShowNPoints()->GetLstPointsY();
     } else {
-        std::vector<int> lst;
+        std::vector<double> lst;
         int iP,s;
         int iG,sG=lstModelShowNPoints.size();
         for (iG=0 ; iG<sG ; iG++)
         {
-            std::vector<int> lstTmp = lstModelShowNPoints[iG]->GetLstPointsY();
+            std::vector<double> lstTmp = lstModelShowNPoints[iG]->GetLstPointsY();
             s = lstTmp.size();
             for (iP=0 ; iP<s ; iP++)
             {
@@ -1425,18 +1428,18 @@ std::vector<int> WidgetShowNPoints::GetLstPointsY()
 }
 
 //------------------------------------------------------------------------
-std::vector<int> WidgetShowNPoints::GetLstPointsZ()
+std::vector<double> WidgetShowNPoints::GetLstPointsZ()
 {
     if (mtype!=4)
     {
         return GetModelShowNPoints()->GetLstPointsZ();
     } else {
-        std::vector<int> lst;
+        std::vector<double> lst;
         int iP,s;
         int iG,sG=lstModelShowNPoints.size();
         for (iG=0 ; iG<sG ; iG++)
         {
-            std::vector<int> lstTmp = lstModelShowNPoints[iG]->GetLstPointsZ();
+            std::vector<double> lstTmp = lstModelShowNPoints[iG]->GetLstPointsZ();
             s = lstTmp.size();
             for (iP=0 ; iP<s ; iP++)
             {