Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2427 - Implement Polygon3DConcave canvas function
Summary: Implement Polygon3DConcave canvas function
Status: RESOLVED FIXED
Alias: None
Product: ActiveX TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-24 06:54 EDT by yeray alonso
Modified: 2021-06-02 01:35 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2021-05-24 06:54:48 EDT
In VCL we can use the Polygon3DConcave function to draw polygons. Ie:

uses TeCanvas;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var tmpP: array of TPoint3D;
begin
  SetLength(tmpP, 4);
  tmpP[0]:=Point3D(100,100,0);
  tmpP[1]:=Point3D(150,100,50);
  tmpP[2]:=Point3D(150,150,50);
  tmpP[3]:=Point3D(100,150,0);

  Chart1.Canvas.Polygon3DConcave(tmpP);
end;
Comment 1 yeray alonso 2021-05-24 07:37:28 EDT
Polygon3DConcave doesn't draw the Brush in VCL in OpenGL in some occasions, while Polygon3D still does it correctly. So I'd better implement Polygon3D in ActiveX.

Ie:

uses TeCanvas, TeeGLCanvas;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Canvas:=TGLCanvas.Create;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var tmpP: array of TPoint3D;
begin
  SetLength(tmpP, 5);
  Chart1.Canvas.Brush.Style:=bsSolid;

  tmpP[0]:=Point3D(100,100,0);
  tmpP[1]:=Point3D(150,100,50);
  tmpP[2]:=Point3D(150,150,50);
  tmpP[3]:=Point3D(100,150,0);
  tmpP[4]:=Point3D(100,100,0);

  Chart1.Canvas.Brush.Color:=clRed;
  Chart1.Canvas.Polygon3D(tmpP);

  tmpP[0]:=Point3D(100,100,0);
  tmpP[1]:=Point3D(150,100,50);
  tmpP[2]:=Point3D(150,100,100);
  tmpP[3]:=Point3D(100,100,100);
  tmpP[4]:=Point3D(100,100,0);

  Chart1.Canvas.Brush.Color:=clGreen;
  Chart1.Canvas.Polygon3D(tmpP);
end;
Comment 2 pep jorge 2021-06-02 01:35:48 EDT
The ICanvas.Polygon3D method has been already implemented and it will be available for the next maintenance release that will be out shortly.