亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sgr_data.pas

?? 一個delphi的好用的畫二維曲線的控件Simple Graph v2.3
?? PAS
?? 第 1 頁 / 共 3 頁
字號:
unit sgr_data;
{(c) S.P.Pod'yachev 1998-1999}
{ver. 2.3 28.10.1999}
{***************************************************}
{ Example of series for Tsp_xyPlot                  }
{                                                   }
{***************************************************}

interface
uses
  Windows, SysUtils,  Classes,  Graphics,
  sgr_scale, sgr_def;

Type

{*** Tsp_XYDataSeries ***}

//ancestor of my data series
//has storage for x, y data and maintains main method & properties for it
Tsp_XYDataSeries=class(Tsp_DataSeries)
protected
  //canvas where draw
  fCanvas:TCanvas;
  //capacity & points number service
  fPN:integer;        //number of valid data elements (x,y points)
  fCapacity:integer;  //reserved memory in number of data elements
  fInc:integer;       //step of expand increment of allocated memory
  //
  XV: Variant;        //storage for X values
  YV: Variant;        //storage for Y values
  //Max Min service
  XMin,XMax,            //Min & Max of data
  YMin,YMax: double;
  ValidMinMax:boolean;  //used to minimise MinMax calculating
  //Draw attributes
  fLineAttr:Tsp_LineAttr; //line attribute
  //control service
  fLockInvalidate:boolean; //lock invalidate plot while data are changing

  //if can invalidate Plot then return True
  function CanPlot:boolean;
  //if it is possible then immediately redraw plot to reflect changes
  procedure TryUpdatePlot;
  //used in several procedures when data are added
  procedure TryUpdateMinMax(aX,aY:double);

  //increase allocated memory size by fInc
  procedure Expand;
  //increase allocated memory size by IncSize
  procedure ExpandBy(IncSize:integer);
  //find Min & Max of data of series;
  procedure FindMinMax;
  //stop invalidate or force invalidate plot
  procedure SetLockInvalidate(const V:boolean);
  //attributes change
  procedure SetLineAttr(const V:Tsp_LineAttr);
  procedure AtrributeChanged(V:TObject); virtual;

public //Tsp_XYDataSeries
  constructor Create(AOwner:TComponent); override;
  destructor Destroy; override;
  //next 4 functions must be implemented for any series
  function GetXMin(var V:double):boolean; override;
  function GetXMax(var V:double):boolean; override;
  function GetYMin(var V:double):boolean; override;
  function GetYMax(var V:double):boolean; override;
  //this one does not clear memory, only set Count=0 and update Plot,
  //use AdjustCapacity after Clear, or SetCapacity(0) instead of Clear to free memory
  procedure Clear;
  //set minimum Capacity for current Count
  procedure AdjustCapacity;
  //use it if you know how many elements data will have and don't want to loose
  //time on auto expand when add data. If series is not empty and C less then
  //Count of data elements they will be truncated to fit capacity
  procedure SetCapacity(C:integer);
  //add values at the end of series data and update Plot
  procedure AddXY(aX,aY:double);
  //used to add many values at the end of series data and update Plot
  //pX, pY must points to array of double, n - number of elements in arrays
  procedure AddXYArrays(pX,pY:pointer; n:integer);
  //insert values at index i, shift rest to end
  procedure InsertXY(i:integer; aX,aY:double);
  //replace values at index i
  procedure ReplaceXY(i:integer; aX,aY:double);
  //Delete values at index i
  procedure Delete(i:integer);
  //Delete values with indexes from fromi up to toi
  procedure DeleteRange(fromi, toi:integer);
  //current memory allocation for data elements (for example number of points)
  property Capacity:integer read fCapacity;
  //current number of valid data elements (for example number of points)
  property Count:integer read fPN;
  //lock invalidate plot while data are changing and then unlock it
  property LockInvalidate:boolean read fLockInvalidate write setLockInvalidate;
  //
  property Canvas:TCanvas read fCanvas write fCanvas;
published
  //if True then series is visible and taken into account in AutoMin & AutoMax
  property Active default True;
end;


{*** Type for series points drawing ***}

TPointKind=(ptRectangle, ptEllipse, ptDiamond, ptCross, ptCustom,
            ptTriangle, ptDownTriangle);

{*** Tsp_PointAttr ***}

//holds points markers properties
Tsp_PointAttr=class(TBrush)
private
  fPointType:TPointKind;
  fHSize,  fVSize :integer;  //even half of horiz. & vert. point size
  fHSize1, fVSize1:integer;  //odd half of horiz. & vert. point size
  fVisible: boolean;
  fBorderWidth:integer;
  fBorderColor:TColor;
protected
  procedure SetType(const V:TPointKind);
  procedure SetVisible(const V:boolean);
  procedure SetHSize(V:integer);
  procedure SetVSize(V:integer);
  function  GetHSize:integer;
  function  GetVSize:integer;
  procedure SetBorderWidth(V:integer);
  procedure SetBorderColor(const V:TColor);
public
  constructor Create;
  procedure SetPenAttr(const APen:TPen);
  procedure Assign(Source: TPersistent); override;
  property eHSize:integer read fHSize;
  property oHSize:integer read fHSize1;
  property eVSize:integer read fVSize;
  property oVSize:integer read fVSize1;
  //is points are drawn
published
  //kind of point
  property Kind:TPointKind read fPointType write SetType;
  //horizontal size of Point
  property HSize:integer read GetHSize write SetHSize default 5;
  //vertical size of Point
  property VSize:integer read GetVSize write SetVSize default 5;
  //is points are drawn
  property Visible:boolean read fVisible write SetVisible;
  //points border width (pen)
  property BorderWidth:integer read fBorderWidth write SetBorderWidth default 1;
  //points border color (pen)
  property BorderColor:TColor read fBorderColor write SetBorderColor default clBlack;
end;

//type of darw point procedure
TDrawPointProc=procedure (const x, y: Integer) of object;

Tsp_XYLine=class;

//event to draw custom points
TDrawCustomPointEvent=procedure
(const XYLine:Tsp_XYLine; const xv,yv :double; x, y: Integer) of object;

{*** Tsp_XYLine ***}

//draw data as points and/or chain of line segments
Tsp_XYLine=class(Tsp_XYDataSeries)
protected
  fPA:Tsp_PointAttr;
  fDLM:boolean; //DrawingLegendMarker
  DrawPointProc:TDrawPointProc;
  fOnDrawCustomPoint:TDrawCustomPointEvent;
  procedure SetPointAttr(const V:Tsp_PointAttr);
  procedure AtrributeChanged(V:TObject); override;
  procedure DrawRect(const x, y: Integer);
  procedure DrawEllipse(const x, y: Integer);
  procedure DrawDiamond(const x, y: Integer);
  procedure DrawCross(const x, y: Integer);
  procedure DrawTriangle(const x, y: Integer);
  procedure DrawDownTriangle(const x, y: Integer);
public
  constructor Create(AOwner:TComponent); override;
  destructor Destroy; override;
  //implements series draw procedure
  procedure Draw; override;
  //implements series draw marker procedure
  procedure DrawLegendMarker(const LCanvas:TCanvas; MR:TRect); override;
  //add values at end like AddXY, but don't spend time to update Plot, instead
  //simply draw next line segment, therefore AutoMin and AutoMax are ignored
  procedure QuickAddXY(aX,aY:double); virtual;
  //to access to data
  function GetX(i:integer):double;
  function GetY(i:integer):double;
  property DrawingLegendMarker:boolean read fDLM; //true when DrawLegendMarker
published
  //defines is draw & how lines segments between points
  property LineAttr:Tsp_LineAttr read fLineAttr write SetLineAttr;
  //defines is draw & how lines points marker
  property PointAttr:Tsp_PointAttr read fPA write SetPointAttr;
  //if assigned caled to draw point with Kind=ptCustom
  property OnDrawCustomPoint:TDrawCustomPointEvent read fOnDrawCustomPoint
                                                   write fOnDrawCustomPoint;
end;


{*** Tsp_SpectrLines ***}

Tsp_SpectrLines=class;

Tsp_YOrigin=(yoBaseLine, yoXAxises);

Tsp_WhatValues=(wvXValues, wvYValues);

Tsp_GetLabelEvent=procedure(Sender: Tsp_SpectrLines;
                         Num: integer;  //point number
                         X, Y : double; //points values
                         var LS:string) of object;   //label string

//draw data as bar with center at XV pos. and height from Bottom
//axis to YV or from BaseLine to YV;
Tsp_SpectrLines=class(Tsp_XYDataSeries)
private
  fBaseValue:double;
  fYOrigin:Tsp_YOrigin;
  fOnGetLabel: Tsp_GetLabelEvent; //customize label format handler
  fLabelFormat: string;       //format string for line label
  fLFont:TFont;               //label font
  fLVisible:boolean;          //is label visible
  fWhatValues:Tsp_WhatValues; //what values x or y use for label
  fBLVisible:boolean;         //is base line visible
  procedure SetBaseValue(V:double);
  procedure SetYOrigin(V:Tsp_YOrigin);
  procedure SetWhatValues(V:Tsp_WhatValues);
  procedure SetLabelFormat(const V:string);
  procedure SetLFont(V:TFont);
  procedure SetLVisible(const V:boolean);
  procedure SetBLVisible(const V:boolean);
public
  constructor Create(AOwner:TComponent); override;
  destructor Destroy; override;
  procedure Draw;override;
  function GetYMin(var V:double):boolean; override;
  function GetYMax(var V:double):boolean; override;
published
  //if YOrigin=yoBaseLine then lines begin from BaseValue
  property BaseYValue:double read fBaseValue write SetBaseValue;
  //define how lines are drawn
  property LineAttr:Tsp_LineAttr read fLineAttr write SetLineAttr;
  //if YOrigin=yoBaseLine then lines begin from BaseValue else from X Axis
  property YOrigin:Tsp_YOrigin read fYOrigin write SetYOrigin;
  //define X or Y values used in labels near spectral line
  property LabelValues:Tsp_WhatValues read fWhatValues write SetWhatValues;
  //format string to convert values to label text (template for FloatToStrF)
  property LabelFormat: string read fLabelFormat write SetLabelFormat;
  property LabelFont:TFont read fLFont write SetLFont;
  //show or not value label near line
  property ShowLabel:boolean read fLVisible write SetLVisible;
  //draw horizontal line at BaseYValue
  property ShowBaseLine:boolean read fBLVisible write SetBLVisible default True;
  //customize label format handler
  property OnGetLabel: Tsp_GetLabelEvent read fOnGetLabel write fOnGetLabel;
end;


IMPLEMENTATION

Type
 TDbls=array [0..MaxInt div 16] of double;
 pDbls= ^TDbls;
 TLP=array[0..MaxInt div 16] of TPoint;
 pLP= ^TLP;


{*** Tsp_XYDataSeries ***}

constructor Tsp_XYDataSeries.Create(AOwner:TComponent);
begin
 inherited Create(AOwner); 
 fInc:=32;
 XV:=VarArrayCreate([0, fInc], varDouble);
 YV:=VarArrayCreate([0, fInc], varDouble);
 fCapacity:=VarArrayHighBound(XV,1);
 fPN:=0;
 XMin:=5.0E-324; XMax:=1.7E308;
 YMin:=5.0E-324; YMax:=1.7E308;
 ValidMinMax:=False;
 fActive:=True;
 if csDesigning in ComponentState then
   while fPN<10 do AddXY(fPN, 1+2*(fPN mod 5)+Random(2));
 fLineAttr:=Tsp_LineAttr.Create;
 fLockInvalidate:=False;
 fLineAttr.OnChange:=AtrributeChanged;
end;

destructor Tsp_XYDataSeries.Destroy;
begin
 if Assigned(fLineAttr) then
 begin
   fLineAttr.OnChange:=nil;
   fLineAttr.Free
 end;
 inherited;
end;

function Tsp_XYDataSeries.CanPlot:boolean;
begin
 Result:=Not(fLockInvalidate) and Assigned(Plot);
end;

procedure Tsp_XYDataSeries.TryUpdatePlot;
begin
 if Not(fLockInvalidate) and Assigned(Plot) then
 begin
   InvalidatePlot(rsDataChanged);
   Plot.Update;                //call to redraw immediately
 end;
end;

procedure Tsp_XYDataSeries.TryUpdateMinMax(aX,aY:double);
begin
 if fPN=0 then begin
   XMin:=aX; XMax:=aX;
   YMin:=aY; YMax:=aY;
   ValidMinMax:=True;
 end
 else if ValidMinMax then begin
   if aX<XMin then XMin:=aX
   else if aX>XMax then XMax:=aX;
   if aY<YMin then YMin:=aY
   else if aY>YMax then YMax:=aY;
 end;
end;

procedure Tsp_XYDataSeries.Expand;
begin
 VarArrayRedim(XV, fCapacity+fInc);
 VarArrayRedim(YV, fCapacity+fInc);
 fCapacity:=VarArrayHighBound(XV,1);
end;

procedure Tsp_XYDataSeries.ExpandBy(IncSize:integer);
begin
 IncSize:=((IncSize div fInc)+1)*fInc;
 VarArrayRedim(XV, fCapacity+IncSize);
 VarArrayRedim(YV, fCapacity+IncSize);
 fCapacity:=VarArrayHighBound(XV,1);
end;

procedure Tsp_XYDataSeries.FindMinMax;
var pdX, pdY:pDbls; j:integer;
begin
 if fPN<1 then Exit;  //Exception
 pdX:=VarArrayLock(XV);
 pdY:=VarArrayLock(YV);
 try
  XMin:=pdX^[0]; XMax:=XMin;
  YMin:=pdY^[0]; YMax:=YMin;
  for j:=1 to fPN-1 do begin
    if pdX[j]<XMin then XMin:=pdX[j]
    else if pdX[j]>XMax then XMax:=pdX[j];
    if pdY[j]<YMin then YMin:=pdY[j]
    else if pdY[j]>YMax then YMax:=pdY[j];
  end;
  ValidMinMax:=True;
 finally
  VarArrayUnlock(YV);
  VarArrayUnlock(XV);
 end;
end;

procedure Tsp_XYDataSeries.SetLockInvalidate(const V:boolean);
begin
 if fLockInvalidate<>V then
 begin
   fLockInvalidate:=V;
   if CanPlot then InvalidatePlot(rsDataChanged)
 end;
end;

procedure Tsp_XYDataSeries.SetLineAttr(const V:Tsp_LineAttr);
begin
 if Not fLineAttr.IsSame(V) then begin
   fLineAttr.Assign(V);
 end;
end;

procedure Tsp_XYDataSeries.AtrributeChanged;
begin
 if CanPlot then InvalidatePlot(rsAttrChanged);
end;

//*******

function Tsp_XYDataSeries.GetXMin;
begin
 Result:=Count>0;
 if Result then
 begin

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩不卡一区二区| 国产丝袜美腿一区二区三区| 日韩免费性生活视频播放| 中文字幕欧美区| 男女男精品视频| 日本黄色一区二区| 日本一区二区三区免费乱视频 | 91成人免费在线| 久久久久青草大香线综合精品| 亚洲精品你懂的| 国产成人综合亚洲网站| 91精品中文字幕一区二区三区| 国产精品白丝在线| 国产一区激情在线| 欧美精品自拍偷拍| 悠悠色在线精品| 成人av片在线观看| 久久免费美女视频| 玖玖九九国产精品| 在线成人av影院| 玉米视频成人免费看| 91一区二区在线观看| 久久毛片高清国产| 精品系列免费在线观看| 制服视频三区第一页精品| 亚洲丰满少妇videoshd| 一本色道久久综合精品竹菊| 国产精品妹子av| 国产成人三级在线观看| 久久久777精品电影网影网| 男人操女人的视频在线观看欧美| 欧美日韩精品欧美日韩精品| 亚洲综合丝袜美腿| 欧美色老头old∨ideo| 亚洲人成在线观看一区二区| 99久久国产免费看| 亚洲精品你懂的| 欧美亚洲丝袜传媒另类| 亚洲午夜久久久久久久久久久 | 欧美日韩精品一区二区三区四区| 亚洲精品高清在线| 欧美日免费三级在线| 亚洲一区二区中文在线| 欧美在线观看禁18| 亚洲18女电影在线观看| 69堂精品视频| 国产一区二区三区高清播放| 久久嫩草精品久久久久| bt7086福利一区国产| 亚洲精品国产无套在线观| 欧美综合视频在线观看| 奇米777欧美一区二区| 精品日本一线二线三线不卡| 国产毛片精品一区| 一区在线观看视频| 欧美丰满少妇xxxbbb| 国产乱人伦偷精品视频不卡| 中文字幕欧美区| 欧美亚洲国产一区二区三区va| 天天做天天摸天天爽国产一区| 欧美一区二区视频在线观看| 国产综合久久久久久久久久久久| 久久久久国产一区二区三区四区| www..com久久爱| 亚洲成人动漫在线观看| 久久久久国产成人精品亚洲午夜| proumb性欧美在线观看| 日韩精品电影一区亚洲| 欧美极品xxx| 欧美视频日韩视频在线观看| 久88久久88久久久| 亚洲免费电影在线| 日韩欧美www| 日本道在线观看一区二区| 七七婷婷婷婷精品国产| 亚洲视频免费观看| 欧美大肚乱孕交hd孕妇| 91视频在线观看| 日韩高清国产一区在线| 最新热久久免费视频| 欧美精品一级二级| jizzjizzjizz欧美| 国产精品综合视频| 亚洲丰满少妇videoshd| 中文字幕在线观看不卡视频| 日韩一区二区免费在线观看| 99久久精品免费| 国产一区二区日韩精品| 亚洲高清免费一级二级三级| 国产欧美日韩在线| 日韩一级片网站| 欧美视频一区在线观看| 91亚洲精品久久久蜜桃网站| 韩国午夜理伦三级不卡影院| 午夜精品福利一区二区三区av| 久久久久久一级片| 日韩欧美国产综合一区 | 不卡视频免费播放| 免费观看一级特黄欧美大片| 亚洲日本护士毛茸茸| 国产欧美视频一区二区三区| 欧美大片在线观看一区| 色综合久久久久| 99久久婷婷国产综合精品 | 在线观看免费成人| 99re这里只有精品首页| 国产白丝精品91爽爽久久| 美洲天堂一区二卡三卡四卡视频| 亚洲高清视频中文字幕| 亚洲精品国产成人久久av盗摄| 中文字幕欧美三区| 中文字幕av一区二区三区免费看| 精品国产一区二区精华| 欧美成人精精品一区二区频| 欧美一区二区视频观看视频| 欧美一区二视频| 精品理论电影在线| 精品少妇一区二区三区在线播放| 日韩视频免费直播| 精品久久久久久久久久久久久久久久久 | 久久老女人爱爱| 精品久久五月天| 欧美性大战xxxxx久久久| 99久久免费国产| 国产69精品久久777的优势| 国产伦精品一区二区三区视频青涩 | 99re66热这里只有精品3直播| 国产美女精品人人做人人爽| 免费观看一级特黄欧美大片| 免费在线观看一区二区三区| 亚洲国产精品久久久久婷婷884 | 久久日一线二线三线suv| 日韩一卡二卡三卡四卡| 制服丝袜激情欧洲亚洲| 欧美久久久一区| 欧美军同video69gay| av色综合久久天堂av综合| 色av成人天堂桃色av| 色综合天天综合在线视频| 99综合电影在线视频| 97aⅴ精品视频一二三区| 色狠狠色狠狠综合| 欧美一级欧美一级在线播放| 欧美丰满美乳xxx高潮www| 91麻豆精品国产91久久久资源速度| 欧美日韩dvd在线观看| 欧美精品久久99| 制服.丝袜.亚洲.另类.中文| 日韩写真欧美这视频| 欧美大白屁股肥臀xxxxxx| 日韩免费高清电影| 国产亚洲精久久久久久| 亚洲激情第一区| 天堂精品中文字幕在线| 蜜臀av一区二区在线观看| 国产另类ts人妖一区二区| www.在线成人| 欧美伊人精品成人久久综合97| 欧美另类videos死尸| 国产精品美女久久久久aⅴ国产馆| 亚洲三级电影网站| 日韩av高清在线观看| 国产精品91一区二区| 91精品在线一区二区| 国产精品午夜免费| 亚洲一区二区欧美激情| 日韩福利电影在线观看| 国产精品自在欧美一区| 欧美精品久久99| 国产精品久久久久久久久免费丝袜| 一区二区三区美女视频| 国产综合一区二区| 国产不卡视频在线播放| 91国偷自产一区二区三区观看| 日韩欧美激情在线| 国产精品久久久久久久久晋中| 久久99久久99| 一本一道久久a久久精品| 精品欧美一区二区在线观看| 成人欧美一区二区三区在线播放| 国产综合色在线| 欧美三级乱人伦电影| 久久精品在线观看| 日本不卡的三区四区五区| 欧洲色大大久久| 中文字幕av资源一区| 免费黄网站欧美| 欧美日韩中文另类| 亚洲精品成人精品456| 国产99精品国产| 欧美久久免费观看| 一区二区三区在线视频观看58| 亚洲第一久久影院| 欧美三级三级三级爽爽爽| 中文字幕日韩av资源站| 国产91清纯白嫩初高中在线观看| 欧美日韩一区二区三区在线看| 亚洲免费电影在线| 97久久超碰国产精品| 亚洲国产精品高清|