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