Next: 4 Creating a 3D image
Up: 3 Creating a 2D image
Prev: 3.1 Masks and windows
Contents
The objects described using the following subroutines will only be affected by the definition of MASQU2 and FENTR2. The current position in 2D is independent of that in 3D.
As seen in the presentation, the objects are described in the user's own coordinate system (we now know that it corresponds to choosing the appropriate mask).
The coordinates are expressed in single precision real numbers, the origin being situated at (0., 0.). They are defined with respect to a direct orthogonal axis system.
The subroutines in which the plot type is specified are described in Chapter 5, dealing with graphics.
The following subroutines constitute the catalogue of 2D objects:
SUBROUTINE MOV2TO(X, Y) REAL X, Y
moves the cursor to the point with coordinates (X, Y).
SUBROUTINE MOV2OF(U, V) REAL U, V
moves the cursor by a vector (U, V).
SUBROUTINE LIN2TO(X, Y) REAL X, Y
creates a segment beginning at the current position and ending at the point with coordinates (X, Y). The end-point then becomes the current cursor position.
SUBROUTINE LIN2OF(U, V) REAL U, V
creates a segment defined by a vector (U, V) beginning at the current cursor position. The segment's end-point then becomes the current cursor position.
SUBROUTINE CURVE2(TX, TY, NB) REAL TX(NB), TY(NB) INTEGER NB
plots a broken line whose coordinates at the NB successive vertices are stored in arrays TX and TY. At the end of the plot, the current cursor position is (TX(NB), TY(NB)).
SUBROUTINE CIRCL2(XC, YC, R, NBA) REAL XC, YC, R INTEGER NBA
plots a regular???/straight??? polygon with NBA sides which approaches the circle with center (XC, YC) and radius R. At the end of the plot, the current cursor position is (XC+R, YC).
SUBROUTINE CRCLC2(XCENTR, YCENTR, X, Y, NBSEGM) INTEGER NBSEGM REAL XCENTR, YCENTR, X, Y
plots a line with NBSEGM sides approaching the circle with center (XCENTR, YCENTR) and going through (X, Y).
SUBROUTINE ARC2(ANGLE, CENTRE, POINT, NBA) REAL ANGLE, CENTRE(2), POINT(2) INTEGER NBA
plots a polyline formed by NBA sides approaching an arc of the circle with center (CENTRE(1), CENTRE(2)), origin (POINT(1), POINT(2)), and forming an angle of ANGLE radians in the positive trigonometric direction. At the end of the plot, the current cursor position is the last point plotted.
SUBROUTINE RECTA2(P1, P2) REAL P1(2), P2(2)
plots a rectangle with sides parallel to the diagonal axes:
(P1(1), P1(2)) -- (P2(1), P2(2))
At the end of the plot, the current cursor position is the point (P1(1), P1(2)).
SUBROUTINE DRECT2(X,Y,DX,DY) REAL X,Y,DX,DY
plots a rectangle whose 4 vertices are (X, Y), (X+DX, Y), (X, Y+DY) and (X+DX, Y+DY) (user coordinates).
SUBROUTINE POLY2(X, Y, NB) REAL X(NB), Y(NB) INTEGER NB
plots a polygon with NB vertices whose coordinates are stored in arrays X and Y. At the end of the plot, the current cursor position is the point (X(1), Y(1)).
SUBROUTINE POLY2F(X, Y, NB, CFAC, CCONT, IFLAG) INTEGER NB, CFAC, CCONT, IFLAG REAL X(NB), Y(NB)
where:
X(1:NB), Y(1:NB): Coordinates of the vertices of the polygon; NB: Number of polygon vertices (NB < 50); CFAC: Number of the facet color; CCONT: Number of the contour color; IFLAG: Plot option:
If the facet is convex, the clipping corresponding to the current mask will be correct. If the facet is not convex and if the non-convex part is cut by the current mask, there will be a slight default in this area (one line rejoining the two ends).
The subroutines utilized to specify the colors are described in Chapter 5.
The subroutine described below generates text formed by "HARDWARE" characters. Another subroutine exits which caters for "SOFTWARE" characters, described in the chapter 4, devoted to 3D images.
SUBROUTINE TXT2D(STRING, NB, X, Y) CHARACTER*(*) STRING INTEGER NB REAL X, Y
plots, beginning at position (X, Y), the text consisting of NB characters contained in the character string STRING. The current cursor position becomes point (X, Y).
The subroutines to specify the size, direction, ..., of the text are detailed in Chapter 5, dealing with graphics.