VTK
vtkChartMatrix.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkChartMatrix.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
29 #ifndef vtkChartMatrix_h
30 #define vtkChartMatrix_h
31 
32 #include "vtkChartsCoreModule.h" // For export macro
33 #include "vtkAbstractContextItem.h"
34 #include "vtkVector.h" // For ivars
35 
36 #include <map> // For specific gutter
37 #include <utility> // For specific gutter
38 
39 class vtkChart;
40 
41 class VTKCHARTSCORE_EXPORT vtkChartMatrix : public vtkAbstractContextItem
42 {
43 public:
45  virtual void PrintSelf(ostream &os, vtkIndent indent);
46 
50  static vtkChartMatrix *New();
51 
55  virtual void Update();
56 
60  virtual bool Paint(vtkContext2D *painter);
61 
67  virtual void SetSize(const vtkVector2i& size);
68 
72  virtual vtkVector2i GetSize() const { return this->Size; }
73 
75 
78  virtual void SetBorders(int left, int bottom, int right, int top);
79  void SetBorderLeft(int value);
81  void SetBorderRight(int value);
82  void SetBorderTop(int value);
83  virtual void GetBorders(int borders[4])
84  {
85  for(int i=0;i<4;i++)
86  {
87  borders[i]=this->Borders[i];
88  }
89  }
91 
93 
96  virtual void SetGutter(const vtkVector2f& gutter);
97  void SetGutterX(float value);
98  void SetGutterY(float value);
100 
102 
105  virtual void SetSpecificResize(const vtkVector2i& index, const vtkVector2f& resize);
106  virtual void ClearSpecificResizes();
108 
112  virtual vtkVector2f GetGutter() const { return this->Gutter; }
113 
117  virtual void Allocate();
118 
125  virtual bool SetChart(const vtkVector2i& position, vtkChart* chart);
126 
133 
139  virtual bool SetChartSpan(const vtkVector2i& position,
140  const vtkVector2i& span);
141 
146 
152 
153 protected:
156 
157  class PIMPL;
158  PIMPL *Private;
159 
160  // The number of charts in x and y.
162 
163  // The gutter between each chart.
165  std::map<vtkVector2i, vtkVector2f> SpecificResize;
166  int Borders[4];
168 
169 private:
170  vtkChartMatrix(const vtkChartMatrix &) VTK_DELETE_FUNCTION;
171  void operator=(const vtkChartMatrix &) VTK_DELETE_FUNCTION;
172 };
173 
174 #endif //vtkChartMatrix_h
vtkChart
Factory class for drawing 2D charts.
Definition: vtkChart.h:51
vtkChartMatrix::SetBorderBottom
void SetBorderBottom(int value)
vtkChartMatrix::~vtkChartMatrix
~vtkChartMatrix()
vtkChartMatrix::Gutter
vtkVector2f Gutter
Definition: vtkChartMatrix.h:164
vtkChartMatrix::SpecificResize
std::map< vtkVector2i, vtkVector2f > SpecificResize
Definition: vtkChartMatrix.h:165
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkAbstractContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkAbstractContextItem.h:41
vtkChartMatrix::GetSize
virtual vtkVector2i GetSize() const
Get the width and height of the chart matrix.
Definition: vtkChartMatrix.h:72
vtkChartMatrix::Size
vtkVector2i Size
Definition: vtkChartMatrix.h:161
vtkChartMatrix::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the chart matrix.
vtkChartMatrix
container for a matrix of charts.
Definition: vtkChartMatrix.h:42
vtkVector.h
vtkChartMatrix::SetBorders
virtual void SetBorders(int left, int bottom, int right, int top)
Set/get the borders of the chart matrix (space in pixels around each chart).
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
vtkX3D::top
@ top
Definition: vtkX3D.h:502
vtkChartMatrix::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkChartMatrix::Private
PIMPL * Private
Definition: vtkChartMatrix.h:157
vtkX3D::position
@ position
Definition: vtkX3D.h:261
vtkChartMatrix::GetChartIndex
virtual vtkVector2i GetChartIndex(const vtkVector2f &position)
Get the position of the chart in the matrix at the specified location.
vtkChartMatrix::GetBorders
virtual void GetBorders(int borders[4])
Definition: vtkChartMatrix.h:83
vtkX3D::bottom
@ bottom
Definition: vtkX3D.h:290
vtkChartMatrix::SetSize
virtual void SetSize(const vtkVector2i &size)
Set the width and height of the chart matrix.
vtkChartMatrix::Allocate
virtual void Allocate()
Allocate the charts, this will cause any null chart to be allocated.
vtkChartMatrix::SetSpecificResize
virtual void SetSpecificResize(const vtkVector2i &index, const vtkVector2f &resize)
Set a specific resize that will move the bottom left point of a chart.
vtkChartMatrix::SetBorderRight
void SetBorderRight(int value)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkChartMatrix::GetChartSpan
virtual vtkVector2i GetChartSpan(const vtkVector2i &position)
Get the span of the specified chart.
vtkChartMatrix::vtkChartMatrix
vtkChartMatrix()
vtkChartMatrix::GetGutter
virtual vtkVector2f GetGutter() const
Get the gutter that should be left between the charts in the matrix.
Definition: vtkChartMatrix.h:112
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkChartMatrix::New
static vtkChartMatrix * New()
Creates a new object.
vtkChartMatrix::SetChartSpan
virtual bool SetChartSpan(const vtkVector2i &position, const vtkVector2i &span)
Set the span of a chart in the matrix.
vtkChartMatrix::SetBorderLeft
void SetBorderLeft(int value)
vtkAbstractContextItem.h
vtkChartMatrix::SetGutterX
void SetGutterX(float value)
vtkChartMatrix::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
vtkChartMatrix::LayoutIsDirty
bool LayoutIsDirty
Definition: vtkChartMatrix.h:167
vtkChartMatrix::GetChart
virtual vtkChart * GetChart(const vtkVector2i &position)
Get the specified chart element, if the element does not exist NULL will be returned.
vtkChartMatrix::SetBorderTop
void SetBorderTop(int value)
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:328
vtkChartMatrix::SetGutterY
void SetGutterY(float value)
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkVector2f
Definition: vtkVector.h:338
vtkChartMatrix::SetChart
virtual bool SetChart(const vtkVector2i &position, vtkChart *chart)
Set the chart element, note that the chart matrix must be large enough to accommodate the element bei...
vtkChartMatrix::SetGutter
virtual void SetGutter(const vtkVector2f &gutter)
Set the gutter that should be left between the charts in the matrix.
vtkChartMatrix::ClearSpecificResizes
virtual void ClearSpecificResizes()