}
}
-// ----------------------------------------------------------------------------
-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
{
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 );
+ }
+}
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
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();