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 "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 virtual void GetBorders(int borders[4]) 00066 { 00067 for(int i=0;i<4;i++) 00068 { 00069 borders[i]=this->Borders[i]; 00070 } 00071 } 00073 00075 virtual void SetGutter(const vtkVector2f& gutter); 00076 00078 virtual vtkVector2f GetGutter() const { return this->Gutter; } 00079 00081 virtual void Allocate(); 00082 00087 virtual bool SetChart(const vtkVector2i& position, vtkChart* chart); 00088 00092 virtual vtkChart* GetChart(const vtkVector2i& position); 00093 00095 00098 virtual bool SetChartSpan(const vtkVector2i& position, 00099 const vtkVector2i& span); 00101 00103 virtual vtkVector2i GetChartSpan(const vtkVector2i& position); 00104 00107 virtual vtkVector2i GetChartIndex(const vtkVector2f& position); 00108 00109 protected: 00110 vtkChartMatrix(); 00111 ~vtkChartMatrix(); 00112 00113 class PIMPL; 00114 PIMPL *Private; 00115 00116 // The number of charts in x and y. 00117 vtkVector2i Size; 00118 00119 // The gutter between each chart. 00120 vtkVector2f Gutter; 00121 int Borders[4]; 00122 bool LayoutIsDirty; 00123 00124 private: 00125 vtkChartMatrix(const vtkChartMatrix &); // Not implemented. 00126 void operator=(const vtkChartMatrix &); // Not implemented. 00127 }; 00128 00129 #endif //__vtkChartMatrix_h