API reference - Class Region::Metrics

Notation used in Ruby API documentation

Module: db

Description: This class represents the metrics type for \Region#width and related checks.

This class is equivalent to the class Region::Metrics

This enum has been introduced in version 0.27.

Public constructors

new Region::Metrics ptrnew(int i)Creates an enum from an integer value
new Region::Metrics ptrnew(string s)Creates an enum from a string value

Public methods

[const]bool!=(const Region::Metrics other)Compares two enums for inequality
[const]bool<(const Region::Metrics other)Returns true if the first enum is less (in the enum symbol order) than the second
[const]bool==(const Region::Metrics other)Compares two enums
[const]stringinspectConverts an enum to a visual string
[const]intto_iGets the integer value from the enum
[const]stringto_sGets the symbolic string from an enum

Public static methods and constants

[static,const]Region::MetricsEuclidianSpecifies Euclidian metrics for the check functions
[static,const]Region::MetricsProjectionSpecifies projected distance metrics for the check functions
[static,const]Region::MetricsSquareSpecifies square metrics for the check functions

Detailed description

!=

Signature: [const] bool != (const Region::Metrics other)

Description: Compares two enums for inequality

<

Signature: [const] bool < (const Region::Metrics other)

Description: Returns true if the first enum is less (in the enum symbol order) than the second

==

Signature: [const] bool == (const Region::Metrics other)

Description: Compares two enums

Euclidian

Signature: [static,const] Region::Metrics Euclidian

Description: Specifies Euclidian metrics for the check functions

This value can be used for the metrics parameter in the check functions, i.e. width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by:

d = sqrt(dx^2 + dy^2)

All points within a circle with radius d around one point are considered to have a smaller distance than d.

Projection

Signature: [static,const] Region::Metrics Projection

Description: Specifies projected distance metrics for the check functions

This value can be used for the metrics parameter in the check functions, i.e. width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other.

Square

Signature: [static,const] Region::Metrics Square

Description: Specifies square metrics for the check functions

This value can be used for the metrics parameter in the check functions, i.e. width_check. This value specifies square metrics, i.e. the distance between two points is measured by:

d = max(abs(dx), abs(dy))

All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics.

inspect

Signature: [const] string inspect

Description: Converts an enum to a visual string

Python specific notes:
This method is also available as 'repr(object)'

new

(1) Signature: [static] new Region::Metrics ptr new (int i)

Description: Creates an enum from an integer value

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

(2) Signature: [static] new Region::Metrics ptr new (string s)

Description: Creates an enum from a string value

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

to_i

Signature: [const] int to_i

Description: Gets the integer value from the enum

to_s

Signature: [const] string to_s

Description: Gets the symbolic string from an enum

Python specific notes:
This method is also available as 'str(object)'