The Conventions of HOOPS in FORTRAN


Linking with the HOOPS Fortran Bindings

FORTRAN Defines

Routine Names

Datatypes Names and Language Declarations

Stand-Alone Example Programs


Linking with the HOOPS Fortran Bindings

Applications must link to the HOOPS Fortran object
fortran.obj
located in the [installation]/bin directory.

FORTRAN Defines

To have access to function prototypes for the HF_ routines that comprise the HOOPS API, users of HOOPS include the line:
USE HOOPS
 in their programs. HOOPS I.M. routines are not available to Fortran users.

Routine Names

Prefixes

Each routine name, such as Insert_Polyline, in your HOOPS program must have a prefix before the name will actually be usable on your computer system. The prefix varies depending on which language you're calling from, and sometimes depending on the brand of the language you're calling from. When calling from Fortran , HOOPS routines are prefixed with "HF_"  (as in "CALL HF_PAUSE").

Common Names

All HOOPS routine names follow a standard pattern: the first part of the name is an active verb indicating what's to be done, and the second part is a descriptive noun.
The most common verbs are
Define Changes a global system status, or adds something to a system-wide table.
Insert Incorporates a new picture element into the current segment and into the scene.
KInsert Incorporates a new picture element and returns a reference key to the element.
QInsert Quickly opens a different segment.  Inserts a new picture element and closes the segment
DInsert Double precision version of insert.  Pass doubles instead of floats.
Edit Changes the definition of an existing picture element.
DEdit Double precision version of edit.  Pass doubles instead of floats.
Set Loads an explicit new value for an attribute.
QSet Quickly opens a different segment. Sets and closes the segment.
UnSet Undoes a Set. (Allows an attribute value to be inherited once again from a higher level.)
QUnSet Quickly opens a different segment. UnSets and closes the segment.
Show Retrieves an item of information from the system.
DShow Double precision version of show.  Returns doubles instead of floats.
Begin Initializes a database information search.
Find Steps an information search along.
End Completes an information search.
(Please note that there are a number of miscellaneous verbs that arise from the various state-modifying routines, such as Dolly_Camera and Rename_Segment. These less frequently occurring verbs are usually self explanatory.)
The most common nouns include the following:
Segment The routine works with a graphics segment (a place for storing picture elements) as one element.
Camera The routine positions or moves the viewing camera.
Object The routine works with the "real" objects (as organized into segments) from which your scene is composed.
Text The routine affects the text labels appearing in the scene.
Return to Top

Datatype Names and Language Declarations in FORTRAN

The datatypes used in this manual translate as follows:
HOOPS HOOPS (HF) type
'HC_KEY' INTEGER*4
'integer' INTEGER
'Boolean' LOGICAL
'short' INTEGER*2
'float' REAL
'string' CHARACTER*(*)
'single point' REAL point(3)
'point vector' REAL pvec(3,n)
'array of 4 floats' REAL array(4)
'4 x 4 array of floats' REAL array(4,4)
'vector of short integers' INTEGER*2 vec(n)
'vector of long integers' INTEGER*4 vec(n)
'2-D array of short integers' INTEGER*2 array(c,r)
'vector of integers' INTEGER vec(n)

If the routine definition specifies "Passed by reference", this is normal. You don't need to do anything different.
If the routine definition specifies a returns clause, this means the routine is a Function rather than a Subroutine. In your program, you must declare the function to be of the appropriate type. For example, "INTEGER*4 HF_KINSERT_LINE".
If an actual parameter is specified as "Passed by reference. Returned to user", you must provide a character variable large enough to hold what might be returned.

Return toTop

Stand-Alone Example Programs in Fortran

Stand-alone HOOPS Fortran programs are located in the [installation]/demo/common/tutorial directory. The "tutorial[#].f" programs demonstrate usage of many HOOPS/3dGS routines as called from Fortran and are useful in understanding the basic syntax of the API as well as for test purposes. Executables can be built with the supplied makefile.
Return to Top