Hi,
I try to edit and make change an existing Polygon. After clearing existing XY info and add new XY point using AddXY() function.
But, I could not find a function from IMapPolygon like Series->Clear(). What I want to do is something like this:
void EditPolygon(IMapPolygonPtr tPolygon)
{
tPolygon->Clear();
tPolgyon->AddXY(1,2); tPolgyon->AddXY(2,4); tPolygon->AddXY(1,2);
}
Is there any other way to do this or is this impossible?
Dongsu
Clear IMapPolygonPtr
Re: Clear IMapPolygonPtr
Hi Dongsu,
In VCL the polygons are accessible but not yet in the ActiveX version. In VCL you can do this:
I've added this to the wish list to be implemented in a future release (TA05014921) so something like this would be possible: TChart1.Series(0).asMap.Polygon(0)...
In VCL the polygons are accessible but not yet in the ActiveX version. In VCL you can do this:
Code: Select all
var Series1: TMapSeries;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1:=Chart1.AddSeries(TMapSeries.Create(self)) as TMapSeries;
Series1.FillSampleValues(1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Series1.Polygon[0].AddXY(0,9);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Clear IMapPolygonPtr
Hi Yeray,
Thank you for your answer. But in the ActiveX, I was able to access Polygons of a MapSeries and added points (X,Y).
The following is a sample code to create and access polygon. My question was "is it possible to clear a polygon to reuse it?".
In other words, "is it possible to delete (X,Y) points of existing polygon?"
BOOL DrawPolygon(IMapSeriesPtr PolygonSeries, const Array<PointD> &vBoundary, OLE_COLOR setColor)
{
if(vBoundary.Size()<3) return FALSE;
long nPolygon = PolygonSeries->Shapes->Add();
IMapPolygonPtr tPolygon = PolygonSeries->Shapes->Polygon[nPolygon];
tPolygon->Color = setColor;
tPolygon->Z=0;
tPolygon->Transparency = 90;
for(int i=0; i<vBoundary.Size(); i++)
tPolygon->AddXY(vBoundary.At(i).x, vBoundary.At(i).y);
tPolygon->AddXY(vBoundary.At(0).x, vBoundary.At(0).y);
return TRUE;
}
Dongsu
Thank you for your answer. But in the ActiveX, I was able to access Polygons of a MapSeries and added points (X,Y).
The following is a sample code to create and access polygon. My question was "is it possible to clear a polygon to reuse it?".
In other words, "is it possible to delete (X,Y) points of existing polygon?"
BOOL DrawPolygon(IMapSeriesPtr PolygonSeries, const Array<PointD> &vBoundary, OLE_COLOR setColor)
{
if(vBoundary.Size()<3) return FALSE;
long nPolygon = PolygonSeries->Shapes->Add();
IMapPolygonPtr tPolygon = PolygonSeries->Shapes->Polygon[nPolygon];
tPolygon->Color = setColor;
tPolygon->Z=0;
tPolygon->Transparency = 90;
for(int i=0; i<vBoundary.Size(); i++)
tPolygon->AddXY(vBoundary.At(i).x, vBoundary.At(i).y);
tPolygon->AddXY(vBoundary.At(0).x, vBoundary.At(0).y);
return TRUE;
}
Dongsu
Re: Clear IMapPolygonPtr
Hi Dongsu,
You are right. Excuse my mistake.
I've seen that in VCL it is possible to do it as follows:
So I've changed the [TA05014921] ticket. Now it asks for the inclusion of something similar to the code above in the ActiveX version.
You are right. Excuse my mistake.
I've seen that in VCL it is possible to do it as follows:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues();
with Series1.Shapes.Add do
begin
Color:=clYellow;
Z:=0;
AddXY(0, 0);
AddXY(5, 2);
AddXY(4, 6);
AddXY(2, 8);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var PolygonIndex, PointIndex: Integer;
begin
PolygonIndex:=Series1.Shapes.Count-1;
PointIndex:=Series1.Shapes.Polygon[PolygonIndex].Points.Count-1;
Series1.Shapes.Polygon[PolygonIndex].Points.Delete(PointIndex);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Clear IMapPolygonPtr
Hi Yeray,
Thank you for your answer. Do you think it is possible to update this function in ActiveX and release the new version of it very soon?
Otherwise, I have to change code a lot due to this issue.
Dongsu
Thank you for your answer. Do you think it is possible to update this function in ActiveX and release the new version of it very soon?
Otherwise, I have to change code a lot due to this issue.
Dongsu
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Clear IMapPolygonPtr
Hi Dongsu,
I don't think it should be complicated but I can't provide any estimate date at the present moment. I recommend you to be aware at the forums, website or subscribe to our RSS news feed for new release announcements and what's fixed/implemented on them.
I don't think it should be complicated but I can't provide any estimate date at the present moment. I recommend you to be aware at the forums, website or subscribe to our RSS news feed for new release announcements and what's fixed/implemented on them.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |