VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
32 #ifndef __vtkPlotPoints_h
33 #define __vtkPlotPoints_h
34 
35 #include "vtkChartsCoreModule.h" // For export macro
36 #include "vtkPlot.h"
37 #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
38 #include "vtkStdString.h" // For color array name
39 #include "vtkNew.h" // For ivars
40 #include "vtkRenderingCoreEnums.h" // For marker enum
41 
42 class vtkCharArray;
43 class vtkContext2D;
44 class vtkTable;
45 class vtkPoints2D;
46 class vtkFloatArray;
47 class vtkStdString;
48 class vtkImageData;
49 class vtkScalarsToColors;
51 
52 class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
53 {
54 public:
55  vtkTypeMacro(vtkPlotPoints, vtkPlot);
56  virtual void PrintSelf(ostream &os, vtkIndent indent);
57 
59  static vtkPlotPoints *New();
60 
64  virtual void Update();
65 
68  virtual bool Paint(vtkContext2D *painter);
69 
71 
76  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
77  int legendIndex);
79 
81  virtual void GetBounds(double bounds[4]);
82 
85  virtual void GetUnscaledInputBounds(double bounds[4]);
86 
88 
89  void SetLookupTable(vtkScalarsToColors *lut);
90  vtkScalarsToColors *GetLookupTable();
92 
95  virtual void CreateDefaultLookupTable();
96 
98 
100  vtkSetMacro(ScalarVisibility,int);
101  vtkGetMacro(ScalarVisibility,int);
102  vtkBooleanMacro(ScalarVisibility,int);
104 
106 
109  void SelectColorArray(vtkIdType arrayNum);
110  void SelectColorArray(const vtkStdString& arrayName);
112 
114  vtkStdString GetColorArrayName();
115 
116 //BTX
118 
121  virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
122  const vtkVector2f& tolerance,
123  vtkVector2f* location);
125 
127  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
128 
130  virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon);
131 
133 
134  enum {
135  NONE = VTK_MARKER_NONE,
136  CROSS = VTK_MARKER_CROSS,
137  PLUS = VTK_MARKER_PLUS,
138  SQUARE = VTK_MARKER_SQUARE,
139  CIRCLE = VTK_MARKER_CIRCLE,
140  DIAMOND = VTK_MARKER_DIAMOND
141  };
142 //ETX
144 
146 
148  vtkGetMacro(MarkerStyle, int);
149  vtkSetMacro(MarkerStyle, int);
151 
153 
156  vtkGetMacro(MarkerSize, float);
157  vtkSetMacro(MarkerSize, float);
159 
161 
162  vtkGetMacro(ValidPointMaskName, vtkStdString)
163  vtkSetMacro(ValidPointMaskName, vtkStdString)
165 
166 //BTX
167 protected:
168  vtkPlotPoints();
169  ~vtkPlotPoints();
170 
172  bool UpdateTableCache(vtkTable *table);
173 
177  void CalculateLogSeries();
178 
182  void FindBadPoints();
183 
185  void CalculateBounds(double bounds[4]);
186 
188  void CreateSortedPoints();
189 
191 
192  vtkPoints2D *Points;
193  vtkNew<vtkFloatArray> SelectedPoints;
195 
197 
198  class VectorPIMPL;
199  VectorPIMPL* Sorted;
201 
204  vtkIdTypeArray* BadPoints;
205 
208  vtkCharArray* ValidPointMask;
209 
211  vtkStdString ValidPointMaskName;
212 
214  vtkTimeStamp BuildTime;
215 
217 
218  int MarkerStyle;
219  float MarkerSize;
221 
222  bool LogX, LogY;
223 
225 
226  vtkScalarsToColors *LookupTable;
228  int ScalarVisibility;
229  vtkStdString ColorArrayName;
231 
233  double UnscaledInputBounds[4];
234 
235 private:
236  vtkPlotPoints(const vtkPlotPoints &); // Not implemented.
237  void operator=(const vtkPlotPoints &); // Not implemented.
238 
239 // #define VTK_COLOR_MODE_DEFAULT 0
240 // #define VTK_COLOR_MODE_MAP_SCALARS 1
241 //ETX
242 };
243 
244 #endif //__vtkPlotPoints_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:52
record modification and/or execution time
Definition: vtkTimeStamp.h:34
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:43
virtual void GetBounds(double bounds[4])
Definition: vtkPlot.h:230
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:268
Superclass for mapping scalar values to colors.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:40
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
Abstract class for 2D plots.
Definition: vtkPlot.h:52
dynamic, self-adjusting array of unsigned char
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon)
virtual void GetUnscaledInputBounds(double bounds[4])
Definition: vtkPlot.h:249
virtual void PrintSelf(ostream &os, vtkIndent indent)
Allocate and hold a VTK object.
Definition: vtkNew.h:66