Questions about solid circle

If you have any comments or questions about our developing tools, please do not hesitate to contact us at this forum

Moderators: admin, SDS, support

Questions about solid circle

Postby nicolasjul » 13 Oct 2011, 21:04

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
nicolasjul
 
Posts: 10
Joined: 21 Apr 2011, 14:36
Location: FRANCE

Re: Questions about solid circle

Postby support » 14 Oct 2011, 14:35

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.
Please post questions to the forum or write to support@cadsofttools.com
support
 
Posts: 2230
Joined: 30 Mar 2005, 08:36
Location: Russia

Re: Questions about solid circle

Postby nicolasjul » 14 Oct 2011, 15:34

Hi Alexander,

Fast answer and it works great.
Thank you very much !!!
nicolasjul
 
Posts: 10
Joined: 21 Apr 2011, 14:36
Location: FRANCE


Return to CADImportVCL + DXFExportVCL

Who is online

Users browsing this forum: No registered users and 0 guests

cron