VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkPlotBar.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotBar.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 
27 #ifndef __vtkPlotBar_h
28 #define __vtkPlotBar_h
29 
30 #include "vtkChartsCoreModule.h" // For export macro
31 #include "vtkPlot.h"
32 #include "vtkSmartPointer.h" // Needed to hold ColorSeries
33 
34 class vtkContext2D;
35 class vtkTable;
36 class vtkPoints2D;
37 class vtkStdString;
38 class vtkColorSeries;
39 
40 class vtkPlotBarPrivate;
41 
43 {
44 public:
46  virtual void PrintSelf(ostream &os, vtkIndent indent);
47 
49 
50  enum {
51  VERTICAL = 0,
52  HORIZONTAL
53  };
55 
57  static vtkPlotBar *New();
58 
61  virtual bool Paint(vtkContext2D *painter);
62 
64 
69  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
70  int legendIndex);
72 
74 
75  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
76  unsigned char a);
77  virtual void SetColor(double r, double g, double b);
78  virtual void GetColor(double rgb[3]);
80 
82 
83  vtkSetMacro(Width, float);
85 
87 
88  vtkGetMacro(Width, float);
90 
92 
95  vtkSetMacro(Offset, float);
96  vtkGetMacro(Offset, float);
98 
100 
102  virtual void SetOrientation(int orientation);
103  vtkGetMacro(Orientation, int);
105 
107  virtual void GetBounds(double bounds[4], bool unscaled);
108 
110  virtual void GetBounds(double bounds[4]);
111 
113  virtual void GetUnscaledInputBounds(double bounds[4]);
114 
116  virtual void SetInputArray(int index, const vtkStdString &name);
117 
119  void SetColorSeries(vtkColorSeries *colorSeries);
120 
122  vtkColorSeries *GetColorSeries();
123 
125  virtual vtkStringArray *GetLabels();
126 
128  virtual void SetGroupName(const vtkStdString& name);
129 
131  virtual vtkStdString GetGroupName();
132 
134 
136  virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos,
137  vtkIdType seriesIndex,
138  vtkIdType segmentIndex);
140 
142  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
143 
144 //BTX
146 
150  const vtkVector2f& tolerance,
153 
155 
161  const vtkVector2f&,
163  vtkIdType* segmentIndex);
165 
166 protected:
167  vtkPlotBar();
168  ~vtkPlotBar();
169 
171  bool UpdateTableCache(vtkTable *table);
172 
175 
176  float Width;
177  float Offset;
178 
180 
183 
186 
187 private:
188  vtkPlotBar(const vtkPlotBar &); // Not implemented.
189  void operator=(const vtkPlotBar &); // Not implemented.
190 
191  vtkPlotBarPrivate *Private;
192 
193 //ETX
194 };
195 
196 #endif //__vtkPlotBar_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
GLuint index
Definition: vtkgl.h:11983
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
float Width
Definition: vtkPlotBar.h:176
virtual bool Paint(vtkContext2D *painter)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual void GetBounds(double bounds[4])
Definition: vtkPlot.h:239
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:268
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: vtkgl.h:11332
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
int Orientation
Definition: vtkPlotBar.h:179
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
GLuint const GLchar * name
Definition: vtkgl.h:11983
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate 2D points
Definition: vtkPoints2D.h:35
virtual vtkStringArray * GetLabels()
Abstract class for 2D plots.
Definition: vtkPlot.h:51
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:42
float Offset
Definition: vtkPlotBar.h:177
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
virtual void SetInputArray(int index, const vtkStdString &name)
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
stores a list of colors.
virtual void GetUnscaledInputBounds(double bounds[4])
Definition: vtkPlot.h:258
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetColor(double rgb[3])
vtkPoints2D * Points
Definition: vtkPlotBar.h:174
GLboolean GLboolean g
Definition: vtkgl.h:12312
GLint location
Definition: vtkgl.h:12002
vtkSmartPointer< vtkColorSeries > ColorSeries
Definition: vtkPlotBar.h:185
static vtkObject * New()
vtkTimeStamp BuildTime
Definition: vtkPlotBar.h:182
#define max(a, b)
#define VTKCHARTSCORE_EXPORT
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69