VTK
|
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 "vtkAbstractContextItem.h" 00032 #include "vtkVector.h" // For ivars 00033 00034 class vtkChart; 00035 00036 class VTK_CHARTS_EXPORT vtkChartMatrix : public vtkAbstractContextItem 00037 { 00038 public: 00039 vtkTypeMacro(vtkChartMatrix, vtkAbstractContextItem); 00040 virtual void PrintSelf(ostream &os, vtkIndent indent); 00041 00043 static vtkChartMatrix *New(); 00044 00047 virtual void Update(); 00048 00050 virtual bool Paint(vtkContext2D *painter); 00051 00055 virtual void SetSize(const vtkVector2i& size); 00056 00058 virtual vtkVector2i GetSize() const { return this->Size; } 00059 00061 virtual void SetGutter(const vtkVector2f& gutter); 00062 00064 00066 virtual void SetBorders(int left, int bottom, int right, int top); 00067 virtual void GetBorders(int borders[4]) 00068 { 00069 for(int i=0;i<4;i++) 00070 { 00071 borders[i]=this->Borders[i]; 00072 } 00073 } 00075 00077 virtual vtkVector2f GetGutter() const { return this->Gutter; } 00078 00080 virtual void Allocate(); 00081 00086 virtual bool SetChart(const vtkVector2i& position, vtkChart* chart); 00087 00091 virtual vtkChart* GetChart(const vtkVector2i& position); 00092 00094 00097 virtual bool SetChartSpan(const vtkVector2i& position, 00098 const vtkVector2i& span); 00100 00102 virtual vtkVector2i GetChartSpan(const vtkVector2i& position); 00103 00104 protected: 00105 vtkChartMatrix(); 00106 ~vtkChartMatrix(); 00107 00108 class PIMPL; 00109 PIMPL *Private; 00110 00111 // The number of charts in x and y. 00112 vtkVector2i Size; 00113 00114 // The gutter between each chart. 00115 vtkVector2f Gutter; 00116 int Borders[4]; 00117 bool LayoutIsDirty; 00118 00119 private: 00120 vtkChartMatrix(const vtkChartMatrix &); // Not implemented. 00121 void operator=(const vtkChartMatrix &); // Not implemented. 00122 }; 00123 00124 #endif //__vtkChartMatrix_h