VTK  9.5.20250803
Public Member Functions | Static Public Member Functions | List of all members
vtkFollowerTextPropertyAdaptor Class Reference

vtkFollowerTextPropertyAdaptor is a helper class to mimic vtkTextProperty behavior for a vtkAxisFollower. More...

#include <vtkFollowerTextPropertyAdaptor.h>

Public Member Functions

 vtkFollowerTextPropertyAdaptor (vtkAxisFollower *follower, vtkProp3DAxisFollower *propFollower)
 
virtual ~vtkFollowerTextPropertyAdaptor ()
 
void UpdateProperty (vtkTextProperty *textProp, vtkProperty *actorProperty)
 DeepCopy actorProperty.
 
void SetScale (double scale)
 Update the scale, taking the FontScale into account.
 
double GetFontScale ()
 Return the scale to apply to mimic a font size.
 

Static Public Member Functions

static void OnModified (vtkObject *, unsigned long, void *clientData, void *)
 Call Modified on the vtkAxisActor of the follower, to trigger a render.
 

Detailed Description

vtkFollowerTextPropertyAdaptor is a helper class to mimic vtkTextProperty behavior for a vtkAxisFollower.

The vtkAxisFollower does not have a vtkTextProperty. Mimic it by copying the relevant properties (like color and opacity) Also connect the ModifiedEvent of the text property to the Modified method of the followers, to ensure updates.

Definition at line 26 of file vtkFollowerTextPropertyAdaptor.h.

Constructor & Destructor Documentation

◆ vtkFollowerTextPropertyAdaptor()

vtkFollowerTextPropertyAdaptor::vtkFollowerTextPropertyAdaptor ( vtkAxisFollower follower,
vtkProp3DAxisFollower propFollower 
)

◆ ~vtkFollowerTextPropertyAdaptor()

virtual vtkFollowerTextPropertyAdaptor::~vtkFollowerTextPropertyAdaptor ( )
virtual

Member Function Documentation

◆ OnModified()

static void vtkFollowerTextPropertyAdaptor::OnModified ( vtkObject ,
unsigned long  ,
void *  clientData,
void *   
)
static

Call Modified on the vtkAxisActor of the follower, to trigger a render.

This should be connected to the vtkTextProperty ModifiedEvent, with clientData set to be a vtkAxisFollower.

◆ UpdateProperty()

void vtkFollowerTextPropertyAdaptor::UpdateProperty ( vtkTextProperty textProp,
vtkProperty actorProperty 
)

DeepCopy actorProperty.

Override the relevant properties with the ones form the vtkTextProeprty (like color and opacity).

Also connect the ModifiedEvent of the text property to the Modified method of the follower, to ensure updates.

◆ SetScale()

void vtkFollowerTextPropertyAdaptor::SetScale ( double  scale)

Update the scale, taking the FontScale into account.

As vtkAxisFollower as no text property, the font size is set as part of the global scale, and should be taken into account when changing global scale.

◆ GetFontScale()

double vtkFollowerTextPropertyAdaptor::GetFontScale ( )

Return the scale to apply to mimic a font size.

This is equals to FontSize / DefaultFontSize where DefaultFontSize is 12., as the vtkTextProperty default value.


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