]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authordonadio <donadio>
Fri, 5 Jun 2009 17:29:24 +0000 (17:29 +0000)
committerdonadio <donadio>
Fri, 5 Jun 2009 17:29:24 +0000 (17:29 +0000)
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h

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 );
+       }
+}
index 28493954eadb982e93ae7aa41966c5cd161be363..4cb8cb995f7d48ca960b47ffeb339ed5f370024f 100644 (file)
@@ -46,8 +46,6 @@ public:
        virtual manualContourModel * Clone();
        void CopyAttributesTo( manualContourModel *cloneObject );
        virtual void Open(FILE *ff);    // virtual
-       virtual void OpenAndTransformSpacing(FILE *ff, double imgSpac[3], double roiSpac[3]);
-       virtual void OpenAndTransformDimension(FILE *ff, int imgDim[3], int roiDim[3]);
        virtual void Save(FILE *ff);    // virtual
        virtual int GetTypeModel();                     // virtual 
 
@@ -57,6 +55,7 @@ public:
        void                    InsertPoint_id(int id, double x,double y,double z);
 //---------------------------------------------------------------------
        void                    AddManualPoint( manualPoint* theManualPoint );
+       void                    Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
 
        void                    DeletePoint(int i);
        void                    DeleteAllPoints();