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