home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / kompon / d123456 / CHEMPLOT.ZIP / TPlot / Data.hpp < prev    next >
C/C++ Source or Header  |  2001-07-31  |  10KB  |  230 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Data.pas' rev: 3.00
  6.  
  7. #ifndef DataHPP
  8. #define DataHPP
  9. #include <Misc.hpp>
  10. #include <Ptedit.hpp>
  11. #include <Plotdefs.hpp>
  12. #include <NoMath.hpp>
  13. #include <Displace.hpp>
  14. #include <Dataedit.hpp>
  15. #include <Axis.hpp>
  16. #include <Graphics.hpp>
  17. #include <Forms.hpp>
  18. #include <Dialogs.hpp>
  19. #include <Controls.hpp>
  20. #include <Clipbrd.hpp>
  21. #include <Windows.hpp>
  22. #include <SysUtils.hpp>
  23. #include <Classes.hpp>
  24. #include <SysInit.hpp>
  25. #include <System.hpp>
  26.  
  27. //-- user supplied -----------------------------------------------------------
  28.  
  29. namespace Data
  30. {
  31. //-- type declarations -------------------------------------------------------
  32. enum THighLow { hlLow, hlHigh };
  33.  
  34. typedef Set<THighLow, hlLow, hlHigh>  TSetHighLow;
  35.  
  36. enum TDataStatus { dsNone, dsInternal, dsInternalString, dsExternal };
  37.  
  38. class DELPHICLASS TSeries;
  39. class PASCALIMPLEMENTATION TSeries : public Classes::TPersistent 
  40. {
  41.     typedef Classes::TPersistent inherited;
  42.     
  43. private:
  44.     Classes::TList* FAxisList;
  45.     Graphics::TBrush* FBrush;
  46.     Word FDefSize;
  47.     int FDeltaX;
  48.     int FDeltaY;
  49.     System::AnsiString FName;
  50.     int FNoPts;
  51.     Graphics::TPen* FPen;
  52.     int FHighCapacity;
  53.     int FHighCount;
  54.     TSetHighLow FHighLow;
  55.     Misc::TIntegerArray *FHighs;
  56.     int FLowCount;
  57.     Misc::TIntegerArray *FLows;
  58.     bool FShadeLimits;
  59.     TSymbol FSymbol;
  60.     int FSymbolSize;
  61.     bool FVisible;
  62.     Axis::TAxis* FXAxis;
  63.     float FXMin;
  64.     float FXMax;
  65.     Misc::TSingleArray *FXData;
  66.     Classes::TStringList* FXStringData;
  67.     Axis::TAxis* FYAxis;
  68.     Byte FYAxisIndex;
  69.     Misc::TSingleArray *FYData;
  70.     float FZData;
  71.     Misc::TSingleArray *Fd2Y_dX2;
  72.     int Size2ndDeriv;
  73.     float FYMin;
  74.     float FYMax;
  75.     float YSum;
  76.     Classes::TNotifyEvent FOnStyleChange;
  77.     Classes::TNotifyEvent FOnDataChange;
  78.     Classes::TList* FDependentSeries;
  79.     bool FExternalXSeries;
  80.     TSeries* FXDataSeries;
  81.     TDataStatus DataStatus;
  82.     int MemSize;
  83.     tagPOINT TheOutline[22];
  84.     int NoOutlinePts;
  85.     void __fastcall CheckBounds(int ThePointNo, bool AdjustAxis);
  86.     bool __fastcall IncMemSize(void);
  87.     
  88. protected:
  89.     Word __fastcall GetXDataRefCount(void);
  90.     void __fastcall SetBrush(Graphics::TBrush* Value);
  91.     void __fastcall SetDeltaX(int Value);
  92.     void __fastcall SetDeltaY(int Value);
  93.     void __fastcall SetName(System::AnsiString Value);
  94.     void __fastcall SetPen(Graphics::TPen* Value);
  95.     void __fastcall SetShadeLimits(bool Value);
  96.     void __fastcall SetSymbol(Plotdefs::TSymbol Value);
  97.     void __fastcall SetSymbolSize(int Value);
  98.     void __fastcall SetVisible(bool Value);
  99.     void __fastcall SetXStringData(Classes::TStringList* Value);
  100.     void __fastcall SetYAxisIndex(Byte Value);
  101.     void __fastcall SetZData(float Value);
  102.     void __fastcall DoStyleChange(void);
  103.     void __fastcall DoDataChange(void);
  104.     
  105. public:
  106.     __property bool ExternalXSeries = {read=FExternalXSeries, nodefault};
  107.     __property TSeries* XDataSeries = {read=FXDataSeries};
  108.     __property int NoPts = {read=FNoPts, nodefault};
  109.     __property int HighCount = {read=FHighCount, nodefault};
  110.     __property Misc::pIntegerArray Highs = {read=FHighs};
  111.     __property int LowCount = {read=FLowCount, nodefault};
  112.     __property Misc::pIntegerArray Lows = {read=FLows};
  113.     __property Word XDataRefCount = {read=GetXDataRefCount, nodefault};
  114.     __property Axis::TAxis* XAxis = {read=FXAxis};
  115.     __property Axis::TAxis* YAxis = {read=FYAxis};
  116.     __property Byte YAxisIndex = {read=FYAxisIndex, write=SetYAxisIndex, nodefault};
  117.     __property Misc::pSingleArray XData = {read=FXData};
  118.     __property Classes::TStringList* XStringData = {read=FXStringData, write=SetXStringData};
  119.     __property Misc::pSingleArray YData = {read=FYData};
  120.     __property float ZData = {read=FZData, write=SetZData};
  121.     __property Misc::pSingleArray d2Y_dX2 = {read=Fd2Y_dX2};
  122.     __property float XMin = {read=FXMin};
  123.     __property float XMax = {read=FXMax};
  124.     __property float YMin = {read=FYMin};
  125.     __property float YMax = {read=FYMax};
  126.     __fastcall virtual TSeries(int Index, Classes::TList* AxisList, TSeries* XDataSeriesValue);
  127.     __fastcall virtual ~TSeries(void);
  128.     bool __fastcall AddData(Misc::pSingleArray XPointer, Misc::pSingleArray YPointer, int NumberOfPoints
  129.         );
  130.     int __fastcall AddDrawPoint(float X, float Y, Graphics::TCanvas* ACanvas);
  131.     int __fastcall AddPoint(float X, float Y, bool FireEvent, bool AdjustAxes);
  132.     int __fastcall AddStringPoint(System::AnsiString XString, float X, float Y, bool FireEvent, bool AdjustAxes
  133.         );
  134.     int __fastcall InsertPoint(float X, float Y);
  135.     bool __fastcall PointToData(Misc::pSingleArray XPointer, Misc::pSingleArray YPointer, int NumberOfPoints
  136.         );
  137.     void __fastcall ReplacePoint(int N, float NewX, float NewY);
  138.     bool __fastcall AllocateNoPts(int Value);
  139.     void __fastcall Compress(int CompressRatio);
  140.     void __fastcall Contract(int TheStart, int TheFinish);
  141.     void __fastcall CopyToClipBoard(void);
  142.     void __fastcall Displace(System::AnsiString TheHelpFile);
  143.     void __fastcall ApplyDisplacementChange(System::TObject* Sender);
  144.     bool __fastcall AddDependentSeries(TSeries* ASeries);
  145.     bool __fastcall RemoveDependentSeries(TSeries* ASeries);
  146.     bool __fastcall AssumeMasterSeries(int XPts, TSeries* OldMaster, Classes::TList* AList);
  147.     bool __fastcall ResetXDataSeries(TSeries* OldSeries, TSeries* NewSeries);
  148.     int __fastcall DelPoint(float X, float Y, bool Confirm);
  149.     int __fastcall DelPointNumber(int ThePoint, bool Confirm);
  150.     bool __fastcall DelData(void);
  151.     void __fastcall DrawHistory(Graphics::TCanvas* ACanvas, float HistoryX);
  152.     void __fastcall Draw(Graphics::TCanvas* ACanvas, int XYFastAt);
  153.     void __fastcall DrawShades(Graphics::TCanvas* ACanvas, int XYFastAt);
  154.     void __fastcall DrawPie(Graphics::TCanvas* ACanvas, int PieLeft, int PieTop, int PieWidth, int PieHeight
  155.         );
  156.     void __fastcall DrawPolar(Graphics::TCanvas* ACanvas, float PolarRange);
  157.     void __fastcall DrawSymbol(Graphics::TCanvas* ACanvas, int iX, int iY);
  158.     void __fastcall Trace(Graphics::TCanvas* ACanvas);
  159.     void __fastcall EditData(System::AnsiString TheHelpFile);
  160.     void __fastcall ApplyDataChange(System::TObject* Sender);
  161.     void __fastcall EditPoint(int ThePointNumber, System::AnsiString TheHelpFile);
  162.     void __fastcall ApplyPointChange(System::TObject* Sender, Forms::TModalResult TheResult);
  163.     void __fastcall GetBounds(void);
  164.     void __fastcall ResetBounds(void);
  165.     int __fastcall GetNearestPointToX(float X);
  166.     int __fastcall GetNearestPointToFX(int FX);
  167.     int __fastcall GetNearestPieSlice(int iX, int iY, int PieLeft, int PieTop, int PieWidth, int PieHeight
  168.         , float &MinDistance);
  169.     int __fastcall GetNearestXYPoint(int iX, int iY, int StartPt, int EndPt, float &MinDistance);
  170.     int __fastcall GetNearestXYPointFast(int iX, int iY, float &MinDistance);
  171.     void __fastcall GetPoint(int N, float &X, float &Y);
  172.     Misc::TXYPoint __fastcall GetXYPoint(int N);
  173.     void __fastcall Smooth(int SmoothOrder);
  174.     void __fastcall Sort(void);
  175.     void __fastcall GeneratePieOutline(int PieLeft, int PieTop, int PieWidth, int PieHeight, int TheNearestPoint
  176.         );
  177.     void __fastcall GenerateColumnOutline(int X1, int Y1, int X2, int Y2);
  178.     void __fastcall GenerateXYOutline(void);
  179.     void __fastcall Outline(Graphics::TCanvas* ACanvas, Plotdefs::TPlotType ThePlotType, int TheOutlineWidth
  180.         );
  181.     void __fastcall MoveBy(Graphics::TCanvas* ACanvas, Plotdefs::TPlotType ThePlotType, int DX, int DY, 
  182.         int TheOutlineWidth);
  183.     void __fastcall MoveTo(Graphics::TCanvas* ACanvas, Plotdefs::TPlotType ThePlotType, int TheOutlineWidth
  184.         , int X, int Y);
  185.     void __fastcall LineBestFit(float TheLeft, float TheRight, int &NoLSPts, double &SumX, double &SumY
  186.         , double &SumXsq, double &SumXY, double &SumYsq, float &Slope, float &Intercept, float &Rsq);
  187.     void __fastcall Differentiate(void);
  188.     void __fastcall Integrate(void);
  189.     float __fastcall Integral(float TheLeft, float TheRight);
  190.     float __fastcall IntegralByPoint(int Start, int Finish);
  191.     void __fastcall DoSpline(int Density, TSeries* pSplineSeries);
  192.     void __fastcall SecondDerivative(void);
  193.     float __fastcall SplineValue(float X);
  194.     void __fastcall ClearSpline(void);
  195.     int __fastcall FindHighsLows(int Start, int Finish, int HeightSensitivity);
  196.     void __fastcall MovingAverage(int Span);
  197.     float __fastcall Average(float TheLeft, float TheRight);
  198.     void __fastcall Linearize(float TheLeft, float TheRight);
  199.     void __fastcall Zero(float TheLeft, float TheRight);
  200.     void __fastcall ClearHighsLows(void);
  201.     void __fastcall DrawHighs(Graphics::TCanvas* ACanvas);
  202.     void __fastcall MakeXDataIndependent(void);
  203.     
  204. __published:
  205.     __property Graphics::TBrush* Brush = {read=FBrush, write=SetBrush};
  206.     __property int DeltaX = {read=FDeltaX, write=SetDeltaX, nodefault};
  207.     __property int DeltaY = {read=FDeltaY, write=SetDeltaY, nodefault};
  208.     __property Word DefSize = {read=FDefSize, write=FDefSize, nodefault};
  209.     __property TSetHighLow HighLow = {read=FHighLow, write=FHighLow, nodefault};
  210.     __property System::AnsiString Name = {read=FName, write=SetName};
  211.     __property Graphics::TPen* Pen = {read=FPen, write=SetPen};
  212.     __property bool ShadeLimits = {read=FShadeLimits, write=SetShadeLimits, nodefault};
  213.     __property Plotdefs::TSymbol Symbol = {read=FSymbol, write=SetSymbol, nodefault};
  214.     __property int SymbolSize = {read=FSymbolSize, write=SetSymbolSize, nodefault};
  215.     __property bool Visible = {read=FVisible, write=SetVisible, nodefault};
  216.     __property Classes::TNotifyEvent OnStyleChange = {read=FOnStyleChange, write=FOnStyleChange};
  217.     __property Classes::TNotifyEvent OnDataChange = {read=FOnDataChange, write=FOnDataChange};
  218. };
  219.  
  220. //-- var, const, procedure ---------------------------------------------------
  221. #define OUTLINE_DENSITY (Byte)(20)
  222. extern PACKAGE int __fastcall Compare(void * Item1, void * Item2);
  223.  
  224. }    /* namespace Data */
  225. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  226. using namespace Data;
  227. #endif
  228. //-- end unit ----------------------------------------------------------------
  229. #endif    // Data
  230.