Define text element for runTimePostProcessing. More...
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 runTimePostProcessing & | parent () 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 word & | name () 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< halignType > | halignTypeNames |
Horizontal alignment names (includes "center" and "centre") More... | |
Static Public Attributes inherited from geometryBase | |
static const Enum< renderModeType > | renderModeTypeNames |
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 runTimePostProcessing & | parent_ |
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... | |
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 |
enum halignType |
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().
|
protecteddelete |
No copy assignment.
|
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().
|
virtual |
|
virtual |
Clear files used to create the object(s) - no-op.
Implements geometryBase.
|
static |
|
protected |