VTK
dox/Charts/vtkPlotStacked.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPlotPoints.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00027 #ifndef __vtkPlotStacked_h
00028 #define __vtkPlotStacked_h
00029 
00030 #include "vtkPlot.h"
00031 
00032 class vtkChartXY;
00033 class vtkContext2D;
00034 class vtkTable;
00035 class vtkPoints2D;
00036 class vtkStdString;
00037 class vtkImageData;
00038 class vtkColorSeries;
00039 
00040 class vtkPlotStackedPrivate;
00041 
00042 class VTK_CHARTS_EXPORT vtkPlotStacked : public vtkPlot
00043 {
00044 public:
00045   vtkTypeMacro(vtkPlotStacked, vtkPlot);
00046   virtual void PrintSelf(ostream &os, vtkIndent indent);
00047 
00049   static vtkPlotStacked *New();
00050 
00052 
00053   virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
00054                         unsigned char a);
00055   virtual void SetColor(double r,  double g, double b);
00056   virtual void GetColor(double rgb[3]);
00058 
00062   virtual void Update();
00063 
00066   virtual bool Paint(vtkContext2D *painter);
00067 
00069 
00074   virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
00075                            int legendIndex);
00077 
00079   virtual void GetBounds(double bounds[4]);
00080 
00082   virtual void SetInputArray(int index, const vtkStdString &name);
00083 
00085   void SetColorSeries(vtkColorSeries *colorSeries);
00086 
00088   vtkColorSeries *GetColorSeries();
00089 
00091   virtual vtkStringArray *GetLabels();
00092 
00093 //BTX
00095 
00098   virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00099                                     const vtkVector2f& tolerance,
00100                                     vtkVector2f* location);
00102 
00104   virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
00105 
00106 //BTX
00107 protected:
00108   vtkPlotStacked();
00109   ~vtkPlotStacked();
00110 
00112   bool UpdateTableCache(vtkTable *table);
00113 
00114   // Descript:
00115   // For stacked plots the Extent data must be greater than (or equal to) the
00116   // base data. Insure that this is true
00117   void FixExtent();
00118 
00122   void CalculateLogSeries();
00123 
00126   vtkIdTypeArray* BaseBadPoints;
00127 
00131   vtkIdTypeArray* ExtentBadPoints;
00132 
00134   vtkTimeStamp BuildTime;
00135 
00136   bool LogX, LogY;
00137 
00139   vtkSmartPointer<vtkColorSeries> ColorSeries;
00140 
00141 private:
00142   vtkPlotStacked(const vtkPlotStacked &); // Not implemented.
00143   void operator=(const vtkPlotStacked &); // Not implemented.
00144 
00145   vtkPlotStackedPrivate *Private;
00146 
00147 //ETX
00148 };
00149 
00150 #endif //__vtkPlotStacked_h