VTK
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;
40 class vtkScalarsToColors;
41 
42 class vtkPlotBarPrivate;
43 
45 {
46 public:
48  virtual void PrintSelf(ostream &os, vtkIndent indent);
49 
51 
52  enum {
53  VERTICAL = 0,
54  HORIZONTAL
55  };
57 
59  static vtkPlotBar *New();
60 
63  virtual void Update();
64 
67  virtual bool Paint(vtkContext2D *painter);
68 
70 
75  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
76  int legendIndex);
78 
80 
81  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
82  unsigned char a);
83  virtual void SetColor(double r, double g, double b);
84  virtual void GetColor(double rgb[3]);
86 
88 
89  vtkSetMacro(Width, float);
91 
93 
94  vtkGetMacro(Width, float);
96 
98 
101  vtkSetMacro(Offset, float);
102  vtkGetMacro(Offset, float);
104 
106 
108  virtual void SetOrientation(int orientation);
109  vtkGetMacro(Orientation, int);
111 
113  virtual void GetBounds(double bounds[4], bool unscaled);
114 
116  virtual void GetBounds(double bounds[4]);
117 
119  virtual void GetUnscaledInputBounds(double bounds[4]);
120 
122  virtual void SetInputArray(int index, const vtkStdString &name);
123 
125  void SetColorSeries(vtkColorSeries *colorSeries);
126 
129 
131 
132  virtual void SetLookupTable(vtkScalarsToColors *lut);
135 
138  virtual void CreateDefaultLookupTable();
139 
141 
143  vtkSetMacro(ScalarVisibility, bool);
144  vtkGetMacro(ScalarVisibility, bool);
145  vtkBooleanMacro(ScalarVisibility, bool);
147 
149 
152  void SelectColorArray(vtkIdType arrayNum);
153  void SelectColorArray(const vtkStdString& arrayName);
155 
158 
161 
163  virtual void SetGroupName(const vtkStdString& name);
164 
167 
169 
171  virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos,
172  vtkIdType seriesIndex,
173  vtkIdType segmentIndex);
175 
177  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
178 
179 //BTX
181 
185  const vtkVector2f& tolerance,
188 
190 
196  const vtkVector2f&,
198  vtkIdType* segmentIndex);
200 
203 
205  void GetDataBounds(double bounds[2]);
206 
207 protected:
210 
213 
216 
217  float Width;
218  float Offset;
219 
221 
224 
227 
229 
235 
236  bool LogX;
237  bool LogY;
238 
239 private:
240  vtkPlotBar(const vtkPlotBar &); // Not implemented.
241  void operator=(const vtkPlotBar &); // Not implemented.
242 
243  vtkPlotBarPrivate *Private;
244 
245 //ETX
246 };
247 
248 #endif //vtkPlotBar_h
vtkPlotBar::SetColorSeries
void SetColorSeries(vtkColorSeries *colorSeries)
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
vtkChartsCoreModule.h
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkPlotBar::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkPlotBar::GetUnscaledInputBounds
virtual void GetUnscaledInputBounds(double bounds[4])
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkPlotBar::ScalarVisibility
bool ScalarVisibility
Definition: vtkPlotBar.h:232
vtkPlotBar::Update
virtual void Update()
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkColorSeries
stores a list of colors.
Definition: vtkColorSeries.h:54
vtkPlotBar::ColorArrayName
vtkStdString ColorArrayName
Definition: vtkPlotBar.h:233
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkPlotBar::Offset
float Offset
Definition: vtkPlotBar.h:218
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkPlotBar::SelectColorArray
void SelectColorArray(vtkIdType arrayNum)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkPlotBar::GetDataBounds
void GetDataBounds(double bounds[2])
vtkSmartPointer< vtkColorSeries >
vtkPlotBar::GetColorArrayName
vtkStdString GetColorArrayName()
vtkgl::table
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: vtkgl.h:11332
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:52
vtkPlotBar::LogX
bool LogX
Definition: vtkPlotBar.h:236
vtkPlotBar::Points
vtkPoints2D * Points
Definition: vtkPlotBar.h:215
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkVector2d
Definition: vtkVector.h:287
vtkPlotBar::ColorSeries
vtkSmartPointer< vtkColorSeries > ColorSeries
Definition: vtkPlotBar.h:226
vtkPlotBar::LookupTable
vtkSmartPointer< vtkScalarsToColors > LookupTable
Definition: vtkPlotBar.h:230
vtkPlotBar
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:45
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkPlotBar::SetInputArray
virtual void SetInputArray(int index, const vtkStdString &name)
vtkPlotBar::GetNearestPoint
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
vtkPlotBar::GetColorSeries
vtkColorSeries * GetColorSeries()
vtkPlotBar::CreateDefaultLookupTable
virtual void CreateDefaultLookupTable()
vtkPlotBar::Colors
vtkSmartPointer< vtkUnsignedCharArray > Colors
Definition: vtkPlotBar.h:231
vtkPlotBar::BuildTime
vtkTimeStamp BuildTime
Definition: vtkPlotBar.h:223
vtkPlotBar::LogY
bool LogY
Definition: vtkPlotBar.h:237
vtkPlotBar::Width
float Width
Definition: vtkPlotBar.h:217
vtkPlotBar::GetLabels
virtual vtkStringArray * GetLabels()
vtkPlotBar::~vtkPlotBar
~vtkPlotBar()
vtkPlotBar::Paint
virtual bool Paint(vtkContext2D *painter)
vtkPlotBar::GetColor
virtual void GetColor(double rgb[3])
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkPlotBar::SelectPoints
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
vtkSmartPointer.h
vtkPlotBar::PaintLegend
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:63
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkPlotBar::SetColor
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkPlotBar::UpdateTableCache
bool UpdateTableCache(vtkTable *table)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkPlotBar::GetBarsCount
int GetBarsCount()
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkPlotBar::New
static vtkPlotBar * New()
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:262
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkPlotBar::SetLookupTable
virtual void SetLookupTable(vtkScalarsToColors *lut)
vtkgl::location
GLint location
Definition: vtkgl.h:12002
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:45
vtkPlotBar::SetOrientation
virtual void SetOrientation(int orientation)
vtkPlotBar::GetBounds
virtual void GetBounds(double bounds[4])
vtkPlotBar::GetNearestPoint
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &, vtkVector2f *location, vtkIdType *segmentIndex)
vtkPlotBar::GetTooltipLabel
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
VTKCHARTSCORE_EXPORT
#define VTKCHARTSCORE_EXPORT
Definition: vtkChartsCoreModule.h:15
vtkPlotBar::Orientation
int Orientation
Definition: vtkPlotBar.h:220
vtkPlotBar::SetGroupName
virtual void SetGroupName(const vtkStdString &name)
vtkPlotBar::GetLookupTable
virtual vtkScalarsToColors * GetLookupTable()
vtkPlotBar::GetBounds
virtual void GetBounds(double bounds[4], bool unscaled)
vtkPlotBar::SelectColorArray
void SelectColorArray(const vtkStdString &arrayName)
vtkRectf
Definition: vtkRect.h:97
vtkPlotBar::vtkPlotBar
vtkPlotBar()
vtkVector2f
Definition: vtkVector.h:277
vtkPlotBar::SetColor
virtual void SetColor(double r, double g, double b)
vtkPlotBar::GetGroupName
virtual vtkStdString GetGroupName()