15. Report Writing - ProRender

The modules ProRender is designed to facilitate the generation of graphics content for report writing.

15.1. Rendering - ProRender

The ProRender module is designed to generate graphics objects and render them to 2D image files and 3D object files. The methods associated with a ProRender object are the following.

Instance a ProRender object using vis_ProRenderBegin(). Use vis_ProRenderSetObject() to register the current Model object. This gives ProRender access to the model element connectivity and node coordinate information. The complete process of creating a 2D image file or 3D object file is a two step process. First an internal graphics object is generated of either a finite element model or result using vis_ProRenderModel() or vis_ProRenderState() respectively. Then this internal graphics object may be drawn to a 2D image file (such as a GIF file) using vis_ProRenderDraw() or exported to a 3D object file (such as a VRML file) using vis_ProRenderFile().

When rendering to an image file (currently only GIF is supported). The dimension of the final image in pixels is set using vis_ProRenderSetDimension(). The viewing transformation used is set using vis_ProRenderSetLookAt(). Use the function vis_ProRenderSetParamc() to set the output file name. The image file name should include the extension .gif, the object file name should include the extension .wrl.

Destroy an instance of a ProRender object using vis_ProRenderEnd().

15.2. Function Descriptions

The currently available ProRender functions are described in detail in this section.

vis_ProRender *vis_ProRenderBegin(void)

create an instance of a ProRender object

Create an instance of a ProRender object. Memory is allocated for the object private data and the pointer to the object is returned.

Destroy an instance of a ProRender object using

void vis_ProRenderEnd (vis_ProRender *prorender)

Return the current value of a ProRender object error flag using

Vint vis_ProRenderError (vis_ProRender *prorender)

Returns:

The function returns a pointer to the newly created ProRender object. If the object creation fails, NULL is returned.

void vis_ProRenderEnd(vis_ProRender *p)

destroy an instance of a ProRender object

See vis_ProRenderBegin()

Vint vis_ProRenderError(vis_ProRender *p)

return the current value of a ProRender object error flag

See vis_ProRenderBegin()

void vis_ProRenderSetObject(vis_ProRender *p, Vint objecttype, Vobject *object)

set attribute objects

Set a pointer to an attribute object. The Model object must be registered. The State object must be registered if vis_ProRenderState() is executed.

Errors

SYS_ERROR_OBJECTTYPE is generated if an improper objecttype is specified.

Parameters:
  • p – Pointer to ProRender object.

  • objecttype – The object type identifier

    x=VIS_MODEL              Model object
     =VIS_STATE              State object
    

  • object – Pointer to the object to be set.

void vis_ProRenderSetParami(vis_ProRender *p, Vint ptype, Vint iparam)

set integer parameters

Specify integer parameters to control entity color, etc. The edge and face colors must be chosen from the set of available colors in the vis_ColorMapRamp() function when using the COLORMAP_SET ramp. By default edge color is COLORMAP_SET_WHITE and face color is COLORMAP_SET_GRAY50.

Errors

SYS_ERROR_ENUM is generated if an improper ptype is specified.

Parameters:
  • p – Pointer to ProRender object.

  • ptype – Type of solution parameter to set

    x=PRORENDER_EDGECOLOR     Edge color
     =PRORENDER_FACECOLOR     Face color
    

  • iparam – Specifies the integer value that ptype will be set to.

void vis_ProRenderSetParamc(vis_ProRender *p, Vint ptype, Vchar *cparam)

set character parameters

Specify character parameters to control output file name. By default the output file is prorender.gif.

Errors

SYS_ERROR_ENUM is generated if an improper ptype is specified.

Parameters:
  • p – Pointer to ProRender object.

  • ptype – Type of solution parameter to set

    x=PRORENDER_OUTFILE      Pathname for output file
    

  • cparam – Specifies the character value that ^ptype^ will be set to.

void vis_ProRenderSetDimension(vis_ProRender *p, Vint xsize, Vint ysize)

set image pixel dimensions

Set the pixel dimension of generated image. The default is xsize = 320 and ysize = 240.

Parameters:
  • p – Pointer to ProRender object.

  • xsize – Horizontal dimension in pixels

  • ysize – Vertical dimension in pixels

void vis_ProRenderSetLookAt(vis_ProRender *p, Vfloat ex, Vfloat ey, Vfloat ez, Vfloat cx, Vfloat cy, Vfloat cz, Vfloat ux, Vfloat uy, Vfloat uz)

set viewing transformation

Set the viewing transformation used to render image. The default eye position is (1.,0.,0.), point along line of sight is (0.,0.,0.) and up direction is (0.,1.,0.).

Parameters:
  • p – Pointer to ProRender object.

  • ex, ey, ez – Position of eye

  • cx, cy, cz – Point along line of sight

  • ux, uy, uz – Vector pointing in up direction

void vis_ProRenderModel(vis_ProRender *p)

generate graphics object of Model

Generate a graphics object of the current Model attribute object. The model is rendered in gray with feature edges added.

Parameters:

p – Pointer to ProRender object.

void vis_ProRenderState(vis_ProRender *p)

generate graphics object of State

Generate a graphics object of the current State attribute object. A contour plot of a scalar derived quantity is generated. The vector magnitude is used for vector states, Von Mises stress is used for tensor states and the translation magnitude is used for six dof states.

Parameters:

p – Pointer to ProRender object.

void vis_ProRenderDraw(vis_ProRender *p)

render to image file

Render a previously generated object to a GIF file.

Parameters:

p – Pointer to ProRender object.

void vis_ProRenderFile(vis_ProRender *p)

export to object file

Export a previously generated object to a VRML file.

Parameters:

p – Pointer to ProRender object.