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   void Highlight(int highlight);
00097 
00102   virtual void SetPointPlacer ( vtkPointPlacer * );
00103   
00104 protected:
00105   vtkPointHandleRepresentation2D();
00106   ~vtkPointHandleRepresentation2D();
00107 
00108   // Render the cursor
00109   vtkActor2D           *Actor;
00110   vtkPolyDataMapper2D  *Mapper;
00111   vtkGlyph2D           *Glypher;
00112   vtkPolyData          *CursorShape;
00113   vtkPolyData          *FocalData;
00114   vtkPoints            *FocalPoint;
00115 
00116   // Support picking
00117   double LastPickPosition[3];
00118   double LastEventPosition[2];
00119   
00120   // Methods to manipulate the cursor
00121   int  ConstraintAxis;
00122   void Translate(double eventPos[2]);
00123   void Scale(double eventPos[2]);
00124 
00125 
00126 
00127 
00128   // Properties used to control the appearance of selected objects and
00129   // the manipulator in general.
00130   vtkProperty2D *Property;
00131   vtkProperty2D *SelectedProperty;
00132   void           CreateDefaultProperties();
00133   
00134   // The size of the hot spot.
00135   int    DetermineConstraintAxis(int constraint, double eventPos[2]);
00136   int    WaitingForMotion;
00137   int    WaitCount;
00138   
00139 private:
00140   vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&);  //Not implemented
00141   void operator=(const vtkPointHandleRepresentation2D&);  //Not implemented
00142 };
00143 
00144 #endif