Page 1 of 1

Questions about solid circle

Posted: 14 Oct 2011, 00:04
by nicolasjul
Hi,

First question :
I draw my solid circle like that :

Code: Select all

TsgCADCurvePolygon *vSolidCircle = new TsgCADCurvePolygon;
Tsg2DBoundaryList *v2DBList = new Tsg2DBoundaryList;
((TsgCADHatch *)vSolidCircle)->BoundaryData->Add(v2DBList);
Tsg2DArc *v2DArc = new Tsg2DArc;
v2DBList->Add(v2DArc);
v2DArc->CenterPoint = MakeF2DPoint(CentreCercle.X, CentreCercle.Y);
v2DArc->Radius = 300;
v2DArc->CounterClockWise = true;
v2DArc->StartParam = 0.0;
v2DArc->EndParam = 360.0;

TsgDXFEntity *FEnt = vSolidCircle;

if (FEnt != NULL)
{
   FEnt->Layer = img->Converter->LayerByName(D900_LAYER);
   AddEntity(img->Converter, FEnt);
   img->GetExtents();
}

Is it the best method ?

Second question : is it possible to change solid circle radius and position (not move with mouse) on runtime ?

TIA,
Engi

Re: Questions about solid circle

Posted: 14 Oct 2011, 17:35
by support
Hello Engi.
The method that you have used is correct. The radius and position can be changed on runtime:

Code: Select all

		((Tsg2DArc *)(((Tsg2DBoundaryList *)(vSolidCircle->BoundaryData->Items[0]))->Items[0]))->Radius = 100;
		((Tsg2DArc *)(((Tsg2DBoundaryList *)(vSolidCircle->BoundaryData->Items[0]))->Items[0]))->CenterPoint = MakeF2DPoint(CentreCercle.X + 50, CentreCercle.Y + 50);
		img->Converter->Loads(vSolidCircle);
		img->GetExtents();
Alexander.

Re: Questions about solid circle

Posted: 14 Oct 2011, 18:34
by nicolasjul
Hi Alexander,

Fast answer and it works great.
Thank you very much !!!