VTK
dox/Views/Infovis/vtkParallelCoordinatesView.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   Visualization Toolkit
00004 Module:    vtkParallelCoordinatesView.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 /*-------------------------------------------------------------------------
00016   Copyright 2009 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00044 #ifndef __vtkParallelCoordinatesView_h
00045 #define __vtkParallelCoordinatesView_h
00046 
00047 #include "vtkViewsInfovisModule.h" // For export macro
00048 #include <vtkRenderView.h>
00049 
00050 class vtkActor2D;
00051 class vtkOutlineSource;
00052 class vtkParallelCoordinatesRepresentation;
00053 class vtkPolyData;
00054 class vtkPolyDataMapper2D;
00055 
00056 class VTKVIEWSINFOVIS_EXPORT vtkParallelCoordinatesView : public vtkRenderView
00057 {
00058 public:
00059   vtkTypeMacro(vtkParallelCoordinatesView, vtkRenderView);
00060   static vtkParallelCoordinatesView *New();
00061   void PrintSelf(ostream &os, vtkIndent indent);
00062 
00063   //BTX
00064   enum {VTK_BRUSH_LASSO=0,VTK_BRUSH_ANGLE,VTK_BRUSH_FUNCTION,VTK_BRUSH_AXISTHRESHOLD,VTK_BRUSH_MODECOUNT};
00065   enum {VTK_BRUSHOPERATOR_ADD=0,VTK_BRUSHOPERATOR_SUBTRACT,VTK_BRUSHOPERATOR_INTERSECT,VTK_BRUSHOPERATOR_REPLACE,VTK_BRUSHOPERATOR_MODECOUNT};
00066   enum {VTK_INSPECT_MANIPULATE_AXES=0, VTK_INSPECT_SELECT_DATA, VTK_INSPECT_MODECOUNT};
00067   //ETX
00068 
00069   void SetBrushMode(int);
00070   void SetBrushModeToLasso() { this->SetBrushMode(VTK_BRUSH_LASSO); }
00071   void SetBrushModeToAngle() { this->SetBrushMode(VTK_BRUSH_ANGLE); }
00072   void SetBrushModeToFunction() { this->SetBrushMode(VTK_BRUSH_FUNCTION); }
00073   void SetBrushModeToAxisThreshold() { this->SetBrushMode(VTK_BRUSH_AXISTHRESHOLD); }
00074   vtkGetMacro(BrushMode,int);
00075 
00076   void SetBrushOperator(int);
00077   void SetBrushOperatorToAdd() { this->SetBrushOperator(VTK_BRUSHOPERATOR_ADD); }
00078   void SetBrushOperatorToSubtract() { this->SetBrushOperator(VTK_BRUSHOPERATOR_SUBTRACT); }
00079   void SetBrushOperatorToIntersect() { this->SetBrushOperator(VTK_BRUSHOPERATOR_INTERSECT); }
00080   void SetBrushOperatorToReplace() { this->SetBrushOperator(VTK_BRUSHOPERATOR_REPLACE); }
00081   vtkGetMacro(BrushOperator,int);
00082 
00083   void SetInspectMode(int);
00084   void SetInspectModeToManipulateAxes() { this->SetInspectMode(VTK_INSPECT_MANIPULATE_AXES); }
00085   void SetInpsectModeToSelectData() { this->SetInspectMode(VTK_INSPECT_SELECT_DATA); }
00086   vtkGetMacro(InspectMode,int);
00087 
00088   void SetMaximumNumberOfBrushPoints(int);
00089   vtkGetMacro(MaximumNumberOfBrushPoints,int);
00090 
00091   vtkSetMacro(CurrentBrushClass,int);
00092   vtkGetMacro(CurrentBrushClass,int);
00093 
00094   virtual void ApplyViewTheme(vtkViewTheme* theme);
00095 
00096 protected:
00097   vtkParallelCoordinatesView();
00098   virtual ~vtkParallelCoordinatesView();
00099 
00100   int SelectedAxisPosition;
00101   //BTX
00102   enum {VTK_HIGHLIGHT_CENTER=0,VTK_HIGHLIGHT_MIN,VTK_HIGHLIGHT_MAX};
00103   vtkSmartPointer<vtkOutlineSource> HighlightSource;
00104   vtkSmartPointer<vtkPolyDataMapper2D> HighlightMapper;
00105   vtkSmartPointer<vtkActor2D> HighlightActor;
00106   //ETX
00107 
00108   int InspectMode;
00109   int BrushMode;
00110   int BrushOperator;
00111   int MaximumNumberOfBrushPoints;
00112   int NumberOfBrushPoints;
00113   int CurrentBrushClass;
00114   //BTX
00115   vtkSmartPointer<vtkPolyData> BrushData;
00116   vtkSmartPointer<vtkPolyDataMapper2D> BrushMapper;
00117   vtkSmartPointer<vtkActor2D> BrushActor;
00118   //ETX
00119 
00120   int FirstFunctionBrushLineDrawn;
00121   int AxisHighlightPosition;
00122 
00123   vtkTimeStamp WorldBuildTime;
00124   bool RebuildNeeded;
00125 
00126   virtual void ProcessEvents(vtkObject *caller, unsigned long event, void *callData);
00127   virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
00128 
00129   void PrepareForRendering();
00130 
00132 
00133   void Hover(unsigned long event);
00134   void ManipulateAxes(unsigned long event);
00135   void SelectData(unsigned long event);
00136   void Zoom(unsigned long event);
00137   void Pan(unsigned long event);
00139 
00141   int SetAxisHighlightPosition(vtkParallelCoordinatesRepresentation* rep, int position);
00142 
00144   int SetAxisHighlightPosition(vtkParallelCoordinatesRepresentation* rep, double position);
00145 
00146   int AddLassoBrushPoint(double *p);
00147   int SetBrushLine(int line, double *p1, double *p2);
00148   void GetBrushLine(int line, vtkIdType &npts, vtkIdType* &ptids);
00149   int SetAngleBrushLine(double *p1, double *p2);
00150   int SetFunctionBrushLine1(double *p1, double *p2);
00151   int SetFunctionBrushLine2(double *p1, double *p2);
00152   void ClearBrushPoints();
00153 
00154 
00155 private:
00156   vtkParallelCoordinatesView(const vtkParallelCoordinatesView&); // Not implemented
00157   void operator=(const vtkParallelCoordinatesView&); // Not implemented
00158 
00159 };
00160 
00161 #endif