Standard Vector Layers — Vector layers that are distributed with Gwyddion
Vector layers, implementing means how user can draw on data views, are provided by layer modules, so that third party tools (implemented by tool modules) can define their own means of user interaction.
There are several standard layers distributed with Gwyddion, and their features and interface is the subject of this section. All layers are subclasses of GwyVectorLayer sharing its basic interface. Each layer lets the user draw or select different shapes, therefore each module also defines its own selection object type determining the format of selection data. All selections are subclasses of GwySelection. By convention, layer type Foo is called GwyLayerFoo and the corresponding selection type GwySelectionFoo.
Layers and selections sometimes have additional object properties not present in the base classes, these are described here too.
GObject* g_object_new(g_type_from_name("GwyLayerAxis"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionAxis"), NULL);
The layer allows selecting one or more horizontal or vertical (full-width or full-height) lines, called axes. It can be also viewes as a way to select separate x or y coordinates.
Selection data consists of single coordinates. More precisely, of y-coordinates for horizontal axes and x-coordinates for vertical axes. Each coordinate represents a selected axis.
None.
" |
Line orientation: horizontal or vertical. The default orientation is horizontal. |
GObject* g_object_new(g_type_from_name("GwyLayerCross"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionCross"), NULL);
The layer allows selecting a number of simultaneous horizontal and vertical lines. Usually the selection is displayed as a large cross, but it can also show only the horizontal and vertical lines or just the cross point marker.
Selection data consists of coordinate pairs (x, y) representing selected cross centres.
Whether the horizontal line should be drawn. The default is draw the horizontal line. |
|
Whether the vertical line should be drawn. The default is draw the vertical line. |
|
Width of orthogonal ticks at line ends. The default is no ticks. |
None.
GObject* g_object_new(g_type_from_name("GwyLayerEllipse"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionEllipse"), NULL);
The layer allows selecting a number of ellipses.
Selection data consists of quadruples of coordinates (x0, y0, x1, y1), each representing one selected ellipse, where x0 and y0 are coordinates of one bounding box corner and x1 and y1 of the opposite corner. Each one can be any of the four bounding box corners, there is no guarantee one is for example always top-left.
Whether central reflection of selection should be drawn too. The default is to not draw reflection. |
|
Whether the selection should snap to the center. The default is not to snap. |
None.
GObject* g_object_new(g_type_from_name("GwyLayerLine"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionLine"), NULL);
The layer allows selecting one or more lines of arbitrary orientation and length, optionally can display line numbers next to each line.
Selection data consists of quadruples of coordinates (x0, y0, x1, y1), each representing one selected line, where x0 and y0 are coordinates of one line end and x1 and y1 of the other end.
Whether line numbers should be displayed next to them. The default is to show line numbers. |
|
Width of orthogonal ticks at line ends. The default is no ticks. |
|
Whether an tick is drawn in the line centre. The default is not to drawn the central tick. Since: 2.42 |
None.
GObject* g_object_new(g_type_from_name("GwyLayerPoint"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionPoint"), NULL);
The layer allows selecting a number of points, either displayed as crosses, crosses with concentric circles, or with no graphical representation (the latter mainly useful with only one selected point).
Selection data consists of coordinate pairs (x, y) representing selected points.
If set to TRUE, points will be displayed. Otherwise they will be invisible. |
|
Specifies the radius of the circle to draw around all selected points.
If set to zero and/or if " |
|
Whether point numbers should be displayed next to them. The default is not to show point numbers. |
|
Whether points should be instead drawn as vector from the origin. This setting may interact poorly with other drawing options. The default is to draw points as points. |
None.
GObject* g_object_new(g_type_from_name("GwyLayerRectangle"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionRectangle"), NULL);
The layer allows selecting a number of rectangles, that can be drawn with a couple of fancy/special styles.
Selection data consists of quadruples of coordinates (x0, y0, x1, y1), each representing one selected rectangle, where x0 and y0 are coordinates of one corner and x1 and y1 of the opposite corner. Each one can be any of the four rectangle corners, there is no guarantee one is for example always top-left.
Whether lines should be drawn always from border to border, as in the Crop tool. The default is to draw just outline of the selected rectangle. |
|
Whether central reflection of selection should be drawn too. The default is to not draw reflection. |
|
Whether the selection should snap to the center. The default is to not snap. |
None.
GObject* g_object_new(g_type_from_name("GwyLayerLattice"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionLattice"), NULL);
The layer allows selecting a pair of two-dimensional vectors, that represent a lattice in the plane. The selection is also visualised as a lattice.
Selection data consists of quadruples of coordinates (x0, y0, x1, y1), each representing the two selected lattice vectors, where x0 and y0 are coordinates of one vector and x1 and y1 of the other.
Although the selection can contain multiple such pairs, the layer ignores all except the first one.
None.
GObject* g_object_new(g_type_from_name("GwyLayerProjective"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionProjective"), NULL);
The layer allows selecting tetragons representing perspective projections of a rectangle in the plane. The selection is visualised as the perspective rectangle, possibly with a grid inside.
Selection data consists of octuples of coordinates (x0, y0, x1, y1, x2, y2, x3, y3), each representing the four vertices 0, 1, 2 and 3, in order around the perimeter.
Although the selection can contain multiple such tetragon, the layer ignores all except the first one.
The number of grille lines drawn inside the tetragon. |
|
Whether editing the tetragon must leave it convex and non-degenerated. The result of programatically setting a non-convex selection when convex is TRUE is undefined. The default is to only allow convex tetragons. |
None.
GObject* g_object_new(g_type_from_name("GwyLayerPath"), NULL); GObject* g_object_new(g_type_from_name("GwySelectionPath"), NULL);
The layer allows selecting a long spline curve passing through given points.
Selection data consists of coordinate pairs (x, y) representing the points defining the curve. The curve is implicitly oriented from the first pair to the last one.
How much the curve is slack/taut, from the interval [0, sqrt(2)]. Value of 0 corresponds to completely taut curve, i.e. straight lines connecting the points. Value of 1 corresponds to free curve. The default value is 1/sqrt(2). |
|
Whether the curve is closed, i.e. continues smoothly from the last point back to the first point. The default is open-ended (not closed) curve. |