VTK
Public Member Functions | Protected Member Functions | Protected Attributes
vtkDynamic2DLabelMapper Class Reference

draw text labels at 2D dataset points More...

#include <vtkDynamic2DLabelMapper.h>

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

List of all members.

- Public Types inherited from vtkLabeledDataMapper
enum  Coordinates { WORLD = 0, DISPLAY = 1 }
 Coordinate systems that output dataset may use. More...
- Public Types inherited from vtkMapper2D
- Public Types inherited from vtkAbstractMapper
- Public Types inherited from vtkAlgorithm
- Public Types inherited from vtkObject

Public Member Functions

void SetPriorityArrayName (const char *name)
virtual void SetReversePriority (bool)
virtual bool GetReversePriority ()
virtual void ReversePriorityOn ()
virtual void ReversePriorityOff ()
virtual void SetLabelHeightPadding (float)
virtual float GetLabelHeightPadding ()
virtual void SetLabelWidthPadding (float)
virtual float GetLabelWidthPadding ()
void RenderOpaqueGeometry (vtkViewport *viewport, vtkActor2D *actor)
void RenderOverlay (vtkViewport *viewport, vtkActor2D *actor)
- Public Member Functions inherited from vtkLabeledDataMapper
virtual void SetInput (vtkDataObject *)
vtkDataSetGetInput ()
virtual void ReleaseGraphicsResources (vtkWindow *)
virtual unsigned long GetMTime ()
virtual void SetLabelFormat (const char *)
virtual char * GetLabelFormat ()
virtual void SetLabeledComponent (int)
virtual int GetLabeledComponent ()
void SetFieldDataArray (int arrayIndex)
virtual int GetFieldDataArray ()
void SetFieldDataName (const char *arrayName)
virtual char * GetFieldDataName ()
virtual void SetLabelMode (int)
virtual int GetLabelMode ()
void SetLabelModeToLabelIds ()
void SetLabelModeToLabelScalars ()
void SetLabelModeToLabelVectors ()
void SetLabelModeToLabelNormals ()
void SetLabelModeToLabelTCoords ()
void SetLabelModeToLabelTensors ()
void SetLabelModeToLabelFieldData ()
virtual void SetLabelTextProperty (vtkTextProperty *p)
virtual vtkTextPropertyGetLabelTextProperty ()
virtual void SetLabelTextProperty (vtkTextProperty *p, int type)
virtual vtkTextPropertyGetLabelTextProperty (int type)
virtual vtkTransformGetTransform ()
void SetTransform (vtkTransform *t)
virtual int GetCoordinateSystem ()
virtual void SetCoordinateSystem (int)
void CoordinateSystemWorld ()
void CoordinateSystemDisplay ()
- Public Member Functions inherited from vtkMapper2D
virtual void RenderTranslucentPolygonalGeometry (vtkViewport *, vtkActor2D *)
virtual int HasTranslucentPolygonalGeometry ()
- Public Member Functions inherited from vtkAbstractMapper
void SetClippingPlanes (vtkPlanes *planes)
void ShallowCopy (vtkAbstractMapper *m)
virtual double GetTimeToDraw ()
void AddClippingPlane (vtkPlane *plane)
void RemoveClippingPlane (vtkPlane *plane)
void RemoveAllClippingPlanes ()
virtual void SetClippingPlanes (vtkPlaneCollection *)
virtual vtkPlaneCollectionGetClippingPlanes ()
- Public Member Functions inherited from vtkAlgorithm
int HasExecutive ()
vtkExecutiveGetExecutive ()
virtual void SetExecutive (vtkExecutive *executive)
virtual int ModifyRequest (vtkInformation *request, int when)
vtkInformationGetInputPortInformation (int port)
vtkInformationGetOutputPortInformation (int port)
int GetNumberOfInputPorts ()
int GetNumberOfOutputPorts ()
void UpdateProgress (double amount)
vtkInformationGetInputArrayInformation (int idx)
void RemoveAllInputs ()
vtkDataObjectGetOutputDataObject (int port)
virtual void RemoveInputConnection (int port, vtkAlgorithmOutput *input)
int GetNumberOfInputConnections (int port)
int GetTotalNumberOfInputConnections ()
vtkAlgorithmOutputGetInputConnection (int port, int index)
virtual void Update ()
virtual void UpdateInformation ()
virtual void UpdateWholeExtent ()
void ConvertTotalInputToPortConnection (int ind, int &port, int &conn)
virtual double ComputePriority ()
virtual int ProcessRequest (vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
int ProcessRequest (vtkInformation *request, vtkCollection *inInfo, vtkInformationVector *outInfo)
virtual int ComputePipelineMTime (vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime)
virtual vtkInformationGetInformation ()
virtual void SetInformation (vtkInformation *)
virtual void Register (vtkObjectBase *o)
virtual void UnRegister (vtkObjectBase *o)
virtual void SetAbortExecute (int)
virtual int GetAbortExecute ()
virtual void AbortExecuteOn ()
virtual void AbortExecuteOff ()
virtual void SetProgress (double)
virtual double GetProgress ()
void SetProgressText (const char *ptext)
virtual char * GetProgressText ()
virtual unsigned long GetErrorCode ()
virtual void SetInputArrayToProcess (int idx, int port, int connection, int fieldAssociation, const char *name)
virtual void SetInputArrayToProcess (int idx, int port, int connection, int fieldAssociation, int fieldAttributeType)
virtual void SetInputArrayToProcess (int idx, vtkInformation *info)
virtual void SetInputArrayToProcess (int idx, int port, int connection, const char *fieldAssociation, const char *attributeTypeorName)
vtkDataObjectGetInputDataObject (int port, int connection)
virtual void SetInputConnection (int port, vtkAlgorithmOutput *input)
virtual void SetInputConnection (vtkAlgorithmOutput *input)
virtual void AddInputConnection (int port, vtkAlgorithmOutput *input)
virtual void AddInputConnection (vtkAlgorithmOutput *input)
vtkAlgorithmOutputGetOutputPort (int index)
vtkAlgorithmOutputGetOutputPort ()
virtual void SetReleaseDataFlag (int)
virtual int GetReleaseDataFlag ()
void ReleaseDataFlagOn ()
void ReleaseDataFlagOff ()
int UpdateExtentIsEmpty (vtkDataObject *output)
int UpdateExtentIsEmpty (vtkInformation *pinfo, int extentType)
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
virtual void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char debugFlag)
virtual void Modified ()
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)
void SetReferenceCount (int)
void PrintRevisions (ostream &os)
virtual void PrintHeader (ostream &os, vtkIndent indent)
virtual void PrintTrailer (ostream &os, vtkIndent indent)
int GetReferenceCount ()

Protected Member Functions

 vtkDynamic2DLabelMapper ()
 ~vtkDynamic2DLabelMapper ()
double GetCurrentScale (vtkViewport *viewport)
- Protected Member Functions inherited from vtkLabeledDataMapper
 vtkLabeledDataMapper ()
 ~vtkLabeledDataMapper ()
virtual int FillInputPortInformation (int, vtkInformation *)
void AllocateLabels (int numLabels)
void BuildLabels ()
void BuildLabelsInternal (vtkDataSet *)
- Protected Member Functions inherited from vtkMapper2D
 vtkMapper2D ()
 ~vtkMapper2D ()
- Protected Member Functions inherited from vtkAbstractMapper
 vtkAbstractMapper ()
 ~vtkAbstractMapper ()
- Protected Member Functions inherited from vtkAlgorithm
 vtkAlgorithm ()
 ~vtkAlgorithm ()
virtual int FillOutputPortInformation (int port, vtkInformation *info)
virtual void SetNumberOfInputPorts (int n)
virtual void SetNumberOfOutputPorts (int n)
int InputPortIndexInRange (int index, const char *action)
int OutputPortIndexInRange (int index, const char *action)
int GetInputArrayAssociation (int idx, vtkInformationVector **inputVector)
virtual vtkExecutiveCreateDefaultExecutive ()
virtual void ReportReferences (vtkGarbageCollector *)
virtual void SetNumberOfInputConnections (int port, int n)
int GetInputArrayAssociation (int idx, int connection, vtkInformationVector **inputVector)
int GetInputArrayAssociation (int idx, vtkDataObject *input)
vtkDataArrayGetInputArrayToProcess (int idx, vtkInformationVector **inputVector)
vtkDataArrayGetInputArrayToProcess (int idx, vtkInformationVector **inputVector, int &association)
vtkDataArrayGetInputArrayToProcess (int idx, int connection, vtkInformationVector **inputVector)
vtkDataArrayGetInputArrayToProcess (int idx, int connection, vtkInformationVector **inputVector, int &association)
vtkDataArrayGetInputArrayToProcess (int idx, vtkDataObject *input)
vtkDataArrayGetInputArrayToProcess (int idx, vtkDataObject *input, int &association)
vtkAbstractArrayGetInputAbstractArrayToProcess (int idx, vtkInformationVector **inputVector)
vtkAbstractArrayGetInputAbstractArrayToProcess (int idx, vtkInformationVector **inputVector, int &association)
vtkAbstractArrayGetInputAbstractArrayToProcess (int idx, int connection, vtkInformationVector **inputVector)
vtkAbstractArrayGetInputAbstractArrayToProcess (int idx, int connection, vtkInformationVector **inputVector, int &association)
vtkAbstractArrayGetInputAbstractArrayToProcess (int idx, vtkDataObject *input)
vtkAbstractArrayGetInputAbstractArrayToProcess (int idx, vtkDataObject *input, int &association)
vtkInformationGetInputArrayFieldInformation (int idx, vtkInformationVector **inputVector)
virtual void SetNthInputConnection (int port, int index, vtkAlgorithmOutput *input)
virtual void SetErrorCode (unsigned long)
- 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)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)

Protected Attributes

float * LabelWidth
float * LabelHeight
float * Cutoff
float ReferenceScale
float LabelHeightPadding
float LabelWidthPadding
bool ReversePriority
- Protected Attributes inherited from vtkLabeledDataMapper
vtkDataSetInput
char * LabelFormat
int LabelMode
int LabeledComponent
int FieldDataArray
char * FieldDataName
int CoordinateSystem
vtkTimeStamp BuildTime
int NumberOfLabels
int NumberOfLabelsAllocated
vtkTextMapper ** TextMappers
double * LabelPositions
vtkTransformTransform
Internals * Implementation
typedef vtkLabeledDataMapper Superclass
static vtkDynamic2DLabelMapperNew ()
static int IsTypeOf (const char *type)
static vtkDynamic2DLabelMapperSafeDownCast (vtkObject *o)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)

Additional Inherited Members


Detailed Description

draw text labels at 2D dataset points

vtkDynamic2DLabelMapper is a mapper that renders text at dataset points such that the labels do not overlap. Various items can be labeled including point ids, scalars, vectors, normals, texture coordinates, tensors, and field data components. This mapper assumes that the points are located on the x-y plane and that the camera remains perpendicular to that plane with a y-up axis (this can be constrained using vtkImageInteractor). On the first render, the mapper computes the visiblility of all labels at all scales, and queries this information on successive renders. This causes the first render to be much slower. The visibility algorithm is a greedy approach based on the point id, so the label for a point will be drawn unless the label for a point with lower id overlaps it.

Warning:
Use this filter in combination with vtkSelectVisiblePoints if you want to label only points that are visible. If you want to label cells rather than points, use the filter vtkCellCenters to generate points at the center of the cells. Also, you can use the class vtkIdFilter to generate ids as scalars or field data, which can then be labeled.
See also:
vtkLabeledDataMapper
Thanks:
This algorithm was developed in the paper Ken Been and Chee Yap. Dynamic Map Labeling. IEEE Transactions on Visualization and Computer Graphics, Vol. 12, No. 5, 2006. pp. 773-780.
Events:
vtkCommand::ProgressEvent
Examples:
vtkDynamic2DLabelMapper (Examples)
Tests:
vtkDynamic2DLabelMapper (Tests)

Definition at line 66 of file vtkDynamic2DLabelMapper.h.


Member Typedef Documentation

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

Definition at line 73 of file vtkDynamic2DLabelMapper.h.


Constructor & Destructor Documentation

vtkDynamic2DLabelMapper::vtkDynamic2DLabelMapper ( )
protected
vtkDynamic2DLabelMapper::~vtkDynamic2DLabelMapper ( )
protected

Member Function Documentation

static vtkDynamic2DLabelMapper* vtkDynamic2DLabelMapper::New ( )
static

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

virtual const char* vtkDynamic2DLabelMapper::GetClassName ( )
virtual

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

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

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

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

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

static vtkDynamic2DLabelMapper* vtkDynamic2DLabelMapper::SafeDownCast ( vtkObject o)
static

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

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

Instantiate object with %%-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkLabeledDataMapper.

void vtkDynamic2DLabelMapper::SetPriorityArrayName ( const char *  name)

Set the points array name to use to give priority to labels. Defaults to "priority".

virtual void vtkDynamic2DLabelMapper::SetReversePriority ( bool  )
virtual

Whether to reverse the priority order (i.e. low values have high priority). Default is off.

virtual bool vtkDynamic2DLabelMapper::GetReversePriority ( )
virtual

Whether to reverse the priority order (i.e. low values have high priority). Default is off.

virtual void vtkDynamic2DLabelMapper::ReversePriorityOn ( )
virtual

Whether to reverse the priority order (i.e. low values have high priority). Default is off.

virtual void vtkDynamic2DLabelMapper::ReversePriorityOff ( )
virtual

Whether to reverse the priority order (i.e. low values have high priority). Default is off.

virtual void vtkDynamic2DLabelMapper::SetLabelHeightPadding ( float  )
virtual

Set the label height padding as a percentage. The percentage is a percentage of your label height. Default is 50%.

virtual float vtkDynamic2DLabelMapper::GetLabelHeightPadding ( )
virtual

Set the label height padding as a percentage. The percentage is a percentage of your label height. Default is 50%.

virtual void vtkDynamic2DLabelMapper::SetLabelWidthPadding ( float  )
virtual

Set the label width padding as a percentage. The percentage is a percentage of your label ^height^ (yes, not a typo). Default is 50%.

virtual float vtkDynamic2DLabelMapper::GetLabelWidthPadding ( )
virtual

Set the label width padding as a percentage. The percentage is a percentage of your label ^height^ (yes, not a typo). Default is 50%.

void vtkDynamic2DLabelMapper::RenderOpaqueGeometry ( vtkViewport viewport,
vtkActor2D actor 
)
virtual

Draw non-overlapping labels to the screen.

Reimplemented from vtkLabeledDataMapper.

void vtkDynamic2DLabelMapper::RenderOverlay ( vtkViewport viewport,
vtkActor2D actor 
)
virtual

Draw non-overlapping labels to the screen.

Reimplemented from vtkLabeledDataMapper.

double vtkDynamic2DLabelMapper::GetCurrentScale ( vtkViewport viewport)
protected

Calculate the current zoom scale of the viewport.


Member Data Documentation

float* vtkDynamic2DLabelMapper::LabelWidth
protected

Definition at line 116 of file vtkDynamic2DLabelMapper.h.

float* vtkDynamic2DLabelMapper::LabelHeight
protected

Definition at line 117 of file vtkDynamic2DLabelMapper.h.

float* vtkDynamic2DLabelMapper::Cutoff
protected

Definition at line 118 of file vtkDynamic2DLabelMapper.h.

float vtkDynamic2DLabelMapper::ReferenceScale
protected

Definition at line 119 of file vtkDynamic2DLabelMapper.h.

float vtkDynamic2DLabelMapper::LabelHeightPadding
protected

Definition at line 120 of file vtkDynamic2DLabelMapper.h.

float vtkDynamic2DLabelMapper::LabelWidthPadding
protected

Definition at line 121 of file vtkDynamic2DLabelMapper.h.

bool vtkDynamic2DLabelMapper::ReversePriority
protected

Definition at line 123 of file vtkDynamic2DLabelMapper.h.


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