/usr/include/vtk-5.10/vtkPlotBar.h is in libvtk5-dev 5.10.1+dfsg-2.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkPlotBar.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPlotBar - Class for drawing an XY plot given two columns from a
// vtkTable.
//
// .SECTION Description
//
#ifndef __vtkPlotBar_h
#define __vtkPlotBar_h
#include "vtkPlot.h"
#include "vtkSmartPointer.h" // Needed to hold ColorSeries
class vtkContext2D;
class vtkTable;
class vtkPoints2D;
class vtkStdString;
class vtkColorSeries;
class vtkPlotBarPrivate;
class VTK_CHARTS_EXPORT vtkPlotBar : public vtkPlot
{
public:
vtkTypeMacro(vtkPlotBar, vtkPlot);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Enum of bar chart oritentation types
enum {
VERTICAL = 0,
HORIZONTAL
};
// Description:
// Creates a 2D Chart object.
static vtkPlotBar *New();
// Description:
// Paint event for the XY plot, called whenever the chart needs to be drawn
virtual bool Paint(vtkContext2D *painter);
// Description:
// Paint legend event for the XY plot, called whenever the legend needs the
// plot items symbol/mark/line drawn. A rect is supplied with the lower left
// corner of the rect (elements 0 and 1) and with width x height (elements 2
// and 3). The plot can choose how to fill the space supplied.
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
int legendIndex);
// Description:
// Set the plot color
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
unsigned char a);
virtual void SetColor(double r, double g, double b);
virtual void GetColor(double rgb[3]);
// Description:
// Set the width of the line.
vtkSetMacro(Width, float);
// Description:
// Get the width of the line.
vtkGetMacro(Width, float);
// Description:
// Set/get the horizontal offset of the bars.
// Positive values move the bars leftward.
// For HORIZONTAL orientation, offsets bars vertically,
// with a positive value moving bars downward.
vtkSetMacro(Offset, float);
vtkGetMacro(Offset, float);
// Description:
// Set/get the orientation of the bars.
// Valid orientations are VERTICAL (default) and HORIZONTAL.
virtual void SetOrientation(int orientation);
vtkGetMacro(Orientation, int);
// Description:
// Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax).
virtual void GetBounds(double bounds[4]);
// Description:
// When used to set additional arrays, stacked bars are created.
virtual void SetInputArray(int index, const vtkStdString &name);
// Description:
// Set the color series to use if this becomes a stacked bar plot.
void SetColorSeries(vtkColorSeries *colorSeries);
// Description:
// Get the color series used if when this is a stacked bar plot.
vtkColorSeries *GetColorSeries();
// Description
// Get the plot labels.
virtual vtkStringArray *GetLabels();
// Description:
// Set the group name of the bar chart - can be displayed on the X axis.
virtual void SetGroupName(const vtkStdString& name);
// Description:
// Get the group name of the bar char - can be displayed on the X axis.
virtual vtkStdString GetGroupName();
// Description:
// Generate and return the tooltip label string for this plot
// The segmentIndex is implemented here.
virtual vtkStdString GetTooltipLabel(const vtkVector2f &plotPos,
vtkIdType seriesIndex,
vtkIdType segmentIndex);
// Description:
// Select all points in the specified rectangle.
virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
//BTX
// Description:
// Function to query a plot for the nearest point to the specified coordinate.
// Returns the index of the data series with which the point is associated or
// -1.
virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
const vtkVector2f& tolerance,
vtkVector2f* location);
// Description:
// Function to query a plot for the nearest point to the specified coordinate.
// Returns the index of the data series with which the point is associated or
// -1.
// If a vtkIdType* is passed, its referent will be set to index of the bar
// segment with which a point is associated, or -1.
virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
const vtkVector2f&,
vtkVector2f* location,
vtkIdType* segmentIndex);
protected:
vtkPlotBar();
~vtkPlotBar();
// Description:
// Update the table cache.
bool UpdateTableCache(vtkTable *table);
// Description:
// Store a well packed set of XY coordinates for this data series.
vtkPoints2D *Points;
float Width;
float Offset;
int Orientation;
// Description:
// The point cache is marked dirty until it has been initialized.
vtkTimeStamp BuildTime;
// Description:
// The color series to use if this becomes a stacked bar
vtkSmartPointer<vtkColorSeries> ColorSeries;
private:
vtkPlotBar(const vtkPlotBar &); // Not implemented.
void operator=(const vtkPlotBar &); // Not implemented.
vtkPlotBarPrivate *Private;
//ETX
};
#endif //__vtkPlotBar_h
|