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
base class for items that are part of a vtkContextScene.
container for a matrix of charts.
void SetBorderBottom(int value)
void SetBorderRight(int value)
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual void SetGutter(const vtkVector2f &gutter)
Set the gutter that should be left between the charts in the matrix.
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...
virtual vtkVector2i GetSize() const
Get the width and height of the chart matrix.
virtual void GetBorders(int borders[4])
vtkVector2i Size
vtkVector2f Gutter
virtual vtkVector2i GetChartSpan(const vtkVector2i &position)
Get the span of the specified chart.
void SetBorderTop(int value)
std::map< vtkVector2i, vtkVector2f > SpecificResize
void SetGutterY(float value)
void SetGutterX(float value)
virtual bool SetChartSpan(const vtkVector2i &position, const vtkVector2i &span)
Set the span of a chart in the matrix.
virtual vtkVector2f GetGutter() const
Get the gutter that should be left between the charts in the matrix.
virtual vtkChart * GetChart(const vtkVector2i &position)
Get the specified chart element, if the element does not exist NULL will be returned.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkChartMatrix * New()
Creates a new object.
virtual void SetSize(const vtkVector2i &size)
Set the width and height of the chart matrix.
virtual bool Paint(vtkContext2D *painter)
Paint event for the chart matrix.
virtual vtkVector2i GetChartIndex(const vtkVector2f &position)
Get the position of the chart in the matrix at the specified location.
virtual void SetSpecificResize(const vtkVector2i &index, const vtkVector2f &resize)
Set a specific resize that will move the bottom left point of a chart.
virtual void ClearSpecificResizes()
virtual void Allocate()
Allocate the charts, this will cause any null chart to be allocated.
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).
void SetBorderLeft(int value)
Factory class for drawing 2D charts.
Definition: vtkChart.h:51
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
a simple class to control print indentation
Definition: vtkIndent.h:40
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:328
@ top
Definition: vtkX3D.h:502
@ value
Definition: vtkX3D.h:220
@ bottom
Definition: vtkX3D.h:290
@ position
Definition: vtkX3D.h:261
@ size
Definition: vtkX3D.h:253
@ index
Definition: vtkX3D.h:246