00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00032 #ifndef __vtkPlotPoints_h
00033 #define __vtkPlotPoints_h
00034
00035 #include "vtkPlot.h"
00036 #include "vtkScalarsToColors.h"
00037 #include "vtkStdString.h"
00038
00039 class vtkContext2D;
00040 class vtkTable;
00041 class vtkPoints2D;
00042 class vtkStdString;
00043 class vtkImageData;
00044 class vtkScalarsToColors;
00045 class vtkUnsignedCharArray;
00046
00047 class VTK_CHARTS_EXPORT vtkPlotPoints : public vtkPlot
00048 {
00049 public:
00050 vtkTypeMacro(vtkPlotPoints, vtkPlot);
00051 virtual void PrintSelf(ostream &os, vtkIndent indent);
00052
00054 static vtkPlotPoints *New();
00055
00059 virtual void Update();
00060
00063 virtual bool Paint(vtkContext2D *painter);
00064
00066
00071 virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
00072 int legendIndex);
00074
00076 virtual void GetBounds(double bounds[4]);
00077
00079
00080 void SetLookupTable(vtkScalarsToColors *lut);
00081 vtkScalarsToColors *GetLookupTable();
00083
00086 virtual void CreateDefaultLookupTable();
00087
00089
00091 vtkSetMacro(ScalarVisibility,int);
00092 vtkGetMacro(ScalarVisibility,int);
00093 vtkBooleanMacro(ScalarVisibility,int);
00095
00097
00100 void SelectColorArray(vtkIdType arrayNum);
00101 void SelectColorArray(const vtkStdString& arrayName);
00103
00105 vtkStdString GetColorArrayName();
00106
00107
00109
00112 virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00113 const vtkVector2f& tolerance,
00114 vtkVector2f* location);
00116
00118 virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
00119
00121
00122 enum {
00123 NONE = 0,
00124 CROSS,
00125 PLUS,
00126 SQUARE,
00127 CIRCLE,
00128 DIAMOND
00129 };
00130
00132
00134
00136 vtkGetMacro(MarkerStyle, int);
00137 vtkSetMacro(MarkerStyle, int);
00139
00141
00144 vtkGetMacro(MarkerSize, float);
00145 vtkSetMacro(MarkerSize, float);
00147
00148
00149 protected:
00150 vtkPlotPoints();
00151 ~vtkPlotPoints();
00152
00154 void GeneraterMarker(int width, bool highlight = false);
00155
00157 bool UpdateTableCache(vtkTable *table);
00158
00162 void CalculateLogSeries();
00163
00167 void FindBadPoints();
00168
00170 void CalculateBounds(double bounds[4]);
00171
00173 void CreateSortedPoints();
00174
00176 vtkPoints2D *Points;
00177
00179
00180 class VectorPIMPL;
00181 VectorPIMPL* Sorted;
00183
00186 vtkIdTypeArray* BadPoints;
00187
00189 vtkTimeStamp BuildTime;
00190
00192
00193 int MarkerStyle;
00194 float MarkerSize;
00195 vtkImageData* Marker;
00196 vtkImageData* HighlightMarker;
00198
00199 bool LogX, LogY;
00200
00202
00203 vtkScalarsToColors *LookupTable;
00204 vtkUnsignedCharArray *Colors;
00205 int ScalarVisibility;
00206 vtkStdString ColorArrayName;
00208
00209 private:
00210 vtkPlotPoints(const vtkPlotPoints &);
00211 void operator=(const vtkPlotPoints &);
00212
00213
00214
00215
00216 };
00217
00218 #endif //__vtkPlotPoints_h