ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkScalarBarActorCustom Class Reference

#include <vtkScalarBarActorCustom.h>

Inheritance diagram for vtkScalarBarActorCustom:
Collaboration diagram for vtkScalarBarActorCustom:

Public Member Functions

 vtkTypeMacro (vtkScalarBarActorCustom, vtkScalarBarActor)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
 vtkGetMacro (AspectRatio, double)
 
 vtkSetMacro (AspectRatio, double)
 
 vtkGetMacro (AutomaticLabelFormat, int)
 
 vtkSetMacro (AutomaticLabelFormat, int)
 
 vtkBooleanMacro (AutomaticLabelFormat, int)
 
 vtkGetMacro (DrawTickMarks, int)
 
 vtkSetMacro (DrawTickMarks, int)
 
 vtkBooleanMacro (DrawTickMarks, int)
 
 vtkGetMacro (DrawSubTickMarks, int)
 
 vtkSetMacro (DrawSubTickMarks, int)
 
 vtkBooleanMacro (DrawSubTickMarks, int)
 
 vtkGetMacro (AddRangeLabels, int)
 
 vtkSetMacro (AddRangeLabels, int)
 
 vtkBooleanMacro (AddRangeLabels, int)
 
 vtkSetMacro (AutomaticAnnotations, int)
 
 vtkGetMacro (AutomaticAnnotations, int)
 
 vtkBooleanMacro (AutomaticAnnotations, int)
 
 vtkGetStringMacro (RangeLabelFormat)
 
 vtkSetStringMacro (RangeLabelFormat)
 
virtual void AddValueLabelIfUnoccluded (double value, double pos, double diff)
 
 vtkGetMacro (TitleJustification, int)
 
 vtkSetClampMacro (TitleJustification, int, VTK_TEXT_LEFT, VTK_TEXT_RIGHT)
 
 vtkGetMacro (AddRangeAnnotations, int)
 
 vtkSetMacro (AddRangeAnnotations, int)
 
 vtkBooleanMacro (AddRangeAnnotations, int)
 
void ReleaseGraphicsResources (vtkWindow *) override
 
int RenderOpaqueGeometry (vtkViewport *viewport) override
 
int RenderOverlay (vtkViewport *viewport) override
 

Static Public Member Functions

static vtkScalarBarActorCustomNew ()
 

Protected Member Functions

 vtkScalarBarActorCustom ()
 
 ~vtkScalarBarActorCustom () override
 
void PrepareTitleText () override
 
void ComputeScalarBarThickness () override
 
void LayoutTitle () override
 
void ComputeScalarBarLength () override
 
void LayoutTicks () override
 
void ConfigureAnnotations () override
 
void ConfigureTitle () override
 
void ConfigureTicks () override
 
void EditAnnotations () override
 
virtual void BuildScalarBarTexture ()
 
virtual int CreateLabel (double value, int minDigits, int targetWidth, int targetHeight, vtkViewport *viewport)
 

Protected Attributes

double AspectRatio
 
int AutomaticLabelFormat
 
int DrawTickMarks
 
int DrawSubTickMarks
 
int AddRangeLabels
 
int AutomaticAnnotations
 
char * RangeLabelFormat
 
vtkTexture * ScalarBarTexture
 
vtkPolyData * TickMarks
 
vtkPolyDataMapper2D * TickMarksMapper
 
vtkActor2D * TickMarksActor
 
vtkNew< vtkAxis > TickLayoutHelper
 
vtkNew< vtkContextScene > TickLayoutHelperScene
 
int LabelSpace
 
int TitleJustification
 
int AddRangeAnnotations
 

Detailed Description

Definition at line 20 of file vtkScalarBarActorCustom.h.

Constructor & Destructor Documentation

◆ vtkScalarBarActorCustom()

◆ ~vtkScalarBarActorCustom()

vtkScalarBarActorCustom::~vtkScalarBarActorCustom ( )
overrideprotected

Member Function Documentation

◆ AddValueLabelIfUnoccluded()

void vtkScalarBarActorCustom::AddValueLabelIfUnoccluded ( double  value,
double  pos,
double  diff 
)
virtual

Add value as annotation label on scalar bar at the given position

Definition at line 1041 of file vtkScalarBarActorCustom.cpp.

References cloudViewer::utility::ceil(), cloudViewer::utility::floor(), and SNPRINTF.

Referenced by EditAnnotations().

◆ BuildScalarBarTexture()

void vtkScalarBarActorCustom::BuildScalarBarTexture ( )
protectedvirtual

Set up the ScalarBar, ScalarBarMapper, and ScalarBarActor based on the current position and orientation of this actor. virtual void PositionScalarBar(const int propSize[2], vtkViewport *viewport); Set up the texture used to render the scalar bar.

Definition at line 1066 of file vtkScalarBarActorCustom.cpp.

References COLOR_TEXTURE_MAP_SIZE, colors, and ScalarBarTexture.

◆ ComputeScalarBarLength()

void vtkScalarBarActorCustom::ComputeScalarBarLength ( )
overrideprotected

Definition at line 409 of file vtkScalarBarActorCustom.cpp.

◆ ComputeScalarBarThickness()

void vtkScalarBarActorCustom::ComputeScalarBarThickness ( )
overrideprotected

◆ ConfigureAnnotations()

void vtkScalarBarActorCustom::ConfigureAnnotations ( )
overrideprotected

Definition at line 470 of file vtkScalarBarActorCustom.cpp.

◆ ConfigureTicks()

void vtkScalarBarActorCustom::ConfigureTicks ( )
overrideprotected

◆ ConfigureTitle()

void vtkScalarBarActorCustom::ConfigureTitle ( )
overrideprotected

Definition at line 478 of file vtkScalarBarActorCustom.cpp.

References x, and y.

◆ CreateLabel()

int vtkScalarBarActorCustom::CreateLabel ( double  value,
int  minDigits,
int  targetWidth,
int  targetHeight,
vtkViewport *  viewport 
)
protectedvirtual

A convenience function for creating one of the labels. A text mapper and associated actor are added to LabelMappers and LabelActors respectively. The index to the newly created entries is returned.

Definition at line 184 of file vtkScalarBarActorCustom.cpp.

References AutomaticLabelFormat, format, and SNPRINTF.

Referenced by ConfigureTicks().

◆ EditAnnotations()

void vtkScalarBarActorCustom::EditAnnotations ( )
overrideprotected

Annotate the min/max values on the scalar bar (in interval/ratio mode).

This overrides the subclass implementation.

Definition at line 1008 of file vtkScalarBarActorCustom.cpp.

References AddRangeAnnotations, and AddValueLabelIfUnoccluded().

◆ LayoutTicks()

void vtkScalarBarActorCustom::LayoutTicks ( )
overrideprotected

Definition at line 414 of file vtkScalarBarActorCustom.cpp.

References cloudViewer::utility::ceil(), and LabelSpace.

◆ LayoutTitle()

void vtkScalarBarActorCustom::LayoutTitle ( )
overrideprotected

Definition at line 325 of file vtkScalarBarActorCustom.cpp.

References NULL, and TitleJustification.

◆ New()

static vtkScalarBarActorCustom* vtkScalarBarActorCustom::New ( )
static

◆ PrepareTitleText()

void vtkScalarBarActorCustom::PrepareTitleText ( )
overrideprotected

These methods override the subclass implementation.

Definition at line 288 of file vtkScalarBarActorCustom.cpp.

◆ PrintSelf()

◆ ReleaseGraphicsResources()

void vtkScalarBarActorCustom::ReleaseGraphicsResources ( vtkWindow *  window)
override

Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.

Definition at line 147 of file vtkScalarBarActorCustom.cpp.

References ScalarBarTexture, and TickMarksActor.

◆ RenderOpaqueGeometry()

int vtkScalarBarActorCustom::RenderOpaqueGeometry ( vtkViewport *  viewport)
override

Overridden to sync internal variables with renderer state.

Definition at line 160 of file vtkScalarBarActorCustom.cpp.

References TickLayoutHelperScene.

◆ RenderOverlay()

int vtkScalarBarActorCustom::RenderOverlay ( vtkViewport *  viewport)
override

Draw the scalar bar and annotation text to the screen.

Definition at line 170 of file vtkScalarBarActorCustom.cpp.

References DrawTickMarks, and TickMarksActor.

◆ vtkBooleanMacro() [1/6]

vtkScalarBarActorCustom::vtkBooleanMacro ( AddRangeAnnotations  ,
int   
)

◆ vtkBooleanMacro() [2/6]

vtkScalarBarActorCustom::vtkBooleanMacro ( AddRangeLabels  ,
int   
)

◆ vtkBooleanMacro() [3/6]

vtkScalarBarActorCustom::vtkBooleanMacro ( AutomaticAnnotations  ,
int   
)

◆ vtkBooleanMacro() [4/6]

vtkScalarBarActorCustom::vtkBooleanMacro ( AutomaticLabelFormat  ,
int   
)

◆ vtkBooleanMacro() [5/6]

vtkScalarBarActorCustom::vtkBooleanMacro ( DrawSubTickMarks  ,
int   
)

◆ vtkBooleanMacro() [6/6]

vtkScalarBarActorCustom::vtkBooleanMacro ( DrawTickMarks  ,
int   
)

◆ vtkGetMacro() [1/8]

vtkScalarBarActorCustom::vtkGetMacro ( AddRangeAnnotations  ,
int   
)

Set whether the scalar data range endpoints (minimum and maximum) are added as annotations.

◆ vtkGetMacro() [2/8]

vtkScalarBarActorCustom::vtkGetMacro ( AddRangeLabels  ,
int   
)

Set whether the range endpoints (minimum and maximum) are added as labels alongside other value labels.

◆ vtkGetMacro() [3/8]

vtkScalarBarActorCustom::vtkGetMacro ( AspectRatio  ,
double   
)

The bar aspect ratio (length/width). Defaults to 20. Note that this the aspect ratio of the color bar only, not including labels.

◆ vtkGetMacro() [4/8]

vtkScalarBarActorCustom::vtkGetMacro ( AutomaticAnnotations  ,
int   
)

◆ vtkGetMacro() [5/8]

vtkScalarBarActorCustom::vtkGetMacro ( AutomaticLabelFormat  ,
int   
)

If true (the default), the printf format used for the labels will be automatically generated to make the numbers best fit within the widget. If false, the LabelFormat ivar will be used.

◆ vtkGetMacro() [6/8]

vtkScalarBarActorCustom::vtkGetMacro ( DrawSubTickMarks  ,
int   
)

If true (the default), sub-tick marks will be drawn.

◆ vtkGetMacro() [7/8]

vtkScalarBarActorCustom::vtkGetMacro ( DrawTickMarks  ,
int   
)

If true (the default), tick marks will be drawn.

◆ vtkGetMacro() [8/8]

vtkScalarBarActorCustom::vtkGetMacro ( TitleJustification  ,
int   
)

Set the title justification. Valid values are VTK_TEXT_LEFT, VTK_TEXT_CENTERED, and VTK_TEXT_RIGHT.

◆ vtkGetStringMacro()

vtkScalarBarActorCustom::vtkGetStringMacro ( RangeLabelFormat  )

Set the C-style format string for the range labels.

◆ vtkSetClampMacro()

vtkScalarBarActorCustom::vtkSetClampMacro ( TitleJustification  ,
int  ,
VTK_TEXT_LEFT  ,
VTK_TEXT_RIGHT   
)

◆ vtkSetMacro() [1/7]

vtkScalarBarActorCustom::vtkSetMacro ( AddRangeAnnotations  ,
int   
)

◆ vtkSetMacro() [2/7]

vtkScalarBarActorCustom::vtkSetMacro ( AddRangeLabels  ,
int   
)

◆ vtkSetMacro() [3/7]

vtkScalarBarActorCustom::vtkSetMacro ( AspectRatio  ,
double   
)

◆ vtkSetMacro() [4/7]

vtkScalarBarActorCustom::vtkSetMacro ( AutomaticAnnotations  ,
int   
)

Set whether annotions are automatically created according the number of discrete colors. Default is FALSE;

◆ vtkSetMacro() [5/7]

vtkScalarBarActorCustom::vtkSetMacro ( AutomaticLabelFormat  ,
int   
)

◆ vtkSetMacro() [6/7]

vtkScalarBarActorCustom::vtkSetMacro ( DrawSubTickMarks  ,
int   
)

◆ vtkSetMacro() [7/7]

vtkScalarBarActorCustom::vtkSetMacro ( DrawTickMarks  ,
int   
)

◆ vtkSetStringMacro()

vtkScalarBarActorCustom::vtkSetStringMacro ( RangeLabelFormat  )

◆ vtkTypeMacro()

vtkScalarBarActorCustom::vtkTypeMacro ( vtkScalarBarActorCustom  ,
vtkScalarBarActor   
)

Member Data Documentation

◆ AddRangeAnnotations

int vtkScalarBarActorCustom::AddRangeAnnotations
protected

Flag to add minimum and maximum as annotations

Definition at line 223 of file vtkScalarBarActorCustom.h.

Referenced by EditAnnotations(), PrintSelf(), and vtkScalarBarActorCustom().

◆ AddRangeLabels

int vtkScalarBarActorCustom::AddRangeLabels
protected

Definition at line 187 of file vtkScalarBarActorCustom.h.

Referenced by ConfigureTicks(), PrintSelf(), and vtkScalarBarActorCustom().

◆ AspectRatio

double vtkScalarBarActorCustom::AspectRatio
protected

◆ AutomaticAnnotations

int vtkScalarBarActorCustom::AutomaticAnnotations
protected

Flag indicating whether automatic annotations are computed and shown.

Definition at line 192 of file vtkScalarBarActorCustom.h.

Referenced by PrintSelf(), and vtkScalarBarActorCustom().

◆ AutomaticLabelFormat

int vtkScalarBarActorCustom::AutomaticLabelFormat
protected

◆ DrawSubTickMarks

int vtkScalarBarActorCustom::DrawSubTickMarks
protected

Definition at line 186 of file vtkScalarBarActorCustom.h.

Referenced by ConfigureTicks(), PrintSelf(), and vtkScalarBarActorCustom().

◆ DrawTickMarks

int vtkScalarBarActorCustom::DrawTickMarks
protected

Definition at line 185 of file vtkScalarBarActorCustom.h.

Referenced by PrintSelf(), RenderOverlay(), and vtkScalarBarActorCustom().

◆ LabelSpace

int vtkScalarBarActorCustom::LabelSpace
protected

Space, in pixels, between the labels and the bar itself. Currently set in PositionTitle.

Definition at line 213 of file vtkScalarBarActorCustom.h.

Referenced by ComputeScalarBarThickness(), ConfigureTicks(), LayoutTicks(), and PrintSelf().

◆ RangeLabelFormat

char* vtkScalarBarActorCustom::RangeLabelFormat
protected

◆ ScalarBarTexture

vtkTexture* vtkScalarBarActorCustom::ScalarBarTexture
protected

◆ TickLayoutHelper

vtkNew<vtkAxis> vtkScalarBarActorCustom::TickLayoutHelper
protected

These are used to calculate the tick spacing.

Definition at line 205 of file vtkScalarBarActorCustom.h.

Referenced by ConfigureTicks(), and vtkScalarBarActorCustom().

◆ TickLayoutHelperScene

vtkNew<vtkContextScene> vtkScalarBarActorCustom::TickLayoutHelperScene
protected

Definition at line 206 of file vtkScalarBarActorCustom.h.

Referenced by RenderOpaqueGeometry(), and vtkScalarBarActorCustom().

◆ TickMarks

vtkPolyData* vtkScalarBarActorCustom::TickMarks
protected

◆ TickMarksActor

vtkActor2D* vtkScalarBarActorCustom::TickMarksActor
protected

◆ TickMarksMapper

vtkPolyDataMapper2D* vtkScalarBarActorCustom::TickMarksMapper
protected

◆ TitleJustification

int vtkScalarBarActorCustom::TitleJustification
protected

The justification/alignment of the title.

Definition at line 218 of file vtkScalarBarActorCustom.h.

Referenced by LayoutTitle(), PrintSelf(), and vtkScalarBarActorCustom().


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