text Class Reference

Define text element for runTimePostProcessing. More...

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

Public Types

enum  halignType { LEFT = 0, CENTER = 1, RIGHT = 2 }
 Horizontal alignment type. Values to match VTK definitions. More...
 
- Public Types inherited from geometryBase
enum  renderModeType { rmFlat, rmGouraud, rmPhong }
 Surface shading types. More...
 

Public Member Functions

 text (const runTimePostProcessing &parent, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours)
 Construct from dictionary. More...
 
virtual ~text ()
 Destructor. More...
 
virtual void addGeometryToScene (const scalar position, vtkRenderer *renderer)
 Add text to scene. More...
 
virtual void updateActors (const scalar position)
 Update actors. More...
 
virtual bool clear ()
 Clear files used to create the object(s) - no-op. More...
 
- Public Member Functions inherited from geometryBase
 geometryBase (const runTimePostProcessing &parent_, const dictionary &dict, const HashPtrTable< Function1< vector >> &colours)
 Construct from dictionary. More...
 
virtual ~geometryBase ()
 Destructor. More...
 
const runTimePostProcessingparent () const
 Return the reference to the parent function object. More...
 
bool needsCollective () const
 May need to gather geometry parts to render on single-processor. More...
 
const wordname () const
 Return the name. More...
 
bool visible () const
 Return the visible flag. More...
 
bool parallel () const
 Allow parallel rendering. More...
 
scalar opacity (const scalar position) const
 Return the opacity. More...
 
const HashPtrTable< Function1< vector > > & colours () const
 Return reference to the colours. More...
 

Static Public Attributes

static const Enum< halignTypehalignTypeNames
 Horizontal alignment names (includes "center" and "centre") More...
 
- Static Public Attributes inherited from geometryBase
static const Enum< renderModeTyperenderModeTypeNames
 Names for surface shading types. More...
 
static int debug
 Debug switch. More...
 

Protected Member Functions

 text (const text &)=delete
 No copy construct. More...
 
void operator= (const text &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from geometryBase
void initialiseActor (vtkActor *actor) const
 Initialise actor. More...
 
 geometryBase (const geometryBase &)=delete
 No copy construct. More...
 
void operator= (const geometryBase &)=delete
 No copy assignment. More...
 

Protected Attributes

string string_
 Text. More...
 
List< Tuple2< scalar, scalar > > positions_
 Position(s) More...
 
scalar size_
 Font size. More...
 
autoPtr< Function1< vector > > colour_
 Text colour. More...
 
halignType halign_
 Horizontal alignment. More...
 
bool bold_
 Bold flag. More...
 
bool italic_
 Italic flag. More...
 
bool shadow_
 Shadow flag. More...
 
bool timeStamp_
 Time stamp flag. More...
 
- Protected Attributes inherited from geometryBase
const runTimePostProcessingparent_
 Reference to the parent function object. More...
 
word name_
 The surface name. More...
 
bool visible_
 Visible flag. More...
 
bool parallel_
 Allow parallel rendering. More...
 
renderModeType renderMode_
 Render mode. More...
 
autoPtr< Function1< scalar > > opacity_
 Opacity. More...
 
const HashPtrTable< Function1< vector > > & colours_
 Reference to the colours. More...
 

Detailed Description

Define text element for runTimePostProcessing.

Example of text object specification:

text1
{
    string      "text to display";
    position    (0.1 0.05);
    size        18;
    // halign      left;  // (left | centre | right)
    bold        yes;
    // Optional entry

    shadow      false;

    // Optionally override default colour
    // colour    (0 1 1);

    // Optional entry
    timeStamp   yes; // Append solution time to string
}

Dictionary controls

Property Description Required Default
string Text to display yes
position The (x y) viewport position yes
positions Multiple (x y) viewport positions no
size The font size in points yes
halign Text justification (left/centre/ right) no left
bold Use bold font yes
italic Use italic font no false
shadow Add text shadow no false
colour Override default text colour no
timeStamp Append solution timeName to string no false

Inherited controls

Property Description Required Default
visible Display the object no true
opacity Object opacity no 1.0
Note
The string text is expanded on input using stringOps::inplaceExpand() to expand dictionary and environment variable entries.
Source files

Definition at line 175 of file text.H.

Member Enumeration Documentation

◆ halignType

enum halignType

Horizontal alignment type. Values to match VTK definitions.

Enumerator
LEFT 

Left-justified text - default ("left")

CENTER 

Centred text ("center", "centre")

RIGHT 

Right-justified text ("right")

Definition at line 184 of file text.H.

Constructor & Destructor Documentation

◆ text() [1/2]

text ( const text )
protecteddelete

No copy construct.

◆ text() [2/2]

text ( const runTimePostProcessing parent,
const dictionary dict,
const HashPtrTable< Function1< vector >> &  colours 
)

Construct from dictionary.

Definition at line 59 of file text.C.

References dict, and Foam::stringOps::inplaceExpand().

Here is the call graph for this function:

◆ ~text()

~text ( )
virtual

Destructor.

Definition at line 107 of file text.C.

Member Function Documentation

◆ operator=()

void operator= ( const text )
protecteddelete

No copy assignment.

◆ addGeometryToScene()

void addGeometryToScene ( const scalar  position,
vtkRenderer *  renderer 
)
virtual

Add text to scene.

Implements geometryBase.

Definition at line 114 of file text.C.

References DebugInfo, UPstream::master(), runTimePostProcessing::mesh(), Foam::New(), Foam::nl, geometryBase::parent_, fvMesh::time(), and Time::timeName().

Here is the call graph for this function:

◆ updateActors()

void updateActors ( const scalar  position)
virtual

Update actors.

Implements geometryBase.

Definition at line 171 of file text.C.

◆ clear()

bool clear ( )
virtual

Clear files used to create the object(s) - no-op.

Implements geometryBase.

Definition at line 179 of file text.C.

Member Data Documentation

◆ halignTypeNames

Horizontal alignment names (includes "center" and "centre")

Definition at line 192 of file text.H.

◆ string_

string string_
protected

Text.

Definition at line 200 of file text.H.

◆ positions_

List<Tuple2<scalar, scalar> > positions_
protected

Position(s)

Definition at line 203 of file text.H.

◆ size_

scalar size_
protected

Font size.

Definition at line 206 of file text.H.

◆ colour_

autoPtr<Function1<vector> > colour_
protected

Text colour.

Definition at line 209 of file text.H.

◆ halign_

halignType halign_
protected

Horizontal alignment.

Definition at line 212 of file text.H.

◆ bold_

bool bold_
protected

Bold flag.

Definition at line 215 of file text.H.

◆ italic_

bool italic_
protected

Italic flag.

Definition at line 218 of file text.H.

◆ shadow_

bool shadow_
protected

Shadow flag.

Definition at line 221 of file text.H.

◆ timeStamp_

bool timeStamp_
protected

Time stamp flag.

Definition at line 224 of file text.H.


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