TTeeCanvasCalcPoints parameters ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Teodor
Newbie
Newbie
Posts: 1
Joined: Fri Nov 15, 2002 12:00 am
Contact:

TTeeCanvasCalcPoints parameters ?

Post by Teodor » Wed Nov 23, 2005 2:46 pm

Can anybody explain to me the meaning of parameters in TTeeCanvasCalcPoints function (part of TGLCanvas.Surface3D method)?

Teodor

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 28, 2005 3:40 pm

Hi Teodor,

Below you have FastCalcPoints code. Basically, what this method does is calculating a point position in a quicker way considering the previous point position so that the point can be drawn quicker. If this is possible it returns true, otherwise it returns false.

Code: Select all

Function TSurfaceSeries.FastCalcPoints( x,z:Integer;
                                        Var P0,P1:TPoint3D;
                                        Var Color0,Color1:TColor):Boolean;
var tmp0 : TChartValue;
    tmp1 : TChartValue;
begin
  result:=False;
 
  ValueIndex0:=GridIndex[x-1,z];
  if ValueIndex0<>-1 then
  begin
    ValueIndex1:=GridIndex[x,z];
    if ValueIndex1<>-1 then
    begin
      With GetHorizAxis do
      begin
        P0.x:=CalcXPosValue(XValues.Value[ValueIndex0]);
        P1.x:=CalcXPosValue(XValues.Value[ValueIndex1]);
      end;
 
      P0.z:=CalcZPos(ValueIndex0);
      P1.z:=CalcZPos(ValueIndex1);
      tmp0:=YValues.Value[ValueIndex0];
      tmp1:=YValues.Value[ValueIndex1];
 
      With GetVertAxis do
      begin
        P0.y:=CalcYPosValue(tmp0);
        P1.y:=CalcYPosValue(tmp1);
      end;
 
      if not FSameBrush then
      begin
        Color0:=ValueColor[ValueIndex0];
        Color1:=ValueColor[ValueIndex1];
      end;
 
      result:=True;
    end;
  end;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply