]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourModel.cpp
index 4318e0fbb24e3a3e569574739ce7edef8d426468..e633546c7adda385aa082dbaac4356b0093ca1b4 100644 (file)
@@ -620,64 +620,6 @@ void manualContourModel::Open(FILE *ff) // virtual
        }
 }
 
-// ----------------------------------------------------------------------------
-void manualContourModel::OpenAndTransformSpacing(FILE *ff, double imgSpac[3], double roiSpac[3]) // virtual
-{
-       char tmp[255];
-       int i;
-       int numberOfControlPoints;
-       double x,y,z;
-
-       double transX, transY;
-       transX = (double) roiSpac[0]/imgSpac[0];
-       transY = (double) roiSpac[1]/imgSpac[1];
-
-       fscanf(ff,"%s",tmp); // NumberOfControlPoints
-       fscanf(ff,"%s",tmp); // ##
-       numberOfControlPoints = atoi(tmp);
-       for (i=0;i<numberOfControlPoints;i++)
-       {
-               fscanf(ff,"%s",tmp); // X
-               x = atof(tmp);
-               x = x*transX;
-               fscanf(ff,"%s",tmp); // Y
-               y = atof(tmp);
-               y = y*transY;
-               fscanf(ff,"%s",tmp); // Z
-               z = atof(tmp);
-               AddPoint(x,y,z);
-       }
-}
-
-// ----------------------------------------------------------------------------
-void manualContourModel::OpenAndTransformDimension(FILE *ff, int imgDim[3], int roiDim[3]) // virtual
-{
-       char tmp[255];
-       int i;
-       int numberOfControlPoints;
-       double x,y,z;
-
-       double transX, transY;
-       transX = (double) imgDim[0]/roiDim[0];
-       transY = (double) imgDim[1]/roiDim[1];
-
-       fscanf(ff,"%s",tmp); // NumberOfControlPoints
-       fscanf(ff,"%s",tmp); // ##
-       numberOfControlPoints = atoi(tmp);
-       for (i=0;i<numberOfControlPoints;i++)
-       {
-               fscanf(ff,"%s",tmp); // X
-               x = atof(tmp);
-               x = x*transX;
-               fscanf(ff,"%s",tmp); // Y
-               y = atof(tmp);
-               y = y*transY;
-               fscanf(ff,"%s",tmp); // Z
-               z = atof(tmp);
-               AddPoint(x,y,z);
-       }
-}
-
 // ----------------------------------------------------------------------------
 int manualContourModel::GetTypeModel() //virtual
 {
@@ -736,3 +678,19 @@ std::vector<manualContourModel*> manualContourModel::ExploseModel(  )
        lstTmp.push_back(this);
        return lstTmp;
 }
+
+
+// ----------------------------------------------------------------------------
+void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
+{
+       ManualPoint * mp;
+       int i, size = GetSizeLstPoints();
+
+       for( i=0; i<size; i++ )
+       {
+               mp = GetManualPoint( i );
+
+               mp->SetPointX( mp->GetX()*Ax + Bx );
+               mp->SetPointY( mp->GetY()*Ay + By );
+       }
+}