亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成人黄色av电影| 欧美狂野另类xxxxoooo| 99国产精品久久| 日韩三级视频中文字幕| 亚洲乱码国产乱码精品精的特点 | 国产午夜精品久久久久久久 | 另类调教123区| 一本到不卡精品视频在线观看| 日韩欧美国产一区二区在线播放| 亚洲精品欧美综合四区| 国产成人免费视频网站高清观看视频| 欧美人伦禁忌dvd放荡欲情| 综合av第一页| 99精品在线观看视频| 久久精品夜色噜噜亚洲aⅴ| 美女视频黄a大片欧美| 欧美日韩在线播放| 一区二区三区四区国产精品| www.成人在线| 国产精品色噜噜| 岛国av在线一区| 国产日韩av一区二区| 国内精品伊人久久久久影院对白| 日韩欧美资源站| 日韩精品电影一区亚洲| 欧美私模裸体表演在线观看| 亚洲激情网站免费观看| 色哟哟精品一区| 亚洲男人的天堂网| 色综合久久久久综合99| 亚洲你懂的在线视频| 色综合久久久久综合| 一区二区三区日韩精品视频| 欧美在线|欧美| 亚洲一区二区三区视频在线| 欧洲一区二区av| 亚洲一区二区在线观看视频| 欧美高清视频一二三区 | 亚洲图片另类小说| www.亚洲激情.com| 亚洲精品免费在线| 欧美日韩高清一区| 免费成人你懂的| 国产日韩av一区二区| 9l国产精品久久久久麻豆| 亚洲伦理在线免费看| 欧美日韩精品福利| 国内精品第一页| 中文字幕乱码亚洲精品一区| 色哟哟国产精品| 日产欧产美韩系列久久99| 欧美xxxxx牲另类人与| 国产·精品毛片| 亚洲图片欧美一区| 日韩欧美一区电影| 成人av在线资源网站| 亚洲一级不卡视频| 精品国产成人在线影院| 99久久免费视频.com| 午夜免费久久看| 久久理论电影网| 日本久久电影网| 久久av资源网| 1区2区3区精品视频| 欧美一区二视频| 丁香一区二区三区| 亚洲午夜精品网| 久久久久久久久久看片| 欧美亚洲动漫制服丝袜| 国产麻豆91精品| 首页综合国产亚洲丝袜| 中文字幕乱码久久午夜不卡| 欧美日韩视频在线观看一区二区三区| 精品午夜一区二区三区在线观看| 亚洲美女偷拍久久| 国产三级精品视频| 69堂亚洲精品首页| 色综合天天综合狠狠| 韩国av一区二区三区四区| 亚洲国产美国国产综合一区二区| 久久日一线二线三线suv| 欧美日韩亚洲综合在线 | 欧洲亚洲国产日韩| 国产精品一区二区三区四区| 丝袜美腿一区二区三区| 18涩涩午夜精品.www| 久久综合网色—综合色88| 在线观看亚洲一区| 99免费精品视频| 国产精品一区二区视频| 蜜臀av性久久久久av蜜臀妖精| 亚洲欧美日韩国产中文在线| 久久精品亚洲一区二区三区浴池| 欧美一区二区免费观在线| 色综合久久综合网欧美综合网 | 欧美国产丝袜视频| 精品成人私密视频| 欧美一区二区三区播放老司机| 欧美亚洲免费在线一区| 成人国产亚洲欧美成人综合网| 久久99久国产精品黄毛片色诱| 日韩高清不卡在线| 午夜日韩在线观看| 亚洲电影你懂得| 亚洲国产精品久久艾草纯爱| 亚洲视频网在线直播| 成人免费在线观看入口| 国产精品电影院| 成人欧美一区二区三区小说| 中文一区在线播放| 国产欧美日韩三区| 欧美国产日本韩| 国产精品久久久久久久久免费樱桃| 久久久久国产精品麻豆ai换脸| 精品久久久三级丝袜| 精品国产乱码久久| 国产欧美一区二区精品性色超碰| 精品国偷自产国产一区| 国产精品美女视频| 国产精品日产欧美久久久久| 国产精品久久久久四虎| 最好看的中文字幕久久| 樱花影视一区二区| 一区二区激情视频| 亚洲一级片在线观看| 天堂蜜桃一区二区三区| 久久不见久久见免费视频7 | 日韩国产欧美三级| 日韩av在线播放中文字幕| 美国欧美日韩国产在线播放| 精品一区二区在线看| 国产.精品.日韩.另类.中文.在线.播放| 国产成人精品免费网站| 99精品视频在线观看| 色婷婷国产精品综合在线观看| 欧美三日本三级三级在线播放| 777奇米四色成人影色区| 国产亚洲一区二区在线观看| 国产精品久久久久影院老司| 一级中文字幕一区二区| 日韩电影一二三区| 国产精品123区| 日本高清不卡aⅴ免费网站| 欧美一三区三区四区免费在线看 | 欧美美女直播网站| 久久伊人中文字幕| 亚洲免费看黄网站| 久久国产精品免费| 91视频com| 精品国产一区二区三区av性色| 成人免费一区二区三区视频| 日本亚洲免费观看| 不卡的av中国片| 日韩一区二区三区电影| 亚洲欧美在线高清| 激情偷乱视频一区二区三区| 91在线码无精品| ww亚洲ww在线观看国产| 亚洲自拍都市欧美小说| 国产综合色精品一区二区三区| 91在线视频官网| 欧美电视剧在线看免费| 中文字幕亚洲在| 国内精品久久久久影院一蜜桃| 欧美亚洲国产bt| 国产精品美女久久福利网站| 视频一区欧美日韩| 色综合天天狠狠| 国产免费观看久久| 久久精品国产久精国产爱| 欧美午夜精品一区二区三区| 国产精品美日韩| 国产精品一区二区在线观看不卡| 在线播放91灌醉迷j高跟美女| 国产精品乱人伦| 国产精品正在播放| 精品女同一区二区| 日韩高清中文字幕一区| 91麻豆精东视频| 国产精品三级电影| 国产精品一二三四区| 在线电影欧美成精品| 一区二区三区欧美久久| av电影在线观看完整版一区二区| 精品粉嫩超白一线天av| 日本不卡高清视频| 欧美日韩高清一区二区三区| 亚洲激情网站免费观看| 91论坛在线播放| 中文字幕亚洲电影| 成年人午夜久久久| 国产精品青草久久| 国产成人av一区| 中文字幕 久热精品 视频在线 | 精品国产1区二区| 蜜臀91精品一区二区三区| 欧美高清视频www夜色资源网| 亚洲精品美国一| 91黄色免费网站| 亚洲永久免费av|