API reference - Class Marker

Notation used in Ruby API documentation

Module: lay

Description: The floating-point coordinate marker object

The marker is a visual object that "marks" (highlights) a certain area of the layout, given by a database object. This object accepts database objects with floating-point coordinates in micron values.

Since version 0.29.3, markers can be attached to views in two ways: self-managed or persistent.

Self-managed markers are created with a view argument. When the variable goes out of scope, the and the Marker object is released, the marker vanishes. This was the only concept before 0.29.3:

view = ... # some LayoutView
marker = RBA::Marker::new(view)

Persistent markers on the other hand are attached to the view and stay within the view. To create a persistent marker, do not use a view argument to the constructor. Instead add them to the view using LayoutView#add_marker. To remove persistent markers, use LayoutView#clear_markers (removes all) or call _destroy on a specific marker:

view = ... # some LayoutView
marker = RBA::Marker::new
view.add_marker(marker)
...
view.clear_markers

Persistent markers do not need to be held in separate variables to keep them visible. In some applications this may be useful.

Public constructors

new Marker ptrnew(LayoutView ptr view = nil)Creates a marker

Public methods

[const]Marker ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]unsigned intcolorGets the color of the marker
voidcolor=(unsigned int color)Sets the color of the marker
voiddismissable=(bool flag)Sets a value indicating whether the marker can be hidden
[const]booldismissable?Gets a value indicating whether the marker can be hidden
[const]intdither_patternGets the stipple pattern index
voiddither_pattern=(int index)Sets the stipple pattern index
[const]unsigned intframe_colorGets the frame color of the marker
voidframe_color=(unsigned int color)Sets the frame color of the marker
[const]inthaloGets the halo flag
voidhalo=(int halo)Sets the halo flag
[const]boolhas_color?Returns a value indicating whether the marker has a specific color
[const]boolhas_frame_color?Returns a value indicating whether the marker has a specific frame color
[const]intline_styleGet the line style
voidline_style=(int index)Sets the line style
[const]intline_widthGets the line width of the marker
voidline_width=(int width)Sets the line width of the marker
voidreset_colorResets the color of the marker
voidreset_frame_colorResets the frame color of the marker
voidset(const DBox box)Sets the box the marker is to display
voidset(const DText text)Sets the text the marker is to display
voidset(const DEdge edge)Sets the edge the marker is to display
voidset(const DPath path)Sets the path the marker is to display
voidset(const DPolygon polygon)Sets the polygon the marker is to display
voidset_box(const DBox box)Sets the box the marker is to display
voidset_edge(const DEdge edge)Sets the edge the marker is to display
voidset_path(const DPath path)Sets the path the marker is to display
voidset_polygon(const DPolygon polygon)Sets the polygon the marker is to display
voidset_text(const DText text)Sets the text the marker is to display
[const]intvertex_sizeGets the vertex size of the marker
voidvertex_size=(int size)Sets the vertex size of the marker

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

_const_cast

Signature: [const] Marker ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

color

Signature: [const] unsigned int color

Description: Gets the color of the marker

This value is valid only if has_color? is true.

Python specific notes:
The object exposes a readable attribute 'color'. This is the getter.

color=

Signature: void color= (unsigned int color)

Description: Sets the color of the marker

The color is a 32bit unsigned integer encoding the RGB values in the lower 3 bytes (blue in the lowest significant byte). The color can be reset with reset_color, in which case, the default foreground color is used.

Python specific notes:
The object exposes a writable attribute 'color'. This is the setter.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dismissable=

Signature: void dismissable= (bool flag)

Description: Sets a value indicating whether the marker can be hidden

Dismissable markers can be hidden setting "View/Show Markers" to "off". The default setting is "false" meaning the marker can't be hidden.

This attribute has been introduced in version 0.25.4.

Python specific notes:
The object exposes a writable attribute 'dismissable'. This is the setter.

dismissable?

Signature: [const] bool dismissable?

Description: Gets a value indicating whether the marker can be hidden

See dismissable= for a description of this predicate.

Python specific notes:
The object exposes a readable attribute 'dismissable'. This is the getter.

dither_pattern

Signature: [const] int dither_pattern

Description: Gets the stipple pattern index

See dither_pattern= for a description of the stipple pattern index.

Python specific notes:
The object exposes a readable attribute 'dither_pattern'. This is the getter.

dither_pattern=

Signature: void dither_pattern= (int index)

Description: Sets the stipple pattern index

A value of -1 or less than zero indicates that the marker is not filled. Otherwise, the value indicates which pattern to use for filling the marker.

Python specific notes:
The object exposes a writable attribute 'dither_pattern'. This is the setter.

frame_color

Signature: [const] unsigned int frame_color

Description: Gets the frame color of the marker

This value is valid only if has_frame_color? is true.The set method has been added in version 0.20.

Python specific notes:
The object exposes a readable attribute 'frame_color'. This is the getter.

frame_color=

Signature: void frame_color= (unsigned int color)

Description: Sets the frame color of the marker

The color is a 32bit unsigned integer encoding the RGB values in the lower 3 bytes (blue in the lowest significant byte). The color can be reset with reset_frame_color, in which case the fill color is used. The set method has been added in version 0.20.

Python specific notes:
The object exposes a writable attribute 'frame_color'. This is the setter.

halo

Signature: [const] int halo

Description: Gets the halo flag

See halo= for a description of the halo flag.

Python specific notes:
The object exposes a readable attribute 'halo'. This is the getter.

halo=

Signature: void halo= (int halo)

Description: Sets the halo flag

The halo flag is either -1 (for taking the default), 0 to disable the halo or 1 to enable it. If the halo is enabled, a pixel border with the background color is drawn around the marker, the vertices and texts.

Python specific notes:
The object exposes a writable attribute 'halo'. This is the setter.

has_color?

Signature: [const] bool has_color?

Description: Returns a value indicating whether the marker has a specific color

has_frame_color?

Signature: [const] bool has_frame_color?

Description: Returns a value indicating whether the marker has a specific frame color

The set method has been added in version 0.20.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

line_style

Signature: [const] int line_style

Description: Get the line style

See line_style= for a description of the line style index. This method has been introduced in version 0.25.

Python specific notes:
The object exposes a readable attribute 'line_style'. This is the getter.

line_style=

Signature: void line_style= (int index)

Description: Sets the line style

The line style is given by an index. 0 is solid, 1 is dashed and so forth.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'line_style'. This is the setter.

line_width

Signature: [const] int line_width

Description: Gets the line width of the marker

See line_width= for a description of the line width.

Python specific notes:
The object exposes a readable attribute 'line_width'. This is the getter.

line_width=

Signature: void line_width= (int width)

Description: Sets the line width of the marker

This is the width of the line drawn for the outline of the marker.

Python specific notes:
The object exposes a writable attribute 'line_width'. This is the setter.

new

Signature: [static] new Marker ptr new (LayoutView ptr view = nil)

Description: Creates a marker

A marker is always associated with a view, in which it is shown. The view this marker is associated with must be passed to the constructor.

See the class description about the options for attaching markers to a view.

The 'view' argument is optional since version 0.29.3.

Python specific notes:
This method is the default initializer of the object.

reset_color

Signature: void reset_color

Description: Resets the color of the marker

See set_color for a description of the color property of the marker.

reset_frame_color

Signature: void reset_frame_color

Description: Resets the frame color of the marker

See set_frame_color for a description of the frame color property of the marker.The set method has been added in version 0.20.

set

(1) Signature: void set (const DBox box)

Description: Sets the box the marker is to display

Makes the marker show a box. The box must be given in micron units. If the box is empty, no marker is drawn. The set method has been added in version 0.20.

(2) Signature: void set (const DText text)

Description: Sets the text the marker is to display

Makes the marker show a text. The text must be given in micron units. The set method has been added in version 0.20.

(3) Signature: void set (const DEdge edge)

Description: Sets the edge the marker is to display

Makes the marker show a edge. The edge must be given in micron units. The set method has been added in version 0.20.

(4) Signature: void set (const DPath path)

Description: Sets the path the marker is to display

Makes the marker show a path. The path must be given in micron units. The set method has been added in version 0.20.

(5) Signature: void set (const DPolygon polygon)

Description: Sets the polygon the marker is to display

Makes the marker show a polygon. The polygon must be given in micron units. The set method has been added in version 0.20.

set_box

Signature: void set_box (const DBox box)

Description: Sets the box the marker is to display

Makes the marker show a box. The box must be given in micron units. If the box is empty, no marker is drawn. The set method has been added in version 0.20.

set_edge

Signature: void set_edge (const DEdge edge)

Description: Sets the edge the marker is to display

Makes the marker show a edge. The edge must be given in micron units. The set method has been added in version 0.20.

set_path

Signature: void set_path (const DPath path)

Description: Sets the path the marker is to display

Makes the marker show a path. The path must be given in micron units. The set method has been added in version 0.20.

set_polygon

Signature: void set_polygon (const DPolygon polygon)

Description: Sets the polygon the marker is to display

Makes the marker show a polygon. The polygon must be given in micron units. The set method has been added in version 0.20.

set_text

Signature: void set_text (const DText text)

Description: Sets the text the marker is to display

Makes the marker show a text. The text must be given in micron units. The set method has been added in version 0.20.

vertex_size

Signature: [const] int vertex_size

Description: Gets the vertex size of the marker

See vertex_size= for a description.

Python specific notes:
The object exposes a readable attribute 'vertex_size'. This is the getter.

vertex_size=

Signature: void vertex_size= (int size)

Description: Sets the vertex size of the marker

This is the size of the rectangles drawn for the vertices object.

Python specific notes:
The object exposes a writable attribute 'vertex_size'. This is the setter.