VTK
vtkPlotPoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotPoints.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 
33 #ifndef vtkPlotPoints_h
34 #define vtkPlotPoints_h
35 
36 #include "vtkChartsCoreModule.h" // For export macro
37 #include "vtkPlot.h"
38 #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
39 #include "vtkStdString.h" // For color array name
40 #include "vtkNew.h" // For ivars
41 #include "vtkRenderingCoreEnums.h" // For marker enum
42 
43 class vtkCharArray;
44 class vtkContext2D;
45 class vtkTable;
46 class vtkPoints2D;
47 class vtkFloatArray;
48 class vtkStdString;
49 class vtkImageData;
50 class vtkScalarsToColors;
52 
53 class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
54 {
55 public:
56  vtkTypeMacro(vtkPlotPoints, vtkPlot);
57  virtual void PrintSelf(ostream &os, vtkIndent indent);
58 
62  static vtkPlotPoints *New();
63 
69  virtual void Update();
70 
74  virtual bool Paint(vtkContext2D *painter);
75 
82  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
83  int legendIndex);
84 
88  virtual void GetBounds(double bounds[4]);
89 
93  virtual void GetUnscaledInputBounds(double bounds[4]);
94 
96 
102 
107  virtual void CreateDefaultLookupTable();
108 
110 
113  vtkSetMacro(ScalarVisibility,int);
114  vtkGetMacro(ScalarVisibility,int);
115  vtkBooleanMacro(ScalarVisibility,int);
117 
119 
124  void SelectColorArray(vtkIdType arrayNum);
125  void SelectColorArray(const vtkStdString& arrayName);
127 
132 
139  const vtkVector2f& tolerance,
141 
145  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
146 
150  virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon);
151 
155  enum {
161  DIAMOND = VTK_MARKER_DIAMOND
162  };
163 
165 
169  vtkGetMacro(MarkerStyle, int);
170  vtkSetMacro(MarkerStyle, int);
172 
174 
178  vtkGetMacro(MarkerSize, float);
179  vtkSetMacro(MarkerSize, float);
181 
183 
186  vtkGetMacro(ValidPointMaskName, vtkStdString)
187  vtkSetMacro(ValidPointMaskName, vtkStdString)
189 
190 protected:
193 
197  bool GetDataArrays(vtkTable *table, vtkDataArray *array[2]);
198 
202  bool UpdateTableCache(vtkTable *table);
203 
207  void CalculateUnscaledInputBounds();
208 
213  void CalculateLogSeries();
214 
220  void FindBadPoints();
221 
225  void CalculateBounds(double bounds[4]);
226 
230  void CreateSortedPoints();
231 
233 
236  vtkPoints2D *Points;
237  vtkNew<vtkFloatArray> SelectedPoints;
239 
241 
244  class VectorPIMPL;
245  VectorPIMPL* Sorted;
247 
252  vtkIdTypeArray* BadPoints;
253 
258  vtkCharArray* ValidPointMask;
259 
263  vtkStdString ValidPointMaskName;
264 
269 
271 
274  int MarkerStyle;
275  float MarkerSize;
277 
278  bool LogX, LogY;
279 
281 
284  vtkScalarsToColors *LookupTable;
286  int ScalarVisibility;
287  vtkStdString ColorArrayName;
289 
293  double UnscaledInputBounds[4];
294 
295 private:
296  vtkPlotPoints(const vtkPlotPoints &) VTK_DELETE_FUNCTION;
297  void operator=(const vtkPlotPoints &) VTK_DELETE_FUNCTION;
298 
299 // #define VTK_COLOR_MODE_DEFAULT 0
300 // #define VTK_COLOR_MODE_MAP_SCALARS 1
301 
302 };
303 
304 #endif //vtkPlotPoints_h
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:37
vtkStdString.h
vtkPlotPoints::GetBounds
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
vtkPlotPoints::New
static vtkPlotPoints * New()
Creates a 2D Chart object.
vtkPlotPoints::SelectPoints
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkPlotPoints::SelectPointsInPolygon
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon)
Select all points in the specified polygon.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:42
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:53
vtkPlotPoints::SelectColorArray
void SelectColorArray(vtkIdType arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
vtkPlotPoints::GetNearestPoint
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
Function to query a plot for the nearest point to the specified coordinate.
vtkRenderingCoreEnums.h
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkCharArray
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:39
vtkPlotPoints::GetUnscaledInputBounds
virtual void GetUnscaledInputBounds(double bounds[4])
Get the non-log-scaled bounds on chart inputs for this plot as (Xmin, Xmax, Ymin, Ymax).
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkPlotPoints::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkPlotPoints::SetLookupTable
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
vtkPlotPoints::GetLookupTable
vtkScalarsToColors * GetLookupTable()
vtkPlotPoints::GetColorArrayName
vtkStdString GetColorArrayName()
Get the array name to color by.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkScalarsToColors.h
vtkPlotPoints::SelectColorArray
void SelectColorArray(const vtkStdString &arrayName)
VTK_MARKER_CIRCLE
@ VTK_MARKER_CIRCLE
Definition: vtkRenderingCoreEnums.h:26
vtkPlotPoints::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the XY plot, called whenever the chart needs to be drawn.
VTK_MARKER_PLUS
@ VTK_MARKER_PLUS
Definition: vtkRenderingCoreEnums.h:24
vtkNew
Allocate and hold a VTK object.
Definition: vtkNew.h:68
VTK_MARKER_CROSS
@ VTK_MARKER_CROSS
Definition: vtkRenderingCoreEnums.h:23
vtkContextPolygon
Definition: vtkContextPolygon.h:27
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:67
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkPlotPoints
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:54
vtkPlotPoints::PaintLegend
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
Paint legend event for the XY plot, called whenever the legend needs the plot items symbol/mark/line ...
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkNew.h
vtkPlotPoints::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
vtkX3D::location
@ location
Definition: vtkX3D.h:406
vtkPlotPoints::CreateDefaultLookupTable
virtual void CreateDefaultLookupTable()
Create default lookup table.
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
VTK_MARKER_DIAMOND
@ VTK_MARKER_DIAMOND
Definition: vtkRenderingCoreEnums.h:27
vtkRectf
Definition: vtkRect.h:297
vtkVector2f
Definition: vtkVector.h:338
VTK_MARKER_NONE
@ VTK_MARKER_NONE
Definition: vtkRenderingCoreEnums.h:22
VTK_MARKER_SQUARE
@ VTK_MARKER_SQUARE
Definition: vtkRenderingCoreEnums.h:25
BuildTime
vtkTimeStamp BuildTime
Updates the extensions string.
Definition: vtkOpenGLExtensionManager.h:390