## Standard Vector Layers

Standard Vector Layers — Vector layers that are distributed with Gwyddion

## Overview

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.

## GwyLayerAxis, GwySelectionAxis

    GObject*    g_object_new(g_type_from_name("GwyLayerAxis"), NULL);
    GObject*    g_object_new(g_type_from_name("GwySelectionAxis"), NULL);

Layer allows to select 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.

### GwyLayerAxis properties

None.

### GwySelectionAxis properties

"`orientation`" (GwyOrientation : Read / Write) | Line orientation: horizontal or vertical. Default orientation is horizontal.

## GwyLayerEllipse, GwySelectionEllipse

    GObject*    g_object_new(g_type_from_name("GwyLayerEllipse"), NULL);
    GObject*    g_object_new(g_type_from_name("GwySelectionEllipse"), NULL);

Layer allows to select 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.

### GwyLayerEllipse properties

"`draw-reflection`" (gboolean : Read / Write) | Whether central reflection of selection should be drawn too. The default is to not draw reflection.
"`snap-to-center`" (gboolean : Read / Write) | Whether the selection should snap to the center. Default is to not snap.

### GwySelectionEllipse properties

None.

## GwyLayerLine, GwySelectionLine

    GObject*    g_object_new(g_type_from_name("GwyLayerLine"), NULL);
    GObject*    g_object_new(g_type_from_name("GwySelectionLine"), NULL);

Layer allows to select 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.

### GwyLayerLine properties

"`line-numbers`" (gboolean : Read / Write) | Whether line numbers should be displayed next to them. Default is to show line numbers.

### GwySelectionLine properties

None.

## GwyLayerPoint, GwySelectionPoint

    GObject*    g_object_new(g_type_from_name("GwyLayerPoint"), NULL);
    GObject*    g_object_new(g_type_from_name("GwySelectionPoint"), NULL);

Layer allows to select 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.

### GwyLayerPoint properties

"`draw-marker`" (gboolean : Read / Write) | If set to TRUE, points will be displayed. Otherwise they will be invisible.
"`marker-radius`" (gboolean : Read / Write) | Specifies the radius of the circle to draw around all selected points. If set to zero and/or if "`draw-marker`" is set to FALSE, no circle will be drawn. Default is a radius of zero.

### GwySelectionPoint properties

None.

## GwyLayerRectangle, GwySelectionRectangle

    GObject*    g_object_new(g_type_from_name("GwyLayerRectangle"), NULL);
    GObject*    g_object_new(g_type_from_name("GwySelectionRectangle"), NULL);

Layer allows to select 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.

### GwyLayerRectangle properties

"`is-crop`" (gboolean : Read / Write) | 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.
"`draw-reflection`" (gboolean : Read / Write) | Whether central reflection of selection should be drawn too. The default is to not draw reflection.
"`snap-to-center`" (gboolean : Read / Write) | Whether the selection should snap to the center. Default is to not snap.

### GwySelectionRectangle properties

None.