$ent->draw()

Syntax

$ent->draw( $kind, $filename [,$options] ) 

Description

Generates a graphics file for an entity. JPG and PNG file formats are supported on all platforms. Visio file output is supported only on Windows systems where Visio is installed.

Arguments

The $kind argument should specify the kind of view to generate for the entity. The valid $kind options match the “Graphical Menu Strings” listed for the -gv and -gvnew command options in the “Server Mode” chapter of the Understand manual for your programming language. As of the print date, these are the options:

Languages
Values
Ada
Callby, Child Lib Units, Declaration, Declaration Tree, Declared In, Instantiated From, Instantiations, Invocation, Parent Declaration, Parent Lib Unit, Rename Declaration, Type Derived From, Type Tree, With, Withby
C/C++
Base Classes, Callby, Data Members, Declaration, Declaration File, Declaration Type, Derived Classes, Include, Includeby, Invocation, Parent Declaration, Return Type
FORTRAN
Callby, Declaration, Declaration File, Include, Includeby, Invocation, Usedby, Uses
Java
Callby, Contains, Declaration, Declaration File, Declaration Type, Extends, Extended By, Invocation, Parent Declaration, Return Type
JOVIAL
Callby, Declaration, Declaration File, Declaration Type, Invocation, Parent Declaration, Return Type
Pascal
Callby, Declaration, Declaration File, Include, Includeby, Invocation

The $filename argument must end with and extension supported on the current platform. That is, either .jpg or .png is supported on all platforms. The .vsd extension is supported only on Windows systems where Visio is installed.

The $options argument may be used to specify some aspects of how to generate the graphics. The format of the $options string is "name=value". Multiple options may be separated with a semicolon.

Not all options are available for all programming languages and all graphical view types. For a list of the valid options, open Understand for your programming language, then choose Options->Graphical Settings and go to the View Options tab. When you select a view, the options for that graph type are shown.

An options string may contain options that are specific for different views, using the syntax "[viewname]optionname=value". This permits you to, for instance, turn fullnames on for Invocation Trees, but not for CallBy trees.

Names and values may be abbreviated to any unique prefix of their full names. For example, you could use the following options string:

"layout=cross; scale=14" 

Additionally, you may use “font” as a special option for any graph type. Its value must be the path to a TrueType font (.ttf) for JPG and PNG files, or the name of a system font for Visio .vsd files.

Using the .vsd extension causes Visio to be invoked, to draw the graphics, and to save the drawing to the named file. Visio remains running, but may be closed by calling Understand::Visio::quit().

Return Values

One of the following status strings is returned if an error occurs:

Status String
Description
"NoFont"
No suitable font can be found.
"NoImage"
No image is defined or the image is empty.
"NoVisioSupport"
No Visio .vsd files can be generated on this system.
"TooBig"
JPG does not support a dimension greater than 64 K.
"UnableCreateFile"
File cannot be opened or created.
"UnsupportedFile"
Only .jpg and .png files are supported.

Additional error messages are also possible when generating a Visio file.

See Also

Understand::Visio class


Scientific Toolworks, Inc.
http://www.scitools.com