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 vtkContext2D;
00043 class vtkTable;
00044 class vtkPoints2D;
00045 class vtkFloatArray;
00046 class vtkStdString;
00047 class vtkImageData;
00048 class vtkScalarsToColors;
00049 class vtkUnsignedCharArray;
00050 
00051 class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
00052 {
00053 public:
00054   vtkTypeMacro(vtkPlotPoints, vtkPlot);
00055   virtual void PrintSelf(ostream &os, vtkIndent indent);
00056 
00058   static vtkPlotPoints *New();
00059 
00063   virtual void Update();
00064 
00067   virtual bool Paint(vtkContext2D *painter);
00068 
00070 
00075   virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
00076                            int legendIndex);
00078 
00080   virtual void GetBounds(double bounds[4]);
00081 
00084   virtual void GetUnscaledInputBounds(double bounds[4]);
00085 
00087 
00088   void SetLookupTable(vtkScalarsToColors *lut);
00089   vtkScalarsToColors *GetLookupTable();
00091 
00094   virtual void CreateDefaultLookupTable();
00095 
00097 
00099   vtkSetMacro(ScalarVisibility,int);
00100   vtkGetMacro(ScalarVisibility,int);
00101   vtkBooleanMacro(ScalarVisibility,int);
00103 
00105 
00108   void SelectColorArray(vtkIdType arrayNum);
00109   void SelectColorArray(const vtkStdString& arrayName);
00111 
00113   vtkStdString GetColorArrayName();
00114 
00115 //BTX
00117 
00120   virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00121                                     const vtkVector2f& tolerance,
00122                                     vtkVector2f* location);
00124 
00126   virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
00127 
00129   virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon);
00130 
00132 
00133   enum {
00134     NONE = VTK_MARKER_NONE,
00135     CROSS = VTK_MARKER_CROSS,
00136     PLUS = VTK_MARKER_PLUS,
00137     SQUARE = VTK_MARKER_SQUARE,
00138     CIRCLE = VTK_MARKER_CIRCLE,
00139     DIAMOND = VTK_MARKER_DIAMOND
00140   };
00141 //ETX
00143 
00145 
00147   vtkGetMacro(MarkerStyle, int);
00148   vtkSetMacro(MarkerStyle, int);
00150 
00152 
00155   vtkGetMacro(MarkerSize, float);
00156   vtkSetMacro(MarkerSize, float);
00158 
00159 //BTX
00160 protected:
00161   vtkPlotPoints();
00162   ~vtkPlotPoints();
00163 
00165   bool UpdateTableCache(vtkTable *table);
00166 
00170   void CalculateLogSeries();
00171 
00175   void FindBadPoints();
00176 
00178   void CalculateBounds(double bounds[4]);
00179 
00181   void CreateSortedPoints();
00182 
00184 
00185   vtkPoints2D *Points;
00186   vtkNew<vtkFloatArray> SelectedPoints;
00188 
00190 
00191   class VectorPIMPL;
00192   VectorPIMPL* Sorted;
00194 
00197   vtkIdTypeArray* BadPoints;
00198 
00200   vtkTimeStamp BuildTime;
00201 
00203 
00204   int MarkerStyle;
00205   float MarkerSize;
00207 
00208   bool LogX, LogY;
00209 
00211 
00212   vtkScalarsToColors *LookupTable;
00213   vtkUnsignedCharArray *Colors;
00214   int ScalarVisibility;
00215   vtkStdString ColorArrayName;
00217 
00219   double UnscaledInputBounds[4];
00220 
00221 private:
00222   vtkPlotPoints(const vtkPlotPoints &); // Not implemented.
00223   void operator=(const vtkPlotPoints &); // Not implemented.
00224 
00225 // #define  VTK_COLOR_MODE_DEFAULT   0
00226 // #define  VTK_COLOR_MODE_MAP_SCALARS   1
00227 //ETX
00228 };
00229 
00230 #endif //__vtkPlotPoints_h