1 #include "manualContourModelBullEyeSector.h"
4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
6 // ----------------------------------------------------------------------------
8 manualContourModelBullEyeSector::manualContourModelBullEyeSector()
13 manualContourModelBullEyeSector::~manualContourModelBullEyeSector()
18 // ----------------------------------------------------------------------------
19 manualContourModelBullEyeSector * manualContourModelBullEyeSector :: Clone() // virtual
21 manualContourModelBullEyeSector * clone = new manualContourModelBullEyeSector();
22 CopyAttributesTo(clone);
26 // ---------------------------------------------------------------------------
28 void manualContourModelBullEyeSector::CopyAttributesTo( manualContourModelBullEyeSector * cloneObject)
31 manualContourModel::CopyAttributesTo(cloneObject);
34 //----------------------------------------------------------------
35 int manualContourModelBullEyeSector::GetTypeModel() //virtual
41 //----------------------------------------------------------------
42 void manualContourModelBullEyeSector::SetSector( double radioA,
49 _ang = ang*3.14159265/180.0;
50 _angDelta = angDelta*3.14159265/180.0;
53 //----------------------------------------------------------------
54 void manualContourModelBullEyeSector::GetSector(
63 *angDelta = _angDelta;
66 // ----------------------------------------------------------------------------
67 void manualContourModelBullEyeSector::SetCenter(double cx,double cy)
73 //----------------------------------------------------------------
74 void manualContourModelBullEyeSector::SetSize(double ww,double hh)
80 //----------------------------------------------------------------
81 void manualContourModelBullEyeSector::GetSpline_i_Point(int i, double *x, double *y, double *z)
87 double ang,angcos, angsin;
90 nps = GetNumberOfPointsSpline() - 3;
92 if (i==GetNumberOfPointsSpline()-1)
105 ang = ((double)ii/(nps/2))*_angDelta + _ang;
109 *x = _ww*radio*angcos + _cx;
110 *y = _hh*radio*angsin + _cy;
114 //----------------------------------------------------------------
115 void manualContourModelBullEyeSector::Save(FILE *ff) // virtual
117 manualContourModel::Save(ff);
118 fprintf(ff,"rA= %f rB= %f ang= %f deltaAng= %f\n", _radioA,_radioB, _ang , _angDelta);
121 //----------------------------------------------------------------
122 void manualContourModelBullEyeSector::Open(FILE *ff) // virtual
125 fscanf(ff,"%s",tmp); // TypeModel
126 fscanf(ff,"%s",tmp); // ##
128 manualContourModel::Open(ff);
131 fscanf(ff,"%s",tmp); // radioA=
132 fscanf(ff,"%s",tmp); // radioA
135 fscanf(ff,"%s",tmp); // radioB=
136 fscanf(ff,"%s",tmp); // radioB
139 fscanf(ff,"%s",tmp); // ang=
140 fscanf(ff,"%s",tmp); // ang
143 fscanf(ff,"%s",tmp); // deltaAng=
144 fscanf(ff,"%s",tmp); // deltaAng
145 _angDelta = atof(tmp);