Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

GiD_OpenGL register|unregister|registercondition|unregistercondition|draw|drawtext|project|unproject|get|doscrzoffset|drawentity|pgfont
This command is a Tcl wrapper of some OpenGL functions. It allows to use OpenGL commands directly from GiD-Tcl.
For example, for C/C++ is used:

...


The supplied parameters are:
condition :the condition name, defined in the .cnd file of the problemtype
use: GEOMETRYUSE, MESHUSE or POSTUSE
entity_id: the integer number that identity the entity where the condition is applied. The kind of entity is known because it is declared in the
definition of the condition in the .cnd, depending if the current state is geometry or mesh
values: a list of the field's values applied to this entity. The amount of values must match the amount of fields of the condition definition.
The return value of this procedure is important:
return 0: then the standard representation of the condition is also invoked after the procedure
return 1: the stardard standard representation of the condition is avoided.

...


For elements it is possible to draw only a face, specifying items of element_id and face_id, whith with face_id a number from 1 to the number of faces of the element.
Example:

...

  • doscrzoffset <boolean> Special trick to avoid the lines on surfaces hidden by the surfaces.
  • pgfont pushfont <font_type>|popfont|print <text>|dimensions <text>|foreground <red> <green> <blue> <alpha>|background <red> <green> <blue> <alpha>|background

Command for PG fonts

  • pgfont pushfont <font_type>

    Push sets the current OpenGL font

...

  • and add to stack.
    font types: DefaultFont, AxisFont, LegendFont, LabelFont, GraphFont, AsianFont, TkdrawoglFont, PmFont

  • pgfont popfont

Restores the previous font and remove from stack. Commands push/pop must be called always paired

  • pgfont print <text>

To draw a <text> in the current 3D location (set by GiD_OpenGL draw -rasterpos [list $x $y $z]). It is similar to GiD_OpenGL drawtext

  • pgfont dimensions <text>

Return the width of <text> and <height> of current font (in pixels, but result are float, not int)

  • pgfont foreground <red> <green> <blue> <alpha>
  • pgfont background <red> <green> <blue> <alpha>

Example:

Code Block
GiD_OpenGL pgfont push LabelFont
GiD_OpenGL drawtext "hello world"
GiD_OpenGL pgfont pop

...