VTK
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkPointPlacer Class Reference

Abstract interface to translate 2D display positions to world coordinates. More...

#include <vtkPointPlacer.h>

Inheritance diagram for vtkPointPlacer:
[legend]
Collaboration diagram for vtkPointPlacer:
[legend]

List of all members.

- Public Types inherited from vtkObject

Public Member Functions

virtual int ValidateWorldPosition (double worldPos[3])
virtual int ValidateDisplayPosition (vtkRenderer *, double displayPos[2])
virtual int UpdateInternalState ()
virtual int ComputeWorldPosition (vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9])
virtual int ComputeWorldPosition (vtkRenderer *ren, double displayPos[2], double refWorldPos[3], double worldPos[3], double worldOrient[9])
virtual int ValidateWorldPosition (double worldPos[3], double worldOrient[9])
virtual int UpdateWorldPosition (vtkRenderer *ren, double worldPos[3], double worldOrient[9])
virtual void SetPixelTolerance (int)
virtual int GetPixelTolerance ()
virtual void SetWorldTolerance (double)
virtual double GetWorldTolerance ()
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
virtual void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char debugFlag)
virtual void Modified ()
virtual unsigned long GetMTime ()
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
vtkCommandGetCommand (unsigned long tag)
void RemoveObserver (vtkCommand *)
void RemoveObservers (unsigned long event, vtkCommand *)
void RemoveObservers (const char *event, vtkCommand *)
int HasObserver (unsigned long event, vtkCommand *)
int HasObserver (const char *event, vtkCommand *)
void RemoveObserver (unsigned long tag)
void RemoveObservers (unsigned long event)
void RemoveObservers (const char *event)
void RemoveAllObservers ()
int HasObserver (unsigned long event)
int HasObserver (const char *event)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
int InvokeEvent (unsigned long event, void *callData)
int InvokeEvent (const char *event, void *callData)
int InvokeEvent (unsigned long event)
int InvokeEvent (const char *event)
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
virtual void Delete ()
virtual void FastDelete ()
void Print (ostream &os)
virtual void Register (vtkObjectBase *o)
virtual void UnRegister (vtkObjectBase *o)
void SetReferenceCount (int)
void PrintRevisions (ostream &os)
virtual void PrintHeader (ostream &os, vtkIndent indent)
virtual void PrintTrailer (ostream &os, vtkIndent indent)
int GetReferenceCount ()

Static Public Member Functions

static vtkPointPlacerNew ()
- Static Public Member Functions inherited from vtkObject
static void BreakOnError ()
static void SetGlobalWarningDisplay (int val)
static void GlobalWarningDisplayOn ()
static void GlobalWarningDisplayOff ()
static int GetGlobalWarningDisplay ()

Protected Member Functions

 vtkPointPlacer ()
 ~vtkPointPlacer ()
- Protected Member Functions inherited from vtkObject
 vtkObject ()
virtual ~vtkObject ()
virtual void RegisterInternal (vtkObjectBase *, int check)
virtual void UnRegisterInternal (vtkObjectBase *, int check)
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
void InternalReleaseFocus ()
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
virtual ~vtkObjectBase ()
virtual void CollectRevisions (ostream &os)
virtual void ReportReferences (vtkGarbageCollector *)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)

Protected Attributes

int PixelTolerance
double WorldTolerance
- Protected Attributes inherited from vtkObject
unsigned char Debug
vtkTimeStamp MTime
vtkSubjectHelper * SubjectHelper
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
vtkWeakPointerBase ** WeakPointers
typedef vtkObject Superclass
static int IsTypeOf (const char *type)
static vtkPointPlacerSafeDownCast (vtkObject *o)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)

Additional Inherited Members


Detailed Description

Abstract interface to translate 2D display positions to world coordinates.

Most widgets in VTK have a need to translate of 2D display coordinates (as reported by the RenderWindowInteractor) to 3D world coordinates. This class is an abstraction of this functionality. A few subclasses are listed below:

1) vtkFocalPlanePointPlacer: This class converts 2D display positions to world positions such that they lie on the focal plane.

2) vtkPolygonalSurfacePointPlacer: Converts 2D display positions to world positions such that they lie on the surface of one or more specified polydatas.

3) vtkImageActorPointPlacer: Converts 2D display positions to world positions such that they lie on an ImageActor

4) vtkBoundedPlanePointPlacer: Converts 2D display positions to world positions such that they lie within a set of specified bounding planes.

5) vtkTerrainDataPointPlacer: Converts 2D display positions to world positions such that they lie on a height field.

Point placers provide an extensible framework to specify constraints on points. The methods ComputeWorldPosition, ValidateDisplayPosition and ValidateWorldPosition may be overridden to dictate whether a world or display position is allowed. These classes are currently used by the HandleWidget and the ContourWidget to allow various constraints to be enforced on the placement of their handles.

Definition at line 47 of file vtkPointPlacer.h.


Member Typedef Documentation


Constructor & Destructor Documentation

vtkPointPlacer::vtkPointPlacer ( )
protected
vtkPointPlacer::~vtkPointPlacer ( )
protected

Member Function Documentation

static vtkPointPlacer* vtkPointPlacer::New ( )
static
virtual const char* vtkPointPlacer::GetClassName ( )
virtual
static int vtkPointPlacer::IsTypeOf ( const char *  type)
static
virtual int vtkPointPlacer::IsA ( const char *  type)
virtual
static vtkPointPlacer* vtkPointPlacer::SafeDownCast ( vtkObject o)
static
void vtkPointPlacer::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual
virtual int vtkPointPlacer::ComputeWorldPosition ( vtkRenderer ren,
double  displayPos[2],
double  worldPos[3],
double  worldOrient[9] 
)
virtual

Given a renderer and a display position in pixel coordinates, compute the world position and orientation where this point will be placed. This method is typically used by the representation to place the point initially. A return value of 1 indicates that constraints of the placer are met.

Reimplemented in vtkBoundedPlanePointPlacer, vtkTerrainDataPointPlacer, vtkPolygonalSurfacePointPlacer, vtkClosedSurfacePointPlacer, vtkPolyDataPointPlacer, vtkImageActorPointPlacer, and vtkFocalPlanePointPlacer.

virtual int vtkPointPlacer::ComputeWorldPosition ( vtkRenderer ren,
double  displayPos[2],
double  refWorldPos[3],
double  worldPos[3],
double  worldOrient[9] 
)
virtual

Given a renderer, a display position, and a reference world position, compute the new world position and orientation of this point. This method is typically used by the representation to move the point. A return value of 1 indicates that constraints of the placer are met.

Reimplemented in vtkBoundedPlanePointPlacer, vtkTerrainDataPointPlacer, vtkPolygonalSurfacePointPlacer, vtkPolyDataPointPlacer, and vtkFocalPlanePointPlacer.

virtual int vtkPointPlacer::ValidateWorldPosition ( double  worldPos[3])
virtual

Given a world position check the validity of this position according to the constraints of the placer.

Reimplemented in vtkBoundedPlanePointPlacer, vtkTerrainDataPointPlacer, vtkPolygonalSurfacePointPlacer, vtkClosedSurfacePointPlacer, vtkPolyDataPointPlacer, vtkImageActorPointPlacer, and vtkFocalPlanePointPlacer.

virtual int vtkPointPlacer::ValidateDisplayPosition ( vtkRenderer ,
double  displayPos[2] 
)
virtual

Given a display position, check the validity of this position.

Reimplemented in vtkTerrainDataPointPlacer, vtkPolygonalSurfacePointPlacer, and vtkPolyDataPointPlacer.

virtual int vtkPointPlacer::ValidateWorldPosition ( double  worldPos[3],
double  worldOrient[9] 
)
virtual

Given a world position and a world orientation, validate it according to the constraints of the placer.

Reimplemented in vtkBoundedPlanePointPlacer, vtkTerrainDataPointPlacer, vtkPolygonalSurfacePointPlacer, vtkClosedSurfacePointPlacer, vtkPolyDataPointPlacer, vtkImageActorPointPlacer, and vtkFocalPlanePointPlacer.

virtual int vtkPointPlacer::UpdateWorldPosition ( vtkRenderer ren,
double  worldPos[3],
double  worldOrient[9] 
)
virtual

Given a current renderer, world position and orientation, update them according to the constraints of the placer. This method is typically used when UpdateContour is called on the representation, which must be called after changes are made to the constraints in the placer. A return value of 1 indicates that the point has been updated. A return value of 0 indicates that the point could not be updated and was left alone. By default this is a no-op - leaving the point as is.

Reimplemented in vtkBoundedPlanePointPlacer, and vtkImageActorPointPlacer.

virtual int vtkPointPlacer::UpdateInternalState ( )
inlinevirtual

Called by the representation to give the placer a chance to update itself.

Reimplemented in vtkImageActorPointPlacer.

Definition at line 113 of file vtkPointPlacer.h.

virtual void vtkPointPlacer::SetPixelTolerance ( int  )
virtual

Set/get the tolerance used when performing computations in display coordinates.

virtual int vtkPointPlacer::GetPixelTolerance ( )
virtual

Set/get the tolerance used when performing computations in display coordinates.

virtual void vtkPointPlacer::SetWorldTolerance ( double  )
virtual

Set/get the tolerance used when performing computations in world coordinates.

Reimplemented in vtkImageActorPointPlacer.

virtual double vtkPointPlacer::GetWorldTolerance ( )
virtual

Set/get the tolerance used when performing computations in world coordinates.


Member Data Documentation

int vtkPointPlacer::PixelTolerance
protected

Definition at line 133 of file vtkPointPlacer.h.

double vtkPointPlacer::WorldTolerance
protected

Definition at line 134 of file vtkPointPlacer.h.


The documentation for this class was generated from the following file: