1 #include "manualContourModelCircle.h"
3 // ----------------------------------------------------------------------------
4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
7 manualContourModelCircle::manualContourModelCircle()
12 manualContourModelCircle::~manualContourModelCircle()
17 // ----------------------------------------------------------------------------
18 manualContourModelCircle * manualContourModelCircle :: Clone() // virtual
20 manualContourModelCircle * clone = new manualContourModelCircle();
21 CopyAttributesTo(clone);
25 // ---------------------------------------------------------------------------
27 void manualContourModelCircle::CopyAttributesTo( manualContourModelCircle * cloneObject)
30 manualContourModel::CopyAttributesTo(cloneObject);
33 //----------------------------------------------------------------
34 int manualContourModelCircle::GetTypeModel() //virtual
39 //----------------------------------------------------------------
40 void manualContourModelCircle::GetSpline_i_Point(int i, double *x, double *y, double *z) // virtal
42 double angle = _deltaAngle*i;
43 *x = _radio*cos(angle) + _centerX;
44 *y = _radio*sin(angle) + _centerY;
49 // ---------------------------------------------------------------------------
50 void manualContourModelCircle::UpdateSpline() // virtal
52 manualPoint *mpA,*mpB;
54 int np = GetSizeLstPoints( );
55 int nps = GetNumberOfPointsSpline();
56 _deltaAngle=(3.14159265*2)/(nps-1);
59 mpA = GetManualPoint(0);
60 mpB = GetManualPoint(1);
61 difX = mpA->GetX() - mpB->GetX();
62 difY = mpA->GetY() - mpB->GetY();
63 _radio = sqrt( difX*difX + difY*difY );
64 _centerX = mpA->GetX();
65 _centerY = mpA->GetY();
66 _centerZ = mpA->GetZ();