VTK
dox/Charts/Core/vtkPlotPoints.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPlotPoints.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00032 #ifndef __vtkPlotPoints_h
00033 #define __vtkPlotPoints_h
00034 
00035 #include "vtkChartsCoreModule.h" // For export macro
00036 #include "vtkPlot.h"
00037 #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
00038 #include "vtkStdString.h"       // For color array name
00039 #include "vtkNew.h"             // For ivars
00040 #include "vtkRenderingCoreEnums.h" // For marker enum
00041 
00042 class vtkCharArray;
00043 class vtkContext2D;
00044 class vtkTable;
00045 class vtkPoints2D;
00046 class vtkFloatArray;
00047 class vtkStdString;
00048 class vtkImageData;
00049 class vtkScalarsToColors;
00050 class vtkUnsignedCharArray;
00051 
00052 class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
00053 {
00054 public:
00055   vtkTypeMacro(vtkPlotPoints, vtkPlot);
00056   virtual void PrintSelf(ostream &os, vtkIndent indent);
00057 
00059   static vtkPlotPoints *New();
00060 
00064   virtual void Update();
00065 
00068   virtual bool Paint(vtkContext2D *painter);
00069 
00071 
00076   virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
00077                            int legendIndex);
00079 
00081   virtual void GetBounds(double bounds[4]);
00082 
00085   virtual void GetUnscaledInputBounds(double bounds[4]);
00086 
00088 
00089   void SetLookupTable(vtkScalarsToColors *lut);
00090   vtkScalarsToColors *GetLookupTable();
00092 
00095   virtual void CreateDefaultLookupTable();
00096 
00098 
00100   vtkSetMacro(ScalarVisibility,int);
00101   vtkGetMacro(ScalarVisibility,int);
00102   vtkBooleanMacro(ScalarVisibility,int);
00104 
00106 
00109   void SelectColorArray(vtkIdType arrayNum);
00110   void SelectColorArray(const vtkStdString& arrayName);
00112 
00114   vtkStdString GetColorArrayName();
00115 
00116 //BTX
00118 
00121   virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00122                                     const vtkVector2f& tolerance,
00123                                     vtkVector2f* location);
00125 
00127   virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
00128 
00130   virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon);
00131 
00133 
00134   enum {
00135     NONE = VTK_MARKER_NONE,
00136     CROSS = VTK_MARKER_CROSS,
00137     PLUS = VTK_MARKER_PLUS,
00138     SQUARE = VTK_MARKER_SQUARE,
00139     CIRCLE = VTK_MARKER_CIRCLE,
00140     DIAMOND = VTK_MARKER_DIAMOND
00141   };
00142 //ETX
00144 
00146 
00148   vtkGetMacro(MarkerStyle, int);
00149   vtkSetMacro(MarkerStyle, int);
00151 
00153 
00156   vtkGetMacro(MarkerSize, float);
00157   vtkSetMacro(MarkerSize, float);
00159 
00161 
00162   vtkGetMacro(ValidPointMaskName, vtkStdString)
00163   vtkSetMacro(ValidPointMaskName, vtkStdString)
00165 
00166 //BTX
00167 protected:
00168   vtkPlotPoints();
00169   ~vtkPlotPoints();
00170 
00172   bool GetDataArrays(vtkTable *table, vtkDataArray *array[2]);
00173 
00175   bool UpdateTableCache(vtkTable *table);
00176 
00178   void CalculateUnscaledInputBounds();
00179 
00183   void CalculateLogSeries();
00184 
00188   void FindBadPoints();
00189 
00191   void CalculateBounds(double bounds[4]);
00192 
00194   void CreateSortedPoints();
00195 
00197 
00198   vtkPoints2D *Points;
00199   vtkNew<vtkFloatArray> SelectedPoints;
00201 
00203 
00204   class VectorPIMPL;
00205   VectorPIMPL* Sorted;
00207 
00210   vtkIdTypeArray* BadPoints;
00211 
00214   vtkCharArray* ValidPointMask;
00215 
00217   vtkStdString ValidPointMaskName;
00218 
00220   vtkTimeStamp BuildTime;
00221 
00223 
00224   int MarkerStyle;
00225   float MarkerSize;
00227 
00228   bool LogX, LogY;
00229 
00231 
00232   vtkScalarsToColors *LookupTable;
00233   vtkUnsignedCharArray *Colors;
00234   int ScalarVisibility;
00235   vtkStdString ColorArrayName;
00237 
00239   double UnscaledInputBounds[4];
00240 
00241 private:
00242   vtkPlotPoints(const vtkPlotPoints &); // Not implemented.
00243   void operator=(const vtkPlotPoints &); // Not implemented.
00244 
00245 // #define  VTK_COLOR_MODE_DEFAULT   0
00246 // #define  VTK_COLOR_MODE_MAP_SCALARS   1
00247 //ETX
00248 };
00249 
00250 #endif //__vtkPlotPoints_h