VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPointHandleRepresentation2D.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 =========================================================================*/ 00032 #ifndef __vtkPointHandleRepresentation2D_h 00033 #define __vtkPointHandleRepresentation2D_h 00034 00035 #include "vtkHandleRepresentation.h" 00036 00037 class vtkProperty2D; 00038 class vtkActor2D; 00039 class vtkPolyDataMapper2D; 00040 class vtkPolyData; 00041 class vtkGlyph2D; 00042 class vtkPoints; 00043 class vtkPolyDataAlgorithm; 00044 class vtkPointPlacer; 00045 00046 class VTK_WIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation 00047 { 00048 public: 00050 static vtkPointHandleRepresentation2D *New(); 00051 00053 00054 vtkTypeMacro(vtkPointHandleRepresentation2D,vtkHandleRepresentation); 00055 void PrintSelf(ostream& os, vtkIndent indent); 00057 00059 00062 void SetCursorShape(vtkPolyData *cursorShape); 00063 vtkPolyData *GetCursorShape(); 00065 00069 virtual void SetDisplayPosition(double xyz[3]); 00070 00072 00073 void SetProperty(vtkProperty2D*); 00074 void SetSelectedProperty(vtkProperty2D*); 00075 vtkGetObjectMacro(Property,vtkProperty2D); 00076 vtkGetObjectMacro(SelectedProperty,vtkProperty2D); 00078 00080 00083 virtual double *GetBounds(); 00084 virtual void BuildRepresentation(); 00085 virtual void StartWidgetInteraction(double eventPos[2]); 00086 virtual void WidgetInteraction(double eventPos[2]); 00087 virtual int ComputeInteractionState(int X, int Y, int modify=0); 00089 00091 00092 virtual void ShallowCopy(vtkProp *prop); 00093 virtual void DeepCopy(vtkProp *prop); 00094 virtual void GetActors2D(vtkPropCollection *); 00095 virtual void ReleaseGraphicsResources(vtkWindow *); 00096 virtual int RenderOverlay(vtkViewport *viewport); 00098 00099 void Highlight(int highlight); 00100 00105 virtual void SetPointPlacer ( vtkPointPlacer * ); 00106 00107 protected: 00108 vtkPointHandleRepresentation2D(); 00109 ~vtkPointHandleRepresentation2D(); 00110 00111 // Render the cursor 00112 vtkActor2D *Actor; 00113 vtkPolyDataMapper2D *Mapper; 00114 vtkGlyph2D *Glypher; 00115 vtkPolyData *CursorShape; 00116 vtkPolyData *FocalData; 00117 vtkPoints *FocalPoint; 00118 00119 // Support picking 00120 double LastPickPosition[3]; 00121 double LastEventPosition[2]; 00122 00123 // Methods to manipulate the cursor 00124 int ConstraintAxis; 00125 void Translate(double eventPos[2]); 00126 void Scale(double eventPos[2]); 00127 00128 00129 00130 00131 // Properties used to control the appearance of selected objects and 00132 // the manipulator in general. 00133 vtkProperty2D *Property; 00134 vtkProperty2D *SelectedProperty; 00135 void CreateDefaultProperties(); 00136 00137 // The size of the hot spot. 00138 int DetermineConstraintAxis(int constraint, double eventPos[2]); 00139 int WaitingForMotion; 00140 int WaitCount; 00141 00142 private: 00143 vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&); //Not implemented 00144 void operator=(const vtkPointHandleRepresentation2D&); //Not implemented 00145 }; 00146 00147 #endif