VTK
vtkSphereHandleRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSphereHandleRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef vtkSphereHandleRepresentation_h
31 #define vtkSphereHandleRepresentation_h
32 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 #include "vtkSphereSource.h" // Needed for delegation to sphere
36 
37 class vtkSphereSource;
38 class vtkProperty;
39 class vtkActor;
40 class vtkPolyDataMapper;
41 class vtkCellPicker;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkSphereHandleRepresentation
45 {
46 public:
51 
53 
57  void PrintSelf(ostream& os, vtkIndent indent);
59 
61 
68  virtual void SetWorldPosition(double p[3]);
69  virtual void SetDisplayPosition(double p[3]);
71 
73 
81  vtkSetMacro(TranslationMode,int);
82  vtkGetMacro(TranslationMode,int);
83  vtkBooleanMacro(TranslationMode,int);
85 
86  void SetSphereRadius(double);
87  double GetSphereRadius();
88 
90 
95  vtkGetObjectMacro(Property,vtkProperty);
96  vtkGetObjectMacro(SelectedProperty,vtkProperty);
98 
100 
106  vtkSetClampMacro(HotSpotSize,double,0.0,1.0);
107  vtkGetMacro(HotSpotSize,double);
109 
114  virtual void SetHandleSize(double size);
115 
117 
120  virtual double *GetBounds();
121  virtual void BuildRepresentation();
122  virtual void StartWidgetInteraction(double eventPos[2]);
123  virtual void WidgetInteraction(double eventPos[2]);
124  virtual int ComputeInteractionState(int X, int Y, int modify=0);
125  virtual void PlaceWidget(double bounds[6]);
127 
129 
132  virtual void ShallowCopy(vtkProp *prop);
133  virtual void DeepCopy(vtkProp *prop);
134  virtual void GetActors(vtkPropCollection *);
136  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
140 
141  void Highlight(int highlight);
142 protected:
145 
146  // the cursor3D
150  // void Highlight(int highlight);
151 
152  // Do the picking
154  double LastPickPosition[3];
155  double LastEventPosition[2];
156 
157  // Register internal Pickers within PickingManager
158  virtual void RegisterPickers();
159 
160  // Methods to manipulate the cursor
162  void Translate(double *p1, double *p2);
163  void Scale(double *p1, double *p2, double eventPos[2]);
164  void MoveFocus(double *p1, double *p2);
165  void SizeBounds();
166 
167  // Properties used to control the appearance of selected objects and
168  // the manipulator in general.
172 
173  // The size of the hot spot.
174  double HotSpotSize;
175  int DetermineConstraintAxis(int constraint, double *x);
178 
179  // Current handle sized (may reflect scaling)
181 
182  // Control how translation works
184 
185 private:
187  void operator=(const vtkSphereHandleRepresentation&) VTK_DELETE_FUNCTION;
188 };
189 
190 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:43
vtkSphereHandleRepresentation::SetProperty
void SetProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
vtkSphereHandleRepresentation::vtkSphereHandleRepresentation
vtkSphereHandleRepresentation()
vtkSphereHandleRepresentation::MoveFocus
void MoveFocus(double *p1, double *p2)
vtkSphereHandleRepresentation::GetSphereRadius
double GetSphereRadius()
vtkSphereHandleRepresentation::GetBounds
virtual double * GetBounds()
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkSphereHandleRepresentation::ConstraintAxis
int ConstraintAxis
Definition: vtkSphereHandleRepresentation.h:161
vtkSphereHandleRepresentation::CurrentHandleSize
double CurrentHandleSize
Definition: vtkSphereHandleRepresentation.h:180
vtkSphereHandleRepresentation::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkSphereHandleRepresentation.h:148
vtkSphereHandleRepresentation::CursorPicker
vtkCellPicker * CursorPicker
Definition: vtkSphereHandleRepresentation.h:153
vtkSphereHandleRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:59
vtkSphereHandleRepresentation::Sphere
vtkSphereSource * Sphere
Definition: vtkSphereHandleRepresentation.h:149
vtkSphereHandleRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkSphereHandleRepresentation::New
static vtkSphereHandleRepresentation * New()
Instantiate this class.
vtkHandleRepresentation.h
vtkSphereHandleRepresentation::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
Methods to make this class behave as a vtkProp.
vtkSphereHandleRepresentation::TranslationMode
int TranslationMode
Definition: vtkSphereHandleRepresentation.h:183
vtkSphereHandleRepresentation::Actor
vtkActor * Actor
Definition: vtkSphereHandleRepresentation.h:147
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSphereHandleRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkSphereHandleRepresentation::DeepCopy
virtual void DeepCopy(vtkProp *prop)
vtkSphereHandleRepresentation::SetSphereRadius
void SetSphereRadius(double)
vtkSphereHandleRepresentation::WaitingForMotion
int WaitingForMotion
Definition: vtkSphereHandleRepresentation.h:176
vtkSphereHandleRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkSphereHandleRepresentation::SizeBounds
void SizeBounds()
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:47
vtkSphereHandleRepresentation
A spherical rendition of point in 3D space.
Definition: vtkSphereHandleRepresentation.h:45
vtkSphereHandleRepresentation::PlaceWidget
virtual void PlaceWidget(double bounds[6])
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSphereHandleRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkSphereHandleRepresentation::SetWorldPosition
virtual void SetWorldPosition(double p[3])
Set the position of the point in world and display coordinates.
vtkSphereSource.h
vtkSphereHandleRepresentation::Highlight
void Highlight(int highlight)
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkSphereHandleRepresentation::HotSpotSize
double HotSpotSize
Definition: vtkSphereHandleRepresentation.h:174
vtkSphereHandleRepresentation::~vtkSphereHandleRepresentation
~vtkSphereHandleRepresentation()
vtkSphereHandleRepresentation::Property
vtkProperty * Property
Definition: vtkSphereHandleRepresentation.h:169
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
vtkSphereHandleRepresentation::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
vtkSphereHandleRepresentation::SelectedProperty
vtkProperty * SelectedProperty
Definition: vtkSphereHandleRepresentation.h:170
vtkSphereHandleRepresentation::Translate
void Translate(double *p1, double *p2)
vtkSphereHandleRepresentation::GetActors
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkSphereHandleRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkSphereHandleRepresentation::RegisterPickers
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
vtkSphereHandleRepresentation::WaitCount
int WaitCount
Definition: vtkSphereHandleRepresentation.h:177
vtkSphereHandleRepresentation::SetHandleSize
virtual void SetHandleSize(double size)
Overload the superclasses SetHandleSize() method to update internal variables.
vtkSphereHandleRepresentation::Scale
void Scale(double *p1, double *p2, double eventPos[2])
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:65
vtkSphereHandleRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkSphereHandleRepresentation::SetDisplayPosition
virtual void SetDisplayPosition(double p[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:39
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:70
vtkSphereHandleRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkSphereHandleRepresentation::CreateDefaultProperties
void CreateDefaultProperties()
vtkSphereHandleRepresentation::DetermineConstraintAxis
int DetermineConstraintAxis(int constraint, double *x)
vtkSphereHandleRepresentation::SetSelectedProperty
void SetSelectedProperty(vtkProperty *)