Appearance
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
| Name | Type | Attributes | Description |
|---|---|---|---|
right | type(vector) | Screen abscissa. | |
up | type(vector) | Screen ordinate. | |
lo | real(kind=R8P) | Lower left corner of what was written. | |
hi | real(kind=R8P) | Upper right corner of what was written. | |
text_end | real(kind=R8P) | allocatable | Abscissa and length (characters) of each label. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
look | pass(self) | Set the view from azimuth and elevation. |
look_from | pass(self) | Set the view from the direction towards the viewer. |
axes | pass(self) | Write the Cartesian axes and their labels. |
arrow | pass(self) | Write an arrow: x y dx dy (style vectors). |
segment | pass(self) | Write a segment: two points and a blank line (style lines). |
polygon | pass(self) | Write a closed polygon: its points, the first again, a blank line. |
label | pass(self) | Write a label: x y "text" (style labels). |
point | pass(self) | Write a point: x y (style points). |
frame | pass(self) | Write the ranges that show the whole drawing. |
grow | pass(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
azimuth | real(kind=R8P) | in | Azimuth [deg]. | |
elevation | real(kind=R8P) | in | Elevation [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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
eye | type(vector) | in | Direction 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
name | character(len=*) | in | Name of the figure. | |
length | real(kind=R8P) | in | Length of the axes. |
Call graph
arrow
Write an arrow from tail to head.
fortran
subroutine arrow(self, unit, tail, head)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
unit | integer | in | Data file. | |
tail | type(vector) | in | Tail of the arrow. | |
head | type(vector) | in | Head of the arrow. |
Call graph
segment
Write the segment from a to b.
fortran
subroutine segment(self, unit, a, b)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
unit | integer | in | Data file. | |
a | type(vector) | in | First end. | |
b | type(vector) | in | Second end. |
Call graph
polygon
Write the closed polygon through vertices.
fortran
subroutine polygon(self, unit, vertices)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
unit | integer | in | Data file. | |
vertices | type(vector) | in | Vertices, in order. |
Call graph
label
Write the label text at at.
fortran
subroutine label(self, unit, at, text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
unit | integer | in | Data file. | |
at | type(vector) | in | Position. | |
text | character(len=*) | in | Text. |
Call graph
point
Write the point at.
fortran
subroutine point(self, unit, at)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
unit | integer | in | Data file. | |
at | type(vector) | in | Position. |
Call graph
grow
Extend the extent of the drawing to the point at.
fortran
subroutine grow(self, at)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
at | type(vector) | in | Position. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(view_object) | inout | The view. | |
name | character(len=*) | in | Name of the figure. |