VTK
9.5.20250803
|
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. | |
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.
vtkFollowerTextPropertyAdaptor::vtkFollowerTextPropertyAdaptor | ( | vtkAxisFollower * | follower, |
vtkProp3DAxisFollower * | propFollower | ||
) |
|
virtual |
|
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.
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.
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.
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.