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