REAL corner1(3), corner2(3), corner3(3), corner4(3)
INTEGER segment_id, color
color = 1
corner1(1) = 0.0
corner1(2) = 0.0
corner1(3) = 0.0
corner2(1) = 5.0
corner2(2) = 0.0
corner2(3) = 0.0
corner3(1) = 5.0
corner3(2) = 5.0
corner3(3) = 0.0
corner4(1) = 0.0
corner4(2) = 5.0
corner4(3) = 0.0
/*
* Create segment. Segment ID is returned from graphics manager.
*/
gm_segment_create( segment_id )
/*
* Draw lines. Lines will be retained in segment.
*/
gm_draw_line( segment_id, color, corner1, corner2 )
gm_draw_line( segment_id, color, corner2, corner3 )
gm_draw_line( segment_id, color, corner3, corner4 )
gm_draw_line( segment_id, color, corner4, corner1 )
/*
* Make sure all graphics have been flushed to the screen.
*/
gm_segment_flush()
gm_segment_create | ( id ) |
Description: | ||
To create a segment of graphics primitives (lines, text, etc. ). | ||
Input: | ||
None. | ||
Output: | ||
INTEGER | id | Created segment ID. |
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
gm_segment_delete | ( id ) |
Description: | ||
To delete a segment and remove all graphics primitives (lines, text, etc. ) in the segment from out of the graphics windows. | ||
Input: | ||
INTEGER | id | Segment ID to delete. |
Output: | ||
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
gm_segment_flush | ( ) |
Description: | ||
To flush all graphics primitives to the screen. All primitives, regardless of segment, will be flushed. | ||
Input: | ||
None. | ||
Output: | ||
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
gm_draw_line | ( segment_id, color_id, start, end ) |
Description: | ||
Draw a line in segment or current viewport. | ||
Input: | ||
INTEGER | segment_id | Segment ID created from gm_segment_create. |
INTEGER | color_id | Color of line (0-15). |
REAL[3] | start | Starting location of line in world coord. |
REAL[3] | end | Ending location of line in world coord. |
Output: | ||
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
gm_draw_text | ( segment_id, color_id, location, text ) |
Description: | ||
Draw a string in segment or current viewport. | ||
Input: | ||
INTEGER | segment_id | Segment ID created from gm_segment_create. |
INTEGER | color_id | Color of text (0-15). |
REAL[3] | location | Location of line in world coord. |
STRING | text | Text string. Currently limited to 31 characters. |
Output: | ||
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
gm_draw_marker | ( segment_id, color_id, location, type, size ) |
Description: | ||
Draw a marker in a segment or current viewport. | ||
Input: | ||
INTEGER | segment_id | Segment ID created from gm_segment_create. |
INTEGER | color_id | Color of marker (0-15). |
REAL[3] | location | Location of marker in world coord. |
INTEGER | type | Type of marker (1-dot, 2-circle, 3-X, 4-+, 5-filled circle, 6-square, 7-filled square, 8-triangle, 9-filled tri, 10-diamond, 11-filled diamond). |
INTEGER | size | Size of marker (in pixels). |
Output: | ||
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
gm_draw_result_arrow | (segment_id, color_id, loc, direction, size, anchor_style, string ) |
Description: | ||
Draw a result arrow at the specified location in the segment or current viewport. | ||
Input: | ||
INTEGER | segment_id | Segment ID created from gm_segment_create. |
INTEGER | color_id | Color of arrow. |
REAL[3] | loc | Location of arrow in world coord. |
REAL[3] | direction | Direction of arrow in world coord. |
REAL | size | Size of arrow (percentage of model size). |
INTEGER | anchor_style | Anchor style (1-base, 2-tip, 3-middle). |
STRING | string | Text string. |
Output: | ||
None. | ||
Error Conditions: | ||
None. | ||
Note: | ||
The various anchor styles for the “anchor_style” argument are shown below. Base: 0--------> Tip: -------->0 Middle: -----0----> where the location value is marked as "0" |
gm_draw_arrow | ( segment_id, color_id, base, tip, head_size ) |
Description: | ||
Draw an arrow at the specified base and tip in the segment or current viewport. | ||
Input: | ||
INTEGER | segment_id | Segment ID created from gm_segment_create. |
INTEGER | color_id | Color of arrow (0-15). |
REAL[3] | base | Base location of arrow in world coord. |
REAL[3] | tip | Tip location of arrow in world coord. |
REAL | head_size | Arrow head size (percentage of arrow length). |
Output: | ||
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
None. |
Note: | The head size is a percentage of the arrow length with a value between 0.0 and 1.0. |
gm_conv_world_to_device | ( vp_id, world_pt, dev_pt ) |
Description: | ||
Gets the min/max x, y, z coordinate values of the bounding box that encloses the entities displayed in the current viewport. The coordinate values returned are in the global (world) coordinate system. | ||
Input: | ||
vp_id. | integer | viewport id |
world_pt | real (3) | xyz world coordinate |
Output: | ||
dev_pt | real (3) | xyz device coordinate |
INTEGER | <Return Value> | Status of operation. 0 = Successful. |
Error Conditions: | ||
15000025 | Error in finding the viewport in the graphics manager display list |
Note: | The device coordinates are returned in floats (real). The z-value in device coordinates is to allow depth differentiation of points that map to the same x,y location on the screen. Larger z-values are in front of smaller z-values. |
gm_viewports_refresh | ( ) |
Description: | ||
Refresh all of the viewports. | ||
Input: | ||
None. | ||
Output: | ||
None. | ||
Error Conditions: | ||
None. |
gm_viewport_refresh | ( ) |
Description: | ||
Refresh current viewport. | ||
Input: | ||
None. | ||
Output: | ||
None. | ||
Error Conditions: | ||
None. |
gm_viewport_center_get | ( center ) |
Description: | ||
Calculate the center of the current viewport. | ||
Input: | ||
None. | ||
Output: | ||
REAL | center | Center of the model. |
Error Conditions: | ||
None. |
gm_viewport_world_limits_get | ( limits ) |
Description: | ||
Get the x, y and z minimum/maximum values of the model in world space. | ||
Input: | ||
None. | ||
Output: | ||
REAL(6) | limits | Returns 5% less than the minimum and 5% more than the maximum x, y and z coordinates of the model in world space. |
Error Conditions: | ||
None. |
gm_viewport_subject_get | ( persp_off, center, zoom ) |
Description: | ||
Calculate the center of the current viewport. | ||
Input: | ||
None. | ||
Output: | ||
INTEGER | persp_off | If TRUE, this skips perspective. If FALSE, the perspective setting in the current viewport will be used. |
REAL[2] | center | Center of subject space for the viewport. |
REAL | ZOOM | Zoom factor for the subject space. |
Error Conditions: | ||
None. |