VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Charts/Core/vtkScatterPlotMatrix.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkScatterPlotMatrix.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 
00028 #ifndef vtkScatterPlotMatrix_h
00029 #define vtkScatterPlotMatrix_h
00030 
00031 #include "vtkChartsCoreModule.h" // For export macro
00032 #include "vtkChartMatrix.h"
00033 #include "vtkSmartPointer.h" // For ivars
00034 #include "vtkNew.h"          // For ivars
00035 #include "vtkColor.h"        // For member function return
00036 #include "vtkStdString.h"    // For ivars
00037 
00038 class vtkStringArray;
00039 class vtkTable;
00040 class vtkAxis;
00041 class vtkAnnotationLink;
00042 class vtkTextProperty;
00043 class vtkTooltipItem;
00044 class vtkRenderWindowInteractor;
00045 
00046 class VTKCHARTSCORE_EXPORT vtkScatterPlotMatrix : public vtkChartMatrix
00047 {
00048 public:
00049   enum {
00050     SCATTERPLOT,
00051     HISTOGRAM,
00052     ACTIVEPLOT,
00053     NOPLOT
00054   };
00055 
00056   vtkTypeMacro(vtkScatterPlotMatrix, vtkChartMatrix);
00057   virtual void PrintSelf(ostream &os, vtkIndent indent);
00058 
00060   static vtkScatterPlotMatrix *New();
00061 
00064   virtual void Update();
00065 
00067   virtual bool Paint(vtkContext2D *painter);
00068 
00072   virtual bool SetActivePlot(const vtkVector2i& position);
00073 
00075   virtual vtkVector2i GetActivePlot();
00076 
00080   VTK_LEGACY(vtkAnnotationLink* GetActiveAnnotationLink());
00081 
00084   vtkAnnotationLink* GetAnnotationLink();
00085 
00089   virtual void SetInput(vtkTable *table);
00090 
00092   void SetColumnVisibility(const vtkStdString& name, bool visible);
00093 
00096   void InsertVisibleColumn(const vtkStdString& name, int index);
00097 
00099   bool GetColumnVisibility(const vtkStdString& name);
00100 
00103   void SetColumnVisibilityAll(bool visible);
00104 
00106   virtual vtkStringArray* GetVisibleColumns();
00107 
00110   virtual void SetVisibleColumns(vtkStringArray* visColumns);
00111 
00114   virtual void SetNumberOfBins(int numberOfBins);
00115 
00118   virtual int GetNumberOfBins() const { return this->NumberOfBins; }
00119 
00121   void SetPlotColor(int plotType, const vtkColor4ub& color);
00122 
00124   void SetPlotMarkerStyle(int plotType, int style);
00125 
00127   void SetPlotMarkerSize(int plotType, float size);
00128 
00130   bool Hit(const vtkContextMouseEvent &mouse);
00131 
00133   bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00134 
00136   bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00137 
00139   bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
00140 
00142 
00144   int GetPlotType(const vtkVector2i &pos);
00145   int GetPlotType(int row, int column);
00147 
00149 
00150   void SetTitle(const vtkStdString& title);
00151   vtkStdString GetTitle();
00153 
00155 
00157   void SetTitleProperties(vtkTextProperty *prop);
00158   vtkTextProperty* GetTitleProperties();
00160 
00162 
00165   void SetGridVisibility(int plotType, bool visible);
00166   bool GetGridVisibility(int plotType);
00168 
00170 
00172   void SetBackgroundColor(int plotType, const vtkColor4ub& color);
00173   vtkColor4ub GetBackgroundColor(int plotType);
00175 
00177 
00179   void SetAxisColor(int plotType, const vtkColor4ub& color);
00180   vtkColor4ub GetAxisColor(int plotType);
00182 
00184 
00186   void SetGridColor(int plotType, const vtkColor4ub& color);
00187   vtkColor4ub GetGridColor(int plotType);
00189 
00191 
00194   void SetAxisLabelVisibility(int plotType, bool visible);
00195   bool GetAxisLabelVisibility(int plotType);
00197 
00199 
00202   void SetAxisLabelProperties(int plotType, vtkTextProperty *prop);
00203   vtkTextProperty* GetAxisLabelProperties(int plotType);
00205 
00207 
00209   void SetAxisLabelNotation(int plotType, int notation);
00210   int GetAxisLabelNotation(int plotType);
00212 
00214 
00216   void SetAxisLabelPrecision(int plotType, int precision);
00217   int GetAxisLabelPrecision(int plotType);
00219 
00221 
00223   void SetTooltipNotation(int plotType, int notation);
00224   void SetTooltipPrecision(int plotType, int precision);
00225   int GetTooltipNotation(int plotType);
00226   int GetTooltipPrecision(int plotType);
00228 
00231   void SetTooltip(vtkTooltipItem *tooltip);
00232 
00235   vtkTooltipItem* GetTooltip() const;
00236 
00238   void SetIndexedLabels(vtkStringArray *labels);
00239 
00241   vtkStringArray* GetIndexedLabels() const;
00242 
00244 
00245   void SetScatterPlotSelectedRowColumnColor(const vtkColor4ub& color);
00246   vtkColor4ub GetScatterPlotSelectedRowColumnColor();
00248 
00250 
00251   void SetScatterPlotSelectedActiveColor(const vtkColor4ub& color);
00252   vtkColor4ub GetScatterPlotSelectedActiveColor();
00254 
00256   void UpdateSettings();
00257 
00259   void UpdateChartSettings(int plotType);
00260 
00262 
00266   virtual void SetSelectionMode(int);
00267   vtkGetMacro(SelectionMode, int);
00269 
00271   vtkStdString GetColumnName(int column);
00272 
00274   vtkStdString GetRowName(int row);
00275 
00278   void SetNumberOfFrames(int frames);
00279 
00282   int GetNumberOfFrames();
00283 
00285   void ClearAnimationPath();
00286 
00290   bool AddAnimationPath(const vtkVector2i &move);
00291 
00293   vtkIdType GetNumberOfAnimationPathElements();
00294 
00296   vtkVector2i GetAnimationPathElement(vtkIdType i);
00297 
00299   bool BeginAnimationPath(vtkRenderWindowInteractor* interactor);
00300 
00303   virtual void AdvanceAnimation();
00304 
00306   virtual vtkChart * GetMainChart();
00307 
00308 protected:
00309   vtkScatterPlotMatrix();
00310   ~vtkScatterPlotMatrix();
00311 
00314   void UpdateLayout();
00315 
00317 
00319   void AttachAxisRangeListener(vtkAxis*);
00320   void AxisRangeForwarderCallback(vtkObject*, unsigned long, void*);
00322 
00325   void BigChartSelectionCallback(vtkObject*, unsigned long, void*);
00326 
00329   virtual void UpdateAnimationPath(const vtkVector2i& newActivePos);
00330 
00333   virtual void StartAnimation(vtkRenderWindowInteractor* interactor);
00334 
00336 
00337   static void ProcessEvents(vtkObject *caller, unsigned long event,
00338                             void *clientData, void *callerData);
00340 
00341   // The position of the active plot (defaults to 0, 1).
00342   vtkVector2i ActivePlot;
00343 
00344   // Weakly owned input data for the scatter plot matrix.
00345   vtkSmartPointer<vtkTable> Input;
00346 
00347   // Strongly owned internal data for the column visibility.
00348   vtkNew<vtkStringArray> VisibleColumns;
00349 
00350   // The number of bins in the histograms.
00351   int NumberOfBins;
00352 
00353   // The title of the scatter plot matrix.
00354   vtkStdString Title;
00355   vtkSmartPointer<vtkTextProperty> TitleProperties;
00356 
00357   // The mode when the chart is doing selection.
00358   int SelectionMode;
00359 
00360   // How many frames should animations consist of, 0 means no transitions.
00361   int NumberOfFrames;
00362 
00363 private:
00364   vtkScatterPlotMatrix(const vtkScatterPlotMatrix &); // Not implemented.
00365   void operator=(const vtkScatterPlotMatrix &); // Not implemented.
00366 
00367   class PIMPL;
00368   PIMPL *Private;
00369   friend class PIMPL;
00370 
00371   // Go through the process of calculating axis ranges, etc...
00372   void UpdateAxes();
00373   void ApplyAxisSetting(vtkChart *chart, const vtkStdString &x,
00374                         const vtkStdString &y);
00375 };
00376 
00377 #endif //vtkScatterPlotMatrix_h