Next: 2.3 Association of names with elementary
Up: 2 General tools
Prev: 2.1 Defining the output terminal
Contents
In order to facilitate programming, FORTRAN 3D allows us to regroup the elementary components into "segments". Once constituted, a segment can be manipulated individually. This facility is only available if the graphics terminal in use allows it. If not, all, or part of, the instructions which follow will be ineffective.
Subroutine OPENG is used to open a segment:
SUBROUTINE OPENG(NOM) INTEGER NOM
This subroutine opens a segment called "NOM". If this segment does not exist already, it will be created. If it exists, it will be enriched. All graphics components created following this command will be added to the segment's contents until such a time as a CLOSEG command, or another OPENG command is encountered: In fact, it is possible to nest the OPENG and CLOSEG commands. Thus
CALL OPENG(1) ..... CALL OPENG(2) ..... CALL OPENG(3) .... CALL CLOSEG ..... CALL CLOSEG ..... CALL CLOSEG
is identical to the following sequence:
CALL OPENG(1) ..... CALL CLOSEG CALL OPENG(2) ..... CALL CLOSEG CALL OPENG(3) ..... CALL CLOSEG CALL OPENG(2) ..... CALL CLOSEG CALL OPENG(1) ..... CALL CLOSEG
There can be up to ten levels of nesting. Depending on the segment's status, visible or not (see commands DSPLAY and REMOVG), the graphics components will appear, or not, immediately after its description.
The following subroutines correspond to useful screen management operations:
SUBROUTINE CLOSEG
indicates the closing of a segment currently open. If the segment does not exist, this command is without effect.
SUBROUTINE KILL(NOM) INTEGER NOM
deletes the segment called NOM. If the segment was displayed, it will disappear from the screen. If the segment does not exist, this command is without effect.
SUBROUTINE DSPLAY(NOM) INTEGER NOM
display segment NOM on the screen. If it is already displayed, or if it does not exist, this command is without effect.
SUBROUTINE REMOVG(NOM) INTEGER NOM
removes segment NOM from the screen. If it is not displayed, or if it does not exist, this command is without effect.
SUBROUTINE HIGHLT(NOM, I) INTEGER NOM, I
highlights segment NOM by an arbitrary method (flashing, changing the color or intensity). The choice between these different techniques depends on the terminal used. It is therefore necessary to do it in such a manner as not to interfere with the characteristics of the graphics components. The value of "I" indicates if there is highlighting (value 1), or not (value 0). if the segment does not exist, this command is without effect.
SUBROUTINE CLEAN
cleans the screen completely (all existing segments are erased, but not deleted, at this moment). This command must be interpreted by all terminals.
SUBROUTINE UPDATE
up-dates the screen. In fact, certain terminals requires the complete description of the image before producing it. Others, for efficiency reasons, only perform modifications on an explicit command.
SUBROUTINE HARDCP(CHOIX1, CHOIX2) INTEGER CHOIX1, CHOIX2
produces a hardcopy of the terminal's screen .