⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teesurfa.pas

📁 第三方控件:PaintGrid.pas 网格型仪表控件源文件 Mymeter.pas 圆型仪表控件源文件 Project1是这两个控件的使用范例。 该
💻 PAS
📖 第 1 页 / 共 5 页
字号:

    Function DefaultPen:Boolean;

    {$IFDEF LEVELSEGMENTS}
    Function SegmentCount:Integer;
    property Segments:TLevelSegments read FSegments;
    {$ENDIF}
  published
    property Color:TColor read FColor write SetColor;
    property Pen:TChartPen read GetPen write SetPen stored IsPenStored; // 5.03
    property UpToValue:Double read FUpTo write SetUpTo;
  end;

  TContourLevels=class(TOwnedCollection)
  private
    Function Get(Index:Integer):TContourLevel;
    Procedure Put(Index:Integer; Const Value:TContourLevel);
  public
    {$IFDEF LEVELSEGMENTS}
    Function Clicked(x,y:Integer; Var SegmentIndex,PointIndex:Integer):Integer;
    {$ENDIF}
    property Items[Index:Integer]:TContourLevel read Get write Put; default;
  end;

  TSmoothPoints=class(TPersistent)
  private
    FActive : Boolean;
    ISeries : TChartSeries;
    FInterpolate: Boolean;
    procedure SetActive(const Value: Boolean);
    procedure SetInterpolate(const Value: Boolean);
  public
    Factor : Integer;
    Constructor Create(Parent:TChartSeries);
    Procedure Assign(Source:TPersistent); override;
    Function Calculate(Const P:Array of TPoint):TPointArray;
  published
    property Active:Boolean read FActive write SetActive default False;
    property Interpolate:Boolean read FInterpolate write SetInterpolate default False;
  end;

  TContourSeries=class(TCustom3DGridSeries)
  private
    FAutomaticLevels: Boolean;
    FLevels         : TContourLevels;
    FNumLevels      : Integer;
    FSmoothing      : TSmoothPoints;
    FYPosition      : Double;
    FYPositionLevel : Boolean;
    FOnBeforeDrawLevel : TOnBeforeDrawLevelEvent;
    FOnGetLevel     : TOnGetLevelEvent;

    IModifyingLevels : Boolean;

    procedure ClearAutoLevels;
    function GetNumLevels: Integer;
    function GetZAxis:TChartAxis;
    function IsLevelsStored: Boolean;
    procedure SetAutomaticLevels(const Value: Boolean);
    procedure SetLevels(const Value: TContourLevels);
    Procedure SetNumLevels(Value:Integer);
    Procedure SetYPosition(Const Value:Double);
    Procedure SetYPositionLevel(Value:Boolean);
    procedure SetSmoothing(const Value: TSmoothPoints);
  protected
    class Procedure CreateSubGallery(AddSubChart:TChartSubGalleryProc); override;
    procedure AddSampleValues(NumValues:Integer; OnlyMandatory:Boolean=False); override;
    Procedure DoBeforeDrawChart; override;
    procedure DrawAllValues; override;
    class Function GetEditorClass:String; override;
    Procedure PrepareForGallery(IsEnabled:Boolean); override;
    class Procedure SetSubGallery(ASeries:TChartSeries; Index:Integer); override;
  public
    Constructor Create(AOwner: TComponent); override;
    Destructor Destroy; override;

    Procedure Assign(Source:TPersistent); override;
    {$IFDEF LEVELSEGMENTS}
    Function Clicked(x,y:Integer):Integer; override;
    {$ENDIF}
    Function CountLegendItems:Integer; override;
    Procedure CreateAutoLevels; // Calculate all Level values and colors
    Function LegendItemColor(LegendIndex:Integer):TColor; override;
    Function LegendString( LegendIndex:Integer;
                           LegendTextStyle:TLegendTextStyle ):String; override;
    Function MaxYValue:Double; override;
    Function MinYValue:Double; override;
  published
    property Active;
    property AutomaticLevels:Boolean read FAutomaticLevels write SetAutomaticLevels default True;
    property ColorEachPoint default True;
    property ColorSource;
    property Cursor;
    property HorizAxis;
    property Marks;
    property ParentChart;
    property DataSource;
    property PercentFormat;
    property SeriesColor;
    property ShowInLegend;
    property Title;
    property ValueFormat;
    property VertAxis;
    property XLabelsSource;

    { events }
    property AfterDrawValues;
    property BeforeDrawValues;
    property OnAfterAdd;
    property OnBeforeAdd;
    property OnClearValues;
    property OnClick;
    property OnDblClick;
    property OnGetMarkText;
    property OnMouseEnter;
    property OnMouseLeave;

    property EndColor;
    property LegendEvery;
    property Levels:TContourLevels read FLevels write SetLevels stored IsLevelsStored;
    property MidColor;
    property NumLevels:Integer read GetNumLevels write SetNumLevels default 10;
    property NumXValues;
    property NumZValues;
    property PaletteMin;
    property PaletteStep;
    property PaletteSteps;
    property PaletteStyle;
    property Pen;
    property Smoothing:TSmoothPoints read FSmoothing write SetSmoothing;
    property StartColor;
    property TimesZOrder;
    property UseColorRange;
    property UsePalette;
    property UsePaletteMin;
    property XValues;
    property YPosition:Double read FYPosition write SetYPosition;
    property YPositionLevel:Boolean read FYPositionLevel write SetYPositionLevel default False;
    property YValues;
    property ZValues;

    { events }
    property OnBeforeDrawLevel:TOnBeforeDrawLevelEvent read FOnBeforeDrawLevel
                                                       write FOnBeforeDrawLevel;
    property OnGetYValue;
    property OnGetLevel:TOnGetLevelEvent read FOnGetLevel write FOnGetLevel;
  end;

  TWaterFallSeries=class(TSurfaceSeries)
  protected
    class Procedure CreateSubGallery(AddSubChart:TChartSubGalleryProc); override;
    Procedure GalleryChanged3D(Is3D:Boolean); override;
    class Function GetEditorClass:String; override;
    class Procedure SetSubGallery(ASeries:TChartSeries; Index:Integer); override;
  public
    Constructor Create(AOwner: TComponent); override;
    Procedure Assign(Source:TPersistent); override;  // 7.01
  published
    property WaterFall default True;
    property WaterLines;
  end;

  TColorGridSeries=class(TCustom3DGridSeries)
  private
    FBitmap       : TBitmap;
    FCentered     : Boolean;
    FFrame        : TChartHiddenPen;
    FSmoothBitmap : Boolean;
    FXGridEvery   : Integer;
    FZGridEvery   : Integer;

    function CalcMaxValue(const Value:Double):Double;
    function CalcMinValue(const Value:Double):Double;
    procedure SetCentered(const Value: Boolean);
    procedure SetBitmap(const Value: TBitmap);
    procedure SetSmoothBitmap(const Value: Boolean);
    procedure SetXGridEvery(const Value: Integer);
    procedure SetZGridEvery(const Value: Integer);
    procedure SetFrame(const Value: TChartHiddenPen);
  protected
    class Procedure CreateSubGallery(AddSubChart:TChartSubGalleryProc); override;
    procedure DrawAllValues; override;
    Procedure DrawMark( ValueIndex:Integer; Const St:String;
                        APosition:TSeriesMarkPosition); override;
    Procedure GalleryChanged3D(Is3D:Boolean); override;
    class Function GetEditorClass:String; override;
    Procedure PrepareForGallery(IsEnabled:Boolean); override;
    class Procedure SetSubGallery(ASeries:TChartSeries; Index:Integer); override;
  public
    Constructor Create(AOwner:TComponent); override;
    Destructor Destroy; override;

    procedure Assign(Source:TPersistent); override;
    Function Clicked(X,Y:Integer):Integer; override; { 5.01 }
    Function MinXValue:Double; override;
    Function MaxXValue:Double; override;
    Function MaxYValue:Double; override;
    Function MinYValue:Double; override;
    Function MinZValue:Double; override;
    Function MaxZValue:Double; override;

    property Bitmap:TBitmap read FBitmap write SetBitmap;
  published
    { Published declarations }
    property Active;
    property CenteredPoints:Boolean read FCentered write SetCentered default False;
    property ColorSource;
    property Cursor;
    property Frame:TChartHiddenPen read FFrame write SetFrame;
    property HorizAxis;
    property Marks;
    property ParentChart;
    property DataSource;
    property PercentFormat;
    property SeriesColor;
    property ShowInLegend;
    property SmoothBitmap:Boolean read FSmoothBitmap write SetSmoothBitmap default False;  // 7.0
    property Title;
    property ValueFormat;
    property VertAxis;
    property XGridEvery:Integer read FXGridEvery write SetXGridEvery default 1; // 7.0
    property XLabelsSource;
    property ZGridEvery:Integer read FZGridEvery write SetZGridEvery default 1; // 7.0

    { events }
    property AfterDrawValues;
    property BeforeDrawValues;
    property OnAfterAdd;
    property OnBeforeAdd;
    property OnClearValues;
    property OnClick;
    property OnDblClick;
    property OnGetMarkText;
    property OnMouseEnter;
    property OnMouseLeave;

    property Brush;
    property EndColor;
    property IrregularGrid;
    property MidColor;
    property NumXValues;
    property NumZValues;
    property LegendEvery;
    property Pen;
    property PaletteMin;
    property PaletteStep;
    property PaletteSteps;
    property PaletteStyle;
    property StartColor;
    property UseColorRange;
    property UsePalette;
    property UsePaletteMin;
    property TimesZOrder;
    property XValues;
    property YValues;
    property ZValues;
    { events }
    property OnGetYValue;
    property OnGetColor;
  end;

  TVector3DSeries=class(TCustom3DPaletteSeries)
  private
    FArrowHeight : Integer;
    FArrowWidth  : Integer;
    FStartArrow  : TChartHiddenPen;
    FEndArrow    : TChartPen;
    FEndXValues  : TChartValueList; { <-- Vector end X values }
    FEndYValues  : TChartValueList; { <-- Vector end Y values }
    FEndZValues  : TChartValueList;

    procedure SetArrowHeight(const Value: Integer);
    procedure SetArrowWidth(const Value: Integer);
    Procedure SetEndXValues(Value:TChartValueList);
    Procedure SetEndYValues(Value:TChartValueList);
    Procedure SetEndZValues(Value:TChartValueList);
    procedure SetEndArrow(const Value: TChartPen);
    procedure SetStartArrow(const Value: TChartHiddenPen);
  protected
    Procedure AddSampleValues(NumValues:Integer; OnlyMandatory:Boolean=False); override;
    procedure DrawValue(ValueIndex:Integer); override; { <-- main draw method }
    class Function GetEditorClass:String; override;
  public
    Constructor Create(AOwner: TComponent); override;
    Destructor Destroy; override;

    Procedure Assign(Source:TPersistent); override;

    Function AddVector(Const X0,Y0,Z0,X1,Y1,Z1:Double; Const ALabel:String='';
                     AColor:TColor=clTeeColor):Integer; overload;
    Function IsValidSourceOf(Value:TChartSeries):Boolean; override;
    Function MaxXValue:Double; override;
    Function MinXValue:Double; override;
    Function MaxYValue:Double; override;
    Function MinYValue:Double; override;
    Function MaxZValue:Double; override;
    Function MinZValue:Double; override;
    Function NumSampleValues:Integer; override;
  published
    { Published declarations }
    property Active;
    property ColorSource;
    property Cursor;
    property HorizAxis;
    property Marks;
    property ParentChart;
    property DataSource;
    property PercentFormat;
    property SeriesColor;
    property ShowInLegend;
    property Title;
    property ValueFormat;
    property VertAxis;
    property XLabelsSource;

    { events }
    property AfterDrawValues;
    property BeforeDrawValues;
    property OnAfterAdd;
    property OnBeforeAdd;
    property OnClearValues;
    property OnClick;
    property OnDblClick;
    property OnGetMarkText;
    property OnMouseEnter;
    property OnMouseLeave;

    property Brush;
    property EndColor;
    property MidColor;
    property LegendEvery;
    property Pen;
    property PaletteMin;
    property PaletteStep;
    property PaletteSteps;
    property PaletteStyle;
    property StartColor;
    property UseColorRange;
    property UsePalette;
    property UsePaletteMin;
    property TimesZOrder;
    property XValues;
    property YValues;
    property ZValues;
    { events }
    property OnGetColor;

    property ArrowHeight:Integer read FArrowHeight write SetArrowHeight default 4;
    property ArrowWidth:Integer read FArrowWidth write SetArrowWidth default 4;
    property EndArrow:TChartPen read FEndArrow write SetEndArrow;
    property EndXValues:TChartValueList read FEndXValues write SetEndXValues;
    property EndYValues:TChartValueList read FEndYValues write SetEndYValues;
    property EndZValues:TChartValueList read FEndZValues write SetEndZValues;
    property StartArrow:TChartHiddenPen read FStartArrow write SetStartArrow;
  end;

  TTowerStyle=(tsCube,tsRectangle,tsCover,tsCylinder,tsArrow,tsCone,tsPyramid,
               tsSlantCube);

  TTowerSeries=class(TCustom3DGridSeries)
  private
    FDark3D       : Boolean;
    FOrigin       : Double;
    FPercDepth    : Integer;
    FPercWidth    : Integer;
    FTowerStyle   : TTowerStyle;
    FTransparency : TTeeTransparency;
    FUseOrigin    : Boolean;

    IOffW  : Double;
    IOffD  : Double;
    Function CalcCell(var AIndex,ATop,ABottom,Z0,Z1:Integer):TRect;
    procedure SetDark3D(const Value: Boolean);
    Procedure SetOrigin(Const Value:Double);
    procedure SetPercDepth(const Value: Integer);
    procedure SetPercWidth(const Value: Integer);
    procedure SetTransparency(const Value: TTeeTransparency);
    Procedure SetUseOrigin(Value:Boolean);
    procedure SetTowerStyle(const Value: TTowerStyle);
  protected
    class Procedure CreateSubGallery(AddSubChart:TChartSubGalleryProc); override;
    Procedure DrawMark( ValueIndex:Integer; Const St:String;
                        APosition:TSeriesMarkPosition); override;
    procedure DrawAllValues; override;
    class Function GetEditorClass:String; override;
    Procedure PrepareForGallery(IsEnabled:Boolean); override;
    class Procedure SetSubGallery(ASeries:TChartSeries; Index:Integer); override;
  public
    Constructor Create(AOwner:TComponent); override;

    Procedure Assign(Source:TPersistent); override;

    Function Clicked(X,Y:Integer):Integer; override; { 5.01 }
    Function MinXValue:Double; override;
    Function MaxXValue:Double; override;
    Function MinZValue:Double; override;
    Function MaxZValue:Double; override;
  published
    { Published declarations }
    property Active;
    property ColorSource;
    property Cursor;
    property HorizAxis;
    property Marks;
    property ParentChart;
    property DataSource;
    property PercentFormat;
    property SeriesColor;
    property ShowInLegend;
    property Title;
    property ValueFormat;
    property VertAxis;
    property XLabelsSource;

    property Dark3D:Boolean read FDark3D write SetDark3D default True;
    property PercentDepth:Integer read FPercDepth write SetPercDepth default 100;
    property Origin:Double read FOrigin write SetOrigin;
    property TowerStyle:TTowerStyle read FTowerStyle write SetTowerStyle default tsCube;
    property Transparency:TTeeTransparency read FTransparency write SetTransparency default 0;
    property PercentWidth:Integer read FPercWidth write SetPercWidth default 100;
    property UseOrigin:Boolean read FUseOrigin write SetUseOrigin default False;

    { events }
    property AfterDrawValues;
    property BeforeDrawValues;
    property OnAfterAdd;
    property OnBeforeAdd;
    property OnClearValues;
    property OnClick;
    property OnDblClick;
    property OnGetMarkText;
    property OnMouseEnter;
    property OnMouseLeave;

    property Brush;
    property EndColor;
    property IrregularGrid;
    property MidColor;
    property NumXValues;
    property NumZValues;
    property LegendEvery;
    property Pen;
    property PaletteMin;
    property PaletteStep;
    property PaletteSteps;
    property PaletteStyle;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -