Skip to content

sketch ​

The drawings of the documentation: points in space seen from a direction, written as data files for foresight.

A view projects a point onto the plane of the screen with two dot products, its abscissa along right and its ordinate along up: the figures are computed by VecFor itself. Each layer of a drawing is a data file in the layout read by the foresight style that draws it. The view keeps the extent of all it wrote, and frame writes the ranges that show it whole, at the same scale on both axes, for the foresight script of the figure.

Source: src/third_party/VecFor/docs/examples/lib/sketch.f90

Dependencies

Contents ​

Derived Types ​

view_object ​

A direction of view: the screen axes, unit vectors orthogonal to the direction of view and to each other.

Components ​

NameTypeAttributesDescription
righttype(vector)Screen abscissa.
uptype(vector)Screen ordinate.
loreal(kind=R8P)Lower left corner of what was written.
hireal(kind=R8P)Upper right corner of what was written.
text_endreal(kind=R8P)allocatableAbscissa and length (characters) of each label.

Type-Bound Procedures ​

NameAttributesDescription
lookpass(self)Set the view from azimuth and elevation.
look_frompass(self)Set the view from the direction towards the viewer.
axespass(self)Write the Cartesian axes and their labels.
arrowpass(self)Write an arrow: x y dx dy (style vectors).
segmentpass(self)Write a segment: two points and a blank line (style lines).
polygonpass(self)Write a closed polygon: its points, the first again, a blank line.
labelpass(self)Write a label: x y "text" (style labels).
pointpass(self)Write a point: x y (style points).
framepass(self)Write the ranges that show the whole drawing.
growpass(self)Extend the extent to a point of the screen.

Subroutines ​

look ​

Set the view: the viewer is far away in the direction of azimuth (from x towards y) and elevation (from the xy plane towards z), both in degrees. The z axis is drawn upwards.

fortran
subroutine look(self, azimuth, elevation)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
azimuthreal(kind=R8P)inAzimuth [deg].
elevationreal(kind=R8P)inElevation [deg].

Call graph

look_from ​

Set the view: the viewer is far away in the direction eye; z is drawn upwards, unless eye is along z.

fortran
subroutine look_from(self, eye)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
eyetype(vector)inDirection towards the viewer.

Call graph

axes ​

Write the axes x, y, z from the origin, length long, into name.axes.dat and their labels into name.axlabels.dat.

fortran
subroutine axes(self, name, length)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
namecharacter(len=*)inName of the figure.
lengthreal(kind=R8P)inLength of the axes.

Call graph

arrow ​

Write an arrow from tail to head.

fortran
subroutine arrow(self, unit, tail, head)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
unitintegerinData file.
tailtype(vector)inTail of the arrow.
headtype(vector)inHead of the arrow.

Call graph

segment ​

Write the segment from a to b.

fortran
subroutine segment(self, unit, a, b)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
unitintegerinData file.
atype(vector)inFirst end.
btype(vector)inSecond end.

Call graph

polygon ​

Write the closed polygon through vertices.

fortran
subroutine polygon(self, unit, vertices)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
unitintegerinData file.
verticestype(vector)inVertices, in order.

Call graph

label ​

Write the label text at at.

fortran
subroutine label(self, unit, at, text)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
unitintegerinData file.
attype(vector)inPosition.
textcharacter(len=*)inText.

Call graph

point ​

Write the point at.

fortran
subroutine point(self, unit, at)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
unitintegerinData file.
attype(vector)inPosition.

Call graph

grow ​

Extend the extent of the drawing to the point at.

fortran
subroutine grow(self, at)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
attype(vector)inPosition.

Call graph

frame ​

Write name.frame.gp: the ranges that show the whole drawing with a margin, and the size ratio that keeps the same scale on both axes. The labels are written left of their point, about 80 characters in the width of the plot.

fortran
subroutine frame(self, name)

Arguments

NameTypeIntentAttributesDescription
selfclass(view_object)inoutThe view.
namecharacter(len=*)inName of the figure.