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

Summary: Implement Polygon3DConcave canvas function
Product: ActiveX TeeChart Reporter: yeray alonso <yeray>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement CC: pep
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

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.