VTK
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkTexturedButtonRepresentation2D Class Reference

defines a representation for a vtkButtonWidget More...

#include <vtkTexturedButtonRepresentation2D.h>

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

Public Member Functions

vtkBalloonRepresentationGetBalloon ()
 
virtual void PlaceWidget (double bounds[6])
 
virtual void PlaceWidget (double anchor[3], int size[2])
 
virtual void SetProperty (vtkProperty2D *p)
 
virtual vtkProperty2DGetProperty ()
 
virtual void SetHoveringProperty (vtkProperty2D *p)
 
virtual vtkProperty2DGetHoveringProperty ()
 
virtual void SetSelectingProperty (vtkProperty2D *p)
 
virtual vtkProperty2DGetSelectingProperty ()
 
void SetButtonTexture (int i, vtkImageData *image)
 
vtkImageDataGetButtonTexture (int i)
 
virtual int ComputeInteractionState (int X, int Y, int modify=0)
 
virtual void BuildRepresentation ()
 
virtual void Highlight (int state)
 
virtual void ShallowCopy (vtkProp *prop)
 
virtual doubleGetBounds ()
 
virtual void GetActors (vtkPropCollection *pc)
 
virtual void ReleaseGraphicsResources (vtkWindow *)
 
virtual int RenderOverlay (vtkViewport *)
 
virtual int HasTranslucentPolygonalGeometry ()
 
- Public Member Functions inherited from vtkButtonRepresentation
virtual void SetNumberOfStates (int)
 
virtual int GetState ()
 
virtual void SetState (int state)
 
virtual void NextState ()
 
virtual void PreviousState ()
 
vtkButtonRepresentationNewInstance () const
 
virtual int GetHighlightState ()
 
- Public Member Functions inherited from vtkWidgetRepresentation
virtual void PickingManagedOn ()
 
virtual void PickingManagedOff ()
 
virtual void SetPickingManaged (bool)
 
virtual bool GetPickingManaged ()
 
virtual void SetRenderer (vtkRenderer *ren)
 
virtual vtkRendererGetRenderer ()
 
virtual void PlaceWidget (double *vtkNotUsed(bounds[6]))
 
virtual void StartWidgetInteraction (double eventPos[2])
 
virtual void WidgetInteraction (double newEventPos[2])
 
virtual void EndWidgetInteraction (double newEventPos[2])
 
virtual int GetInteractionState ()
 
virtual void Highlight (int vtkNotUsed(highlightOn))
 
virtual void SetPlaceFactor (double)
 
virtual double GetPlaceFactor ()
 
virtual void SetHandleSize (double)
 
virtual double GetHandleSize ()
 
virtual int GetNeedToRender ()
 
virtual void SetNeedToRender (int)
 
virtual void NeedToRenderOn ()
 
virtual void NeedToRenderOff ()
 
virtual void GetActors2D (vtkPropCollection *)
 
virtual void GetVolumes (vtkPropCollection *)
 
virtual int RenderOverlay (vtkViewport *vtkNotUsed(viewport))
 
virtual int RenderOpaqueGeometry (vtkViewport *vtkNotUsed(viewport))
 
virtual int RenderTranslucentPolygonalGeometry (vtkViewport *vtkNotUsed(viewport))
 
virtual int RenderVolumetricGeometry (vtkViewport *vtkNotUsed(viewport))
 
vtkWidgetRepresentationNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
- Public Member Functions inherited from vtkProp
vtkPropNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void Pick ()
 
virtual bool HasKeys (vtkInformation *requiredKeys)
 
virtual void BuildPaths (vtkAssemblyPaths *paths, vtkAssemblyPath *path)
 
virtual void SetVisibility (int)
 
virtual int GetVisibility ()
 
virtual void VisibilityOn ()
 
virtual void VisibilityOff ()
 
virtual void SetPickable (int)
 
virtual int GetPickable ()
 
virtual void PickableOn ()
 
virtual void PickableOff ()
 
virtual void SetDragable (int)
 
virtual int GetDragable ()
 
virtual void DragableOn ()
 
virtual void DragableOff ()
 
virtual unsigned long GetRedrawMTime ()
 
virtual void SetUseBounds (bool)
 
virtual bool GetUseBounds ()
 
virtual void UseBoundsOn ()
 
virtual void UseBoundsOff ()
 
virtual void InitPathTraversal ()
 
virtual vtkAssemblyPathGetNextPath ()
 
virtual int GetNumberOfPaths ()
 
virtual void PokeMatrix (vtkMatrix4x4 *vtkNotUsed(matrix))
 
virtual vtkMatrix4x4GetMatrix ()
 
virtual vtkInformationGetPropertyKeys ()
 
virtual void SetPropertyKeys (vtkInformation *keys)
 
virtual int RenderOpaqueGeometry (vtkViewport *)
 
virtual int RenderTranslucentPolygonalGeometry (vtkViewport *)
 
virtual int RenderVolumetricGeometry (vtkViewport *)
 
virtual bool RenderFilteredOpaqueGeometry (vtkViewport *v, vtkInformation *requiredKeys)
 
virtual bool RenderFilteredTranslucentPolygonalGeometry (vtkViewport *v, vtkInformation *requiredKeys)
 
virtual bool RenderFilteredVolumetricGeometry (vtkViewport *v, vtkInformation *requiredKeys)
 
virtual bool RenderFilteredOverlay (vtkViewport *v, vtkInformation *requiredKeys)
 
virtual double GetEstimatedRenderTime (vtkViewport *)
 
virtual double GetEstimatedRenderTime ()
 
virtual void SetEstimatedRenderTime (double t)
 
virtual void RestoreEstimatedRenderTime ()
 
virtual void AddEstimatedRenderTime (double t, vtkViewport *vtkNotUsed(vp))
 
virtual void SetAllocatedRenderTime (double t, vtkViewport *vtkNotUsed(v))
 
virtual double GetAllocatedRenderTime ()
 
void SetRenderTimeMultiplier (double t)
 
virtual double GetRenderTimeMultiplier ()
 
virtual bool GetSupportsSelection ()
 
virtual int GetNumberOfConsumers ()
 
void AddConsumer (vtkObject *c)
 
void RemoveConsumer (vtkObject *c)
 
vtkObjectGetConsumer (int i)
 
int IsConsumer (vtkObject *c)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool 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)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(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 &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkTexturedButtonRepresentation2DNew ()
 
- Static Public Member Functions inherited from vtkButtonRepresentation
static int IsTypeOf (const char *type)
 
static vtkButtonRepresentationSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkWidgetRepresentation
static int IsTypeOf (const char *type)
 
static vtkWidgetRepresentationSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkProp
static int IsTypeOf (const char *type)
 
static vtkPropSafeDownCast (vtkObjectBase *o)
 
static vtkInformationIntegerKeyGeneralTextureUnit ()
 
static vtkInformationDoubleVectorKeyGeneralTextureTransform ()
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkTexturedButtonRepresentation2D ()
 
 ~vtkTexturedButtonRepresentation2D ()
 
void CreateDefaultProperties ()
 
- Protected Member Functions inherited from vtkButtonRepresentation
 vtkButtonRepresentation ()
 
 ~vtkButtonRepresentation ()
 
- Protected Member Functions inherited from vtkWidgetRepresentation
 vtkWidgetRepresentation ()
 
 ~vtkWidgetRepresentation ()
 
void AdjustBounds (double bounds[6], double newBounds[6], double center[3])
 
virtual void RegisterPickers ()
 
virtual void UnRegisterPickers ()
 
virtual void PickersModified ()
 
vtkPickingManagerGetPickingManager ()
 
double SizeHandlesRelativeToViewport (double factor, double pos[3])
 
double SizeHandlesInPixels (double factor, double pos[3])
 
vtkAssemblyPathGetAssemblyPath (double X, double Y, double Z, vtkAbstractPropPicker *picker)
 
- Protected Member Functions inherited from vtkProp
 vtkProp ()
 
 ~vtkProp ()
 
- 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 &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkBalloonRepresentationBalloon
 
vtkProperty2DProperty
 
vtkProperty2DHoveringProperty
 
vtkProperty2DSelectingProperty
 
vtkTextureArray * TextureArray
 
vtkCoordinateAnchor
 
- Protected Attributes inherited from vtkButtonRepresentation
int NumberOfStates
 
int State
 
int HighlightState
 
- Protected Attributes inherited from vtkWidgetRepresentation
vtkWeakPointer< vtkRendererRenderer
 
int InteractionState
 
double StartEventPosition [3]
 
double PlaceFactor
 
int Placed
 
double InitialBounds [6]
 
double InitialLength
 
int ValidPick
 
bool PickingManaged
 
double HandleSize
 
int NeedToRender
 
vtkTimeStamp BuildTime
 
- Protected Attributes inherited from vtkProp
int Visibility
 
int Pickable
 
int Dragable
 
bool UseBounds
 
double AllocatedRenderTime
 
double EstimatedRenderTime
 
double SavedEstimatedRenderTime
 
double RenderTimeMultiplier
 
int NumberOfConsumers
 
vtkObject ** Consumers
 
vtkAssemblyPathsPaths
 
vtkInformationPropertyKeys
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 
typedef vtkButtonRepresentation Superclass
 
static int IsTypeOf (const char *type)
 
static vtkTexturedButtonRepresentation2DSafeDownCast (vtkObjectBase *o)
 
virtual int IsA (const char *type)
 
vtkTexturedButtonRepresentation2DNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkObjectBaseNewInstanceInternal () const
 

Additional Inherited Members

- Public Types inherited from vtkButtonRepresentation
enum  _InteractionState { Outside =0, Inside }
 
typedef vtkWidgetRepresentation Superclass
 
enum  _HighlightState { HighlightNormal, HighlightHovering, HighlightSelecting }
 
- Public Types inherited from vtkWidgetRepresentation
typedef vtkProp Superclass
 
- Public Types inherited from vtkProp
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Detailed Description

defines a representation for a vtkButtonWidget

This class implements one type of vtkButtonRepresentation. It changes the appearance of a user-provided polydata by assigning textures according to the current button state. It also provides highlighting (when hovering and selecting the button) by fiddling with the actor's property. Since this is a 2D version, the button is rendered in the overlay plane. Typically it is positioned in display coordinates, but it can be anchored to a world position so it will appear to move as the camera moves.

To use this representation, always begin by specifying the number of button states. Then provide a polydata (the polydata should have associated texture coordinates), and a list of textures cooresponding to the button states. Optionally, the HoveringProperty and SelectionProperty can be adjusted to obtain the appropriate appearance.

,SECTION Caveats There are two variants of the PlaceWidget() method. The first PlaceWidget(bds[6]) allows the widget to be placed in the display coordinates fixed to the overlay plane. The second PlaceWidget(anchor[3],size[2]) places the widget in world space; hence it will appear to move as the camera moves around the scene.

See also
vtkButtonWidget vtkButtonRepresentation vtkTexturedButtonRepresentation vtkProp3DButtonRepresentation
Tests:
vtkTexturedButtonRepresentation2D (Tests)

Definition at line 61 of file vtkTexturedButtonRepresentation2D.h.

Member Typedef Documentation

Standard methods for the class.

Definition at line 69 of file vtkTexturedButtonRepresentation2D.h.

Constructor & Destructor Documentation

vtkTexturedButtonRepresentation2D::vtkTexturedButtonRepresentation2D ( )
protected
vtkTexturedButtonRepresentation2D::~vtkTexturedButtonRepresentation2D ( )
protected

Member Function Documentation

static vtkTexturedButtonRepresentation2D* vtkTexturedButtonRepresentation2D::New ( )
static

Instantiate the class.

static int vtkTexturedButtonRepresentation2D::IsTypeOf ( const char *  type)
static

Standard methods for the class.

virtual int vtkTexturedButtonRepresentation2D::IsA ( const char *  type)
virtual

Standard methods for the class.

Reimplemented from vtkButtonRepresentation.

static vtkTexturedButtonRepresentation2D* vtkTexturedButtonRepresentation2D::SafeDownCast ( vtkObjectBase o)
static

Standard methods for the class.

virtual vtkObjectBase* vtkTexturedButtonRepresentation2D::NewInstanceInternal ( ) const
protectedvirtual

Standard methods for the class.

Reimplemented from vtkButtonRepresentation.

vtkTexturedButtonRepresentation2D* vtkTexturedButtonRepresentation2D::NewInstance ( ) const

Standard methods for the class.

void vtkTexturedButtonRepresentation2D::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Standard methods for the class.

Reimplemented from vtkButtonRepresentation.

virtual void vtkTexturedButtonRepresentation2D::SetProperty ( vtkProperty2D p)
virtual

Specify the property to use when the button is to appear "normal" i.e., the mouse pointer is not hovering or selecting the button.

virtual vtkProperty2D* vtkTexturedButtonRepresentation2D::GetProperty ( )
virtual

Specify the property to use when the button is to appear "normal" i.e., the mouse pointer is not hovering or selecting the button.

virtual void vtkTexturedButtonRepresentation2D::SetHoveringProperty ( vtkProperty2D p)
virtual

Specify the property to use when the hovering over the button.

virtual vtkProperty2D* vtkTexturedButtonRepresentation2D::GetHoveringProperty ( )
virtual

Specify the property to use when the hovering over the button.

virtual void vtkTexturedButtonRepresentation2D::SetSelectingProperty ( vtkProperty2D p)
virtual

Specify the property to use when selecting the button.

virtual vtkProperty2D* vtkTexturedButtonRepresentation2D::GetSelectingProperty ( )
virtual

Specify the property to use when selecting the button.

void vtkTexturedButtonRepresentation2D::SetButtonTexture ( int  i,
vtkImageData image 
)

Add the ith texture corresponding to the ith button state. The parameter i should be 0<=i<NumberOfStates.

vtkImageData* vtkTexturedButtonRepresentation2D::GetButtonTexture ( int  i)

Add the ith texture corresponding to the ith button state. The parameter i should be 0<=i<NumberOfStates.

vtkBalloonRepresentation* vtkTexturedButtonRepresentation2D::GetBalloon ( )
inline

Grab the underlying vtkBalloonRepresentation used to position and display the button texture.

Definition at line 101 of file vtkTexturedButtonRepresentation2D.h.

virtual int vtkTexturedButtonRepresentation2D::ComputeInteractionState ( int  X,
int  Y,
int  modify = 0 
)
virtual

Provide the necessary methods to satisfy the vtkWidgetRepresentation API.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkTexturedButtonRepresentation2D::BuildRepresentation ( )
virtual

Provide the necessary methods to satisfy the vtkWidgetRepresentation API.

Implements vtkWidgetRepresentation.

virtual void vtkTexturedButtonRepresentation2D::Highlight ( int  state)
virtual

Provide the necessary methods to satisfy the vtkWidgetRepresentation API.

Reimplemented from vtkButtonRepresentation.

virtual void vtkTexturedButtonRepresentation2D::PlaceWidget ( double  bounds[6])
virtual

Conventional PlaceWidget() method to satisfy the vtkWidgetRepresentation API. In this version, bounds[6] specifies a rectangle in display coordinates in which to place the button. The values for bounds[4] and bounds[5] can be set to zero. Note that PlaceWidget() is typically called at the end of configuring the button representation.

virtual void vtkTexturedButtonRepresentation2D::PlaceWidget ( double  anchor[3],
int  size[2] 
)
virtual

This alternative PlaceWidget() method can be used to anchor the button to a 3D point. In this case, the button representation will move around the screen as the camera moves around the world space. The first parameter anchor[3] is the world point anchor position (attached to the lower left portion of the button by default); and the size[2] parameter defines a x-y box in display coordinates in which the button will fit. Note that you can grab the vtkBalloonRepresentation and set an offset value if the anchor point is to be elsewhere on the button.

virtual void vtkTexturedButtonRepresentation2D::ShallowCopy ( vtkProp prop)
virtual

Provide the necessary methods to satisfy the rendering API.

Reimplemented from vtkButtonRepresentation.

virtual double* vtkTexturedButtonRepresentation2D::GetBounds ( )
virtual

Provide the necessary methods to satisfy the rendering API.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkTexturedButtonRepresentation2D::GetActors ( vtkPropCollection pc)
virtual

Provide the necessary methods to satisfy the rendering API.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkTexturedButtonRepresentation2D::ReleaseGraphicsResources ( vtkWindow )
virtual

Provide the necessary methods to satisfy the rendering API.

Reimplemented from vtkWidgetRepresentation.

virtual int vtkTexturedButtonRepresentation2D::RenderOverlay ( vtkViewport )
virtual

Provide the necessary methods to satisfy the rendering API.

Reimplemented from vtkProp.

virtual int vtkTexturedButtonRepresentation2D::HasTranslucentPolygonalGeometry ( )
virtual

Provide the necessary methods to satisfy the rendering API.

Reimplemented from vtkWidgetRepresentation.

void vtkTexturedButtonRepresentation2D::CreateDefaultProperties ( )
protected

Member Data Documentation

vtkBalloonRepresentation* vtkTexturedButtonRepresentation2D::Balloon
protected

Definition at line 145 of file vtkTexturedButtonRepresentation2D.h.

vtkProperty2D* vtkTexturedButtonRepresentation2D::Property
protected

Definition at line 148 of file vtkTexturedButtonRepresentation2D.h.

vtkProperty2D* vtkTexturedButtonRepresentation2D::HoveringProperty
protected

Definition at line 149 of file vtkTexturedButtonRepresentation2D.h.

vtkProperty2D* vtkTexturedButtonRepresentation2D::SelectingProperty
protected

Definition at line 150 of file vtkTexturedButtonRepresentation2D.h.

vtkTextureArray* vtkTexturedButtonRepresentation2D::TextureArray
protected

Definition at line 155 of file vtkTexturedButtonRepresentation2D.h.

vtkCoordinate* vtkTexturedButtonRepresentation2D::Anchor
protected

Definition at line 158 of file vtkTexturedButtonRepresentation2D.h.


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