Tutorial Toolkit Function Descriptions > Graphics > Graphics Manager
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Graphics Manager
The following functions are useful to manage graphics.
 
db_get_current_viewport_id
(id)
Description:
Retrieves the viewport id associated with the specified viewport.
Input:
None.
Output:
INTEGER
id
Location for returned value.
INTEGER
<Return Value>
Returns the success or failure of the routine.
Error Conditions:
13000002
Unrecoverable database error.
13000007
An unspecified database error occurred.
Example:
Please see db_get_current_viewport_id (p. 70) in the MSC Acumen Toolkit - Code Examples.
  
ga_view_normal_get
(viewport, vector)
Description:
This function gets the view vector for the view.
Input:
STRING
viewport[ ]
The name of the viewport. ““ for the current viewport.
Output:
REAL ARRAY
vector(3)
The three values of the view vector.
INTEGER
<Return_value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Conditions:
See the Status Messages (Ch. 11) for information on any error values returned by this function.
Example:
Please see ga_view_normal_get (p. 224) in the MSC Acumen Toolkit - Code Examples.
 
gm_convert_name
( orig_name, new_name )
Description:
This function will remove the directory from a full path and file name specification.
Input:
STRING
orig_name[]
This value specifies the full path and file name.
Output:
STRING
new_name[]
This value will return the file name from the path and file name specification.
INTEGER
<Return Value>
This return value is unused.
Comments:
Device dependent routine.
Example:
Please see gm_convert_name (p. 226) in the MSC Acumen Toolkit - Code Examples.
 
gm_conv_device_to_subject
( vp_id, dev_pt, sub_pt )
Description:
To convert from device space to subject space.
Input:
INTEGER
vp_id
Viewport id.
INTEGER
dev_pt (2)
Point in device space.
Output:
REAL
sub_pt (3)
Point in subject space.
INTEGER
<Return Value>
See error conditions.
Error Conditions:
15000028
The viewport must be posted to carry out this operation.
15000025
An error occurred during an operation on the graphics manager display list.
Example:
Please see gm_conv_device_to_subject (p. 225) in the MSC Acumen Toolkit - Code Examples.
 
gm_database_current
( dbname )
Description:
Get the current database from the graphics manager.
Input:
None.
Output:
STRING
dbname[]
Current database name.
INTEGER
<Return Value>
GM Error status.
Example:
Please see gm_database_current (p. 228) in the MSC Acumen Toolkit - Code Examples.
  
gm_draw_entity
(segment_id, color_id, entity_type, entity_id)
Description:
This function draws an entity in segment or current viewport.
Input:
INTEGER
segment_id
Segment id number. If <0 then use current viewport.
INTEGER
color_id
Selected color id of entity.
INTEGER
entity_type
Type of entity, i.e. curve or surface.
INTEGER
entity_id
Entity ID
Output:
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Error Condition:
None
Example:
Please see gm_draw_entity (p. 228) in the MSC Acumen Toolkit - Code Examples.
 
gm_fit_view
( flag )
Description:
Make sure limits are up to date and perform a fit view.
Input:
INTEGER
flag
If TRUE perform fit view no matter what. If FALSE, only fit view if gm has detected that a fit is necessary.
Output:
INTEGER
<Return Value>
1 if a fit view was done, 0 if not.
Example:
Please see gm_fit_view (p. 230) in the MSC Acumen Toolkit - Code Examples.
 
gm_fullcolor_mode
( )
Description:
Return whether or not the device is Fullcolor.
Input:
None.
Output:
LOGICAL
<Return Value>
Fullcolor status of device.
Example:
Please see gm_fullcolor_mode (p. 231) in the MSC Acumen Toolkit - Code Examples.
 
gm_graphics_off
( )
Description:
Shut down the graphics. Database will be closed and all colors freed.
Input:
None.
Output:
INTEGER
<Return Value>
GM Error status.
Example:
Please see gm_graphics_off (p. 232) in the MSC Acumen Toolkit - Code Examples.
 
gm_graphics_on
( )
 
Description:
Start the graphics back up. Called after a GmGraphicsOff call. Loads in the last database, allocated colors.
Input:
None.
Output:
INTEGER
<Return Value>
GM Error status.
Example:
Please see gm_graphics_on (p. 233) in the MSC Acumen Toolkit - Code Examples.
 
gm_hilight_clear
( )
Description:
 
 
To unhighlight all of the highlighted objects.
Input:
None.
Output:
INTEGER
<Return Value>
GM Error status.
Example:
Please see gm_hilight_clear (p. 233) in the MSC Acumen Toolkit - Code Examples.
 
gm_hilight_entity
( type, id, color )
Description:
To highlight an entity.
Input:
INTEGER
type
Entity type.
INTEGER
id
Entity id.
INTEGER
color
Color to hilight. 0 - unhilight, -1 - hilight using preference color.
Output:
INTEGER
<Return Value>
This return value is unused.
Error Conditions:
15000035
A new pick list could not be created.
Example:
Please see gm_hilight_entity (p. 235) in the MSC Acumen Toolkit - Code Examples.
 
gm_hilight_string
(string, color)
  
Description:
This function highlights all of the entities in the picklist string.
Input:
STRING
string[]
Picklist string.
INTEGER
color
Color to hilight. 0 - unhilight, -1 - hilight using preference color.
Output:
INTEGER
<Return Value>
This return value is unused.
Error Condition:
None
Example:
Please see gm_hilight_string (p. 236) in the MSC Acumen Toolkit - Code Examples.
 
gm_hilight_widget
( wid_id, color )
Description:
To hilight all of the entities in the select databox.
Input:
 
 
widget
wid_id
Select databox widget id.
INTEGER
color
Color to hilight. 0 - unhilight, -1 - hilight using preference color.
Output:
INTEGER
<Return Value>
This return value is unused.
Error Conditions:
15000035
A new pick list could not be created.
Example:
Please see gm_hilight_widget (p. 237) in the MSC Acumen Toolkit - Code Examples.
 
gm_lookup_write
( start, ncolors, colors )
Description:
Write colors to lookup table.
Input:
INTEGER
start
Starting location in colormap to write to.
INTEGER
ncolors
Number of colors to write.
REAL
colors (ncolors,3)
Array of RGB values.
Output:
INTEGER
<Return Value>
See error conditions.
Comments:
The color table is organized in three regions; The first region is for the DAKAR color table, the second for UIMS colors, the third for shading. When calling this routine, the ncolors should not cross over these boundaries.
Error Conditions:
15000041
User Interface colors not allocated. The colormap is being used.
15000042
Not enough colors were allocated for shading.
Example:
Please see gm_lookup_write (p. 239) in the MSC Acumen Toolkit - Code Examples.
  
gm_mpeg_pause_recording
()
Description:
This function pauses the recording of mpeg images file. This is a void function so there are no input/output arguments in this function.
Input:
None
Output:
None
Example:
Please see gm_mpeg_pause_recording (p. 240) in the MSC Acumen Toolkit - Code Examples.
  
gm_mpeg_resume_recording
()
Description:
This function resumes the recording of mpeg images file. This is a void function so there are no input/output arguments in this function.
Input:
None
Output:
None
Example:
Please see gm_mpeg_resume_recording (p. 243) in the MSC Acumen Toolkit - Code Examples.
  
gm_mpeg_start_recording
(file_name, file_version, x, y, width, height, quality, maxframes)
Description:
This function starts the recording of an mpeg images file.
Input:
STRING
file_name[]
Recorded .mpeg filename
STRING
file_version[]
File version, i.e. overwrite or increment
REAL
x
X point coordinate
REAL
y
Y point coordinate
REAL
width
Width of the drawable area
REAL
height
Height of the drawable area
INTEGER
quality
Quality (0-100)
INTEGER
maxframes
Maximum number of frames.
Output:
INTEGER
<Return Value>
0 for success of the function and integer value 1 to 7 for the failure of the function.
Error Condition:
None
Example:
Please see gm_mpeg_start_recording (p. 245) in the MSC Acumen Toolkit - Code Examples.
  
gm_mpeg_stop_recording
()
Description:
This function stops the recording of an mpeg images file. This is a void function so there are no input/output arguments in this function.
Input:
None
Output:
None
Example:
Please see gm_mpeg_stop_recording (p. 248) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_hardware_mode_get
( hard_flag )
Description:
To get whether viewport is drawn in hardware mode.
Input:
None.
Output:
INTEGER
hard_flag
If TRUE, viewport is drawn in hardware.
INTEGER
<Return Value>
This return value is unused.
Example:
Please see gm_viewport_hardware_mode_get (p. 251) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_hardware_mode_set
( hard_flag )
Description:
To set whether viewport is drawn in hardware mode.
Input:
INTEGER
hard_flag
If TRUE, viewport is drawn in hardware.
Output:
INTEGER
<Return Value>
This return value is unused.
Example:
Please see gm_viewport_hardware_mode_set (p. 252) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_id_to_name
( id, name )
Description:
Convert from Viewport id to Viewport name.
Input:
INTEGER
id
Viewport ID.
Output:
STRING
name[]
Viewport name.
INTEGER
<Return Value>
GM error status.
Example:
Please see gm_viewport_id_to_name (p. 253) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_limits_get
( persp, limits )
Description:
Determine the limits of the model in View Space.
Input:
LOGICAL
persp
If TRUE, this skips perspective. If FALSE, the perspective setting in the current viewport will be used.
Output:
REAL
limits (6)
Min/max x, y and z coordinates of the model in View Space.
INTEGER
<Return Value>
See error conditions.
Error Conditions:
15000025
An error occurred during an operation on the graphics manager display list.
15000028
The viewport must be posted to carry out this operation.
Example:
Please see gm_viewport_limits_get (p. 254) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_ncolors_get
( ncolors )
Description:
To get the number of colors used by the GM.
Input:
None.
Output:
INTEGER
ncolors
Number of colors.
INTEGER
<Return Value>
This return value is unused.
Example:
Please see gm_viewport_ncolors_get (p. 255) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_refresh_off
( )
Description:
Turn off viewport refresh.
Input:
None.
Output:
INTEGER
<Return Value>
This return value is unused.
Example:
Please see gm_viewport_refresh_off (p. 255) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_refresh_on
( )
Description:
Turn on viewport refresh.
Input:
None.
Output:
INTEGER
<Return Value>
This return value is unused.
Example:
Please see gm_viewport_refresh_on (p. 256) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_refresh_status
( )
Description:
Return the current status of gmRefreshViewports.
Input:
None.
Output:
LOGICAL
<Return Value>
GM error status.
Example:
Please see gm_viewport_refresh_status (p. 257) in the MSC Acumen Toolkit - Code Examples.
 
gm_viewport_view_corners
( id, corn1, corn2, cent_x, cent_y, zoom )
 
Description:
Calculate the center and zoom for a viewport given two corners of a rectangle.
Input:
INTEGER
id
Viewport id.
INTEGER
corn1[2]
This value specifies the X and Y coordinates of the upper left corner of the rectangle defining the new center point and zoom value for the viewport.
INTEGER
corn1[2]
This value specifies the X and Y coordinates of the lower right corner of the rectangle defining the new center point and zoom value for the viewport.
Output:
REAL
cent_x
New center in x.
REAL
cent_y
New center in y.
REAL
zoom
New zoom.
INTEGER
<Return Value>
GM error status.
Example:
See example for gm_viewport_id_to_name, 96. See also gm_viewport_view_corners (p. 258) in the MSC Acumen Toolkit - Code Examples.
 
gm_visibility_all
( vstat )
Description:
To set the visibility status of all objects.
Input:
LOGICAL
vstat
TRUE - plot.
FALSE - erase.
Output:
INTEGER
<Return Value>
GM error status.
Example:
Please see gm_visibility_all (p. 260) in the MSC Acumen Toolkit - Code Examples.
 
gm_visibility_widget
( entityList, visibility )
 
Description:
To set the visibility status of all the entities in the selectdatabox.
Input:
STRING
entityList
List of entities to plot or erase.
LOGICAL
visibility
Visibility status: TRUE - visible, FALSE - hidden.
Output:
INTEGER
<Return Value>
See error conditions.
Error Conditions:
15000035
A new pick list could not be created.
Example:
Please see gm_visibility_widget (p. 261) in the MSC Acumen Toolkit - Code Examples.
  
end_vrml_animation
()
Description:
The function ends the process of copying the animation from the screen into a VRML file. This function has to follow the start_vrml_animation() function after specifying the animation attributes. The function has no return conditions.
Input:
None
Output:
None
Error Conditions:
None.
Example:
Please see end_vrml_animation (p. 70) in the MSC Acumen Toolkit - Code Examples.
  
gm_write_image
( <image_type >, <filename>, <version_logic>, <xpcnt >, <ypcnt>, <width_pcnt>, <height_pcnt>, <quality>, <xyplot>)
Description:
The function prepares an image file of the specified type of the current viewport. It returns an integer status of 0 on success and 1 on failure.
Input:
STRING
image_type[]
The typeof the image file – BMP, JPEG, PNG, TIFF, VRML.
STRING
filename[]
The name of the file to write the image with the file extensions - bmp, jpg, png, tif, wrl.
STRING
version_logic[]
String to specify the version logic for writing the image file – “Overwrite”, “Increment”. Any other string defaults to “Increment”.
REAL
xpcnt
The starting percentage of the viewport for the image file in the horizontal direction.
REAL
ypcnt
The starting percentage of the viewport for the image file in the vertical direction.
REAL
width_pcnt
The ending percentage of the viewport for the image file in the horizontal direction.
REAL
height_pcnt
The ending percentage of the viewport for the image file in the vertical direction.
INTEGER
quality
An integer specifying the quality of image.
STRING
xyplot
The image captured will be of the current XY PLOT window as opposed to the model graphics viewport.
Output:
 
 
INTEGER
<Return Value>
0 for success and 1 for failure.
Error Conditions:
None.
Example:
Please see gm_write_image (p. 262) in the MSC Acumen Toolkit - Code Examples.
  
gm_write_vrml
(<filename>, <version_logic>)
Description:
The function prepares an image file of the entire viewport with the extension .wrl. It returns an integer status of 1 on success and 0 on failure.
Input:
STRING
filename[]
The name of the file to write the image with the file extension - .wrl.
STRING
version_logic[]
String to specify the version logic for writing the image file. – “Overwrite”, “Increment”. Any other string defaults to “Increment”.
Output:
 
 
INTEGER
<Return Value>
1 for success and 0 for failure.
Error Conditions:
None.
Example:
Please see gm_write_vrml (p. 265) in the MSC Acumen Toolkit - Code Examples.
  
start_vrml_animation
(<filename>, <version_logic>)
Description:
The function starts the process of copying the animation from the screen into a VRML file. This function has to be followed by the end_vrml_animation() function after specifying the animation attributes. During the course of execution of this function, the animation is sent to the .wrl file and is not viewed in the current viewport. The function has no return conditions.
Input:
STRING
filename[]
The name of the file to write the animation file with the file extension - .wrl
STRING
version_logic[]
String to specify the version logic for writing the image file – “Overwrite”, “Increment”. Any other string defaults to “Increment”.
Output:
None
Error Conditions:
None.
Example:
Please see start_vrml_animation (p. 291) in the MSC Acumen Toolkit - Code Examples.