VTK
dox/Widgets/vtkPointHandleRepresentation2D.h
Go to the documentation of this file.
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 =========================================================================*/
00029 #ifndef __vtkPointHandleRepresentation2D_h
00030 #define __vtkPointHandleRepresentation2D_h
00031 
00032 #include "vtkHandleRepresentation.h"
00033 
00034 class vtkProperty2D;
00035 class vtkActor2D;
00036 class vtkPolyDataMapper2D;
00037 class vtkPolyData;
00038 class vtkGlyph2D;
00039 class vtkPoints;
00040 class vtkPolyDataAlgorithm;
00041 class vtkPointPlacer;
00042 
00043 class VTK_WIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
00044 {
00045 public:
00047   static vtkPointHandleRepresentation2D *New();
00048 
00050 
00051   vtkTypeMacro(vtkPointHandleRepresentation2D,vtkHandleRepresentation);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056 
00059   void SetCursorShape(vtkPolyData *cursorShape);
00060   vtkPolyData *GetCursorShape();
00062 
00066   virtual void SetDisplayPosition(double xyz[3]);
00067 
00069 
00070   void SetProperty(vtkProperty2D*);
00071   void SetSelectedProperty(vtkProperty2D*);
00072   vtkGetObjectMacro(Property,vtkProperty2D);
00073   vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
00075   
00077 
00080   virtual double *GetBounds();
00081   virtual void BuildRepresentation();
00082   virtual void StartWidgetInteraction(double eventPos[2]);
00083   virtual void WidgetInteraction(double eventPos[2]);
00084   virtual int ComputeInteractionState(int X, int Y, int modify=0);
00086 
00088 
00089   virtual void ShallowCopy(vtkProp *prop);
00090   virtual void DeepCopy(vtkProp *prop);
00091   virtual void GetActors2D(vtkPropCollection *);
00092   virtual void ReleaseGraphicsResources(vtkWindow *);
00093   virtual int RenderOverlay(vtkViewport *viewport);
00095   
00096 protected:
00097   vtkPointHandleRepresentation2D();
00098   ~vtkPointHandleRepresentation2D();
00099 
00100   // Render the cursor
00101   vtkActor2D           *Actor;
00102   vtkPolyDataMapper2D  *Mapper;
00103   vtkGlyph2D           *Glypher;
00104   vtkPolyData          *CursorShape;
00105   vtkPolyData          *FocalData;
00106   vtkPoints            *FocalPoint;
00107 
00108   // Support picking
00109   double LastPickPosition[3];
00110   double LastEventPosition[2];
00111   
00112   // Methods to manipulate the cursor
00113   int  ConstraintAxis;
00114   void Translate(double eventPos[2]);
00115   void Scale(double eventPos[2]);
00116   void Highlight(int highlight);
00117 
00123   virtual void SetPointPlacer( vtkPointPlacer * ); 
00124 
00125   // Properties used to control the appearance of selected objects and
00126   // the manipulator in general.
00127   vtkProperty2D *Property;
00128   vtkProperty2D *SelectedProperty;
00129   void           CreateDefaultProperties();
00130   
00131   // The size of the hot spot.
00132   int    DetermineConstraintAxis(int constraint, double eventPos[2]);
00133   int    WaitingForMotion;
00134   int    WaitCount;
00135   
00136 private:
00137   vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&);  //Not implemented
00138   void operator=(const vtkPointHandleRepresentation2D&);  //Not implemented
00139 };
00140 
00141 #endif