VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Charts/Core/vtkChartMatrix.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkChartMatrix.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 
00028 #ifndef vtkChartMatrix_h
00029 #define vtkChartMatrix_h
00030 
00031 #include "vtkChartsCoreModule.h" // For export macro
00032 #include "vtkAbstractContextItem.h"
00033 #include "vtkVector.h" // For ivars
00034 
00035 class vtkChart;
00036 
00037 class VTKCHARTSCORE_EXPORT vtkChartMatrix : public vtkAbstractContextItem
00038 {
00039 public:
00040   vtkTypeMacro(vtkChartMatrix, vtkAbstractContextItem);
00041   virtual void PrintSelf(ostream &os, vtkIndent indent);
00042 
00044   static vtkChartMatrix *New();
00045 
00048   virtual void Update();
00049 
00051   virtual bool Paint(vtkContext2D *painter);
00052 
00056   virtual void SetSize(const vtkVector2i& size);
00057 
00059   virtual vtkVector2i GetSize() const { return this->Size; }
00060 
00062 
00064   virtual void SetBorders(int left, int bottom, int right, int top);
00065   void SetBorderLeft(int value);
00066   void SetBorderBottom(int value);
00067   void SetBorderRight(int value);
00068   void SetBorderTop(int value);
00069   virtual void GetBorders(int borders[4])
00070   {
00071     for(int i=0;i<4;i++)
00072       {
00073       borders[i]=this->Borders[i];
00074       }
00075   }
00077 
00079 
00080   virtual void SetGutter(const vtkVector2f& gutter);
00081   void SetGutterX(float value);
00082   void SetGutterY(float value);
00084 
00086   virtual vtkVector2f GetGutter() const { return this->Gutter; }
00087 
00089   virtual void Allocate();
00090 
00095   virtual bool SetChart(const vtkVector2i& position, vtkChart* chart);
00096 
00100   virtual vtkChart* GetChart(const vtkVector2i& position);
00101 
00103 
00106   virtual bool SetChartSpan(const vtkVector2i& position,
00107                             const vtkVector2i& span);
00109 
00111   virtual vtkVector2i GetChartSpan(const vtkVector2i& position);
00112 
00115   virtual vtkVector2i GetChartIndex(const vtkVector2f& position);
00116 
00117 protected:
00118   vtkChartMatrix();
00119   ~vtkChartMatrix();
00120 
00121   class PIMPL;
00122   PIMPL *Private;
00123 
00124   // The number of charts in x and y.
00125   vtkVector2i Size;
00126 
00127   // The gutter between each chart.
00128   vtkVector2f Gutter;
00129   int Borders[4];
00130   bool LayoutIsDirty;
00131 
00132 private:
00133   vtkChartMatrix(const vtkChartMatrix &); // Not implemented.
00134   void operator=(const vtkChartMatrix &); // Not implemented.
00135 };
00136 
00137 #endif //vtkChartMatrix_h