KLayout Manual: Main Index » Class Index » API reference - Class Annotation

API reference - Class Annotation

Notation used in Ruby API documentation

Description: This class implements an "annotation object"

Annotation objects provide a way to attach measurements or descriptive informations to a layout view. Annotation objects can appear as rulers for example. Annotation objects can be configured in different ways using the styles provided. By configuring an annotation object properly, it can appear as a rectangle or a plain line for example. In version 0.22, the constants have been converted to upper-case constants which is compliant with Ruby's naming convention for constants.

Public constructors

new AnnotationnewCreate a new ruler or marker with the default attributes

Public methods

[const]bool!=(const Annotation arg1)Inequality operator
[const]bool==(const Annotation arg1)Equality operator
[const]intangle_constraintReturn the angle constraint attribute.
voidangle_constraint=(int flag)Set the angle constraint attribute.
[const]voidassign(const Annotation other)Assign the contents of another object to self
[const]DBoxboxGet the bounding box of the object (not including text)
voidcreateEnsures the C++ object is created
voiddestroyExplicitly destroy the object
[const]booldestroyed?Returns a value indicating whether the object was already destroyed
[const]AnnotationdupCreates a copy of self
[const]stringfmtReturns the format used for the label
voidfmt=(string format)Set the format used for the label
[const]stringfmt_xReturns the format used for the x-axis label
voidfmt_x=(string format)Set the format used for the x-axis label
[const]stringfmt_yReturns the format used for the y-axis label
voidfmt_y=(string format)Set the format used for the y-axis label
[const]boolis_const_object?Returns a value indicating whether the reference is a const reference
[const]intoutlineReturns the outline style of the annotation object
voidoutline=(int outline)Set the outline style used for drawing the annotation object
[const]DPointp1Get the first point of the ruler or marker
voidp1=(const DPoint point)Set the first point of the ruler or marker
[const]DPointp2Get the second point of the ruler or marker
voidp2=(const DPoint point)Set the second point of the ruler or marker
voidsnap=(bool flag)Set the 'snap to objects' attribute.
[const]boolsnap?Return the 'snap to objects' attribute.
[const]intstyleReturns the style of the annotation object
voidstyle=(int style)Set the style used for drawing the annotation object
[const]stringtextReturn the formatted text for the main label.
[const]stringtext_xReturn the formatted text for the x-axis label.
[const]stringtext_yReturn the formatted text for the y-axis label.
[const]stringto_sReturns the string representation of the ruler.
[const]Annotationtransformed(const DTrans t)Transform the ruler or marker with the given simple transformation
[const]Annotationtransformed_cplx(const DCplxTrans t)Transform the ruler or marker with the given complex transformation
[const]Annotationtransformed_cplx(const ICplxTrans t)Transform the ruler or marker with the given complex transformation

Public static methods and constants

intAngleAnyangle_any code used by the angle_constraint method
intAngleDiagonalangle_diagonal code used by the angle_constraint method
intAngleGlobalangle_global code used by the angle_constraint method.
intAngleHorizontalangle_horizontal code used by the angle_constraint method
intAngleOrthoangle_ortho code used by the angle_constraint method
intAngleVerticalangle_vertical code used by the angle_constraint method
intOutlineBoxoutline_box code used by the outline method
intOutlineDiagoutline_diag code used by the outline method
intOutlineDiagXYoutline_diag_xy code used by the outline method
intOutlineDiagYXoutline_diag_yx code used by the outline method
intOutlineXYoutline_xy code used by the outline method
intOutlineYXoutline_yx code used by the outline method
intStyleArrowBothstyle_arrow_both code used by the style method
intStyleArrowEndstyle_arrow_end code used by the style method
intStyleArrowStartstyle_arrow_start code used by the style method
intStyleLinestyle_line code used by the style method
intStyleRulerstyle_ruler code used by the style method

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

[static]intangle_anyUse of this method is deprecated. Use AngleAny instead
[static]intangle_diagonalUse of this method is deprecated. Use AngleDiagonal instead
[static]intangle_globalUse of this method is deprecated. Use AngleGlobal instead
[static]intangle_horizontalUse of this method is deprecated. Use AngleHorizontal instead
[static]intangle_orthoUse of this method is deprecated. Use AngleOrtho instead
[static]intangle_verticalUse of this method is deprecated. Use AngleVertical instead
[static]intoutline_boxUse of this method is deprecated. Use OutlineBox instead
[static]intoutline_diagUse of this method is deprecated. Use OutlineDiag instead
[static]intoutline_diag_xyUse of this method is deprecated. Use OutlineDiagXY instead
[static]intoutline_diag_yxUse of this method is deprecated. Use OutlineDiagYX instead
[static]intoutline_xyUse of this method is deprecated. Use OutlineXY instead
[static]intoutline_yxUse of this method is deprecated. Use OutlineYX instead
[static]intstyle_arrow_bothUse of this method is deprecated. Use StyleArrowBoth instead
[static]intstyle_arrow_endUse of this method is deprecated. Use StyleArrowEnd instead
[static]intstyle_arrow_startUse of this method is deprecated. Use StyleArrowStart instead
[static]intstyle_lineUse of this method is deprecated. Use StyleLine instead
[static]intstyle_rulerUse of this method is deprecated. Use StyleRuler instead

Detailed description

[const] bool !=(const Annotation arg1)

Description: Inequality operator

[const] bool ==(const Annotation arg1)

Description: Equality operator

[static] int AngleAny

Description: angle_any code used by the angle_constraint method

[static] int AngleDiagonal

Description: angle_diagonal code used by the angle_constraint method

[static] int AngleGlobal

Description: angle_global code used by the angle_constraint method.

This code will tell the ruler or marker to use the angle constraint defined globally.

[static] int AngleHorizontal

Description: angle_horizontal code used by the angle_constraint method

[static] int AngleOrtho

Description: angle_ortho code used by the angle_constraint method

[static] int AngleVertical

Description: angle_vertical code used by the angle_constraint method

[static] int OutlineBox

Description: outline_box code used by the outline method

[static] int OutlineDiag

Description: outline_diag code used by the outline method

[static] int OutlineDiagXY

Description: outline_diag_xy code used by the outline method

[static] int OutlineDiagYX

Description: outline_diag_yx code used by the outline method

[static] int OutlineXY

Description: outline_xy code used by the outline method

[static] int OutlineYX

Description: outline_yx code used by the outline method

[static] int StyleArrowBoth

Description: style_arrow_both code used by the style method

[static] int StyleArrowEnd

Description: style_arrow_end code used by the style method

[static] int StyleArrowStart

Description: style_arrow_start code used by the style method

[static] int StyleLine

Description: style_line code used by the style method

[static] int StyleRuler

Description: style_ruler code used by the style method

[static] int angle_any

Description: angle_any code used by the angle_constraint method

This method is deprecated. Use method 'AngleAny' instead

[const] int angle_constraint

Description: Return the angle constraint attribute.

See angle_constraint= for a more detailed description.

void angle_constraint=(int flag)

Description: Set the angle constraint attribute.

This attribute controls if an angle constraint is applied when moving one of the ruler's points. The Angle... values can be used for this purpose.

[static] int angle_diagonal

Description: angle_diagonal code used by the angle_constraint method

This method is deprecated. Use method 'AngleDiagonal' instead

[static] int angle_global

Description: angle_global code used by the angle_constraint method.

This method is deprecated. Use method 'AngleGlobal' instead

[static] int angle_horizontal

Description: angle_horizontal code used by the angle_constraint method

This method is deprecated. Use method 'AngleHorizontal' instead

[static] int angle_ortho

Description: angle_ortho code used by the angle_constraint method

This method is deprecated. Use method 'AngleOrtho' instead

[static] int angle_vertical

Description: angle_vertical code used by the angle_constraint method

This method is deprecated. Use method 'AngleVertical' instead

[const] void assign(const Annotation other)

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] DBox box

Description: Get the bounding box of the object (not including text)

Returns:The bounding box

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.

void destroy

Description: Explicitly destroy the object

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

[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.

[const] Annotation dup

Description: Creates a copy of self

[const] string fmt

Description: Returns the format used for the label

Returns:The format string

void fmt=(string format)

Description: Set the format used for the label

format:The format string

[const] string fmt_x

Description: Returns the format used for the x-axis label

Returns:The format string

void fmt_x=(string format)

Description: Set the format used for the x-axis label

format:The format string

X-axis labels are only used for styles that have a horizontal component.

[const] string fmt_y

Description: Returns the format used for the y-axis label

Returns:The format string

void fmt_y=(string format)

Description: Set the format used for the y-axis label

format:The format string

Y-axis labels are only used for styles that have a vertical component.

[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.

[static] new Annotation new

Description: Create a new ruler or marker with the default attributes

[const] int outline

Description: Returns the outline style of the annotation object

void outline=(int outline)

Description: Set the outline style used for drawing the annotation object

The Outline... values can be used for defining the annotation object's outline. The outline style determines what components are drawn.

[static] int outline_box

Description: outline_box code used by the outline method

This method is deprecated. Use method 'OutlineBox' instead

[static] int outline_diag

Description: outline_diag code used by the outline method

This method is deprecated. Use method 'OutlineDiag' instead

[static] int outline_diag_xy

Description: outline_diag_xy code used by the outline method

This method is deprecated. Use method 'OutlineDiagXY' instead

[static] int outline_diag_yx

Description: outline_diag_yx code used by the outline method

This method is deprecated. Use method 'OutlineDiagYX' instead

[static] int outline_xy

Description: outline_xy code used by the outline method

This method is deprecated. Use method 'OutlineXY' instead

[static] int outline_yx

Description: outline_yx code used by the outline method

This method is deprecated. Use method 'OutlineYX' instead

[const] DPoint p1

Description: Get the first point of the ruler or marker

Returns:The first point

The points of the ruler or marker are always given in micron units in floating-point coordinates.

void p1=(const DPoint point)

Description: Set the first point of the ruler or marker

The points of the ruler or marker are always given in micron units in floating-point coordinates.

[const] DPoint p2

Description: Get the second point of the ruler or marker

Returns:The second point

The points of the ruler or marker are always given in micron units in floating-point coordinates.

void p2=(const DPoint point)

Description: Set the second point of the ruler or marker

The points of the ruler or marker are always given in micron units in floating-point coordinates.

void snap=(bool flag)

Description: Set the 'snap to objects' attribute.

If this attribute is set to true, the ruler or marker snaps to other objects when moved.

[const] bool snap?

Description: Return the 'snap to objects' attribute.

[const] int style

Description: Returns the style of the annotation object

void style=(int style)

Description: Set the style used for drawing the annotation object

The Style... values can be used for defining the annotation object's style. The style determines if ticks or arrows are drawn.

[static] int style_arrow_both

Description: style_arrow_both code used by the style method

This method is deprecated. Use method 'StyleArrowBoth' instead

[static] int style_arrow_end

Description: style_arrow_end code used by the style method

This method is deprecated. Use method 'StyleArrowEnd' instead

[static] int style_arrow_start

Description: style_arrow_start code used by the style method

This method is deprecated. Use method 'StyleArrowStart' instead

[static] int style_line

Description: style_line code used by the style method

This method is deprecated. Use method 'StyleLine' instead

[static] int style_ruler

Description: style_ruler code used by the style method

This method is deprecated. Use method 'StyleRuler' instead

[const] string text

Description: Return the formatted text for the main label.

[const] string text_x

Description: Return the formatted text for the x-axis label.

[const] string text_y

Description: Return the formatted text for the y-axis label.

[const] string to_s

Description: Returns the string representation of the ruler.

This method was introduced in version 0.19.

[const] Annotation transformed(const DTrans t)

Description: Transform the ruler or marker with the given simple transformation

t:The transformation to apply
Returns:The transformed object

[const] Annotation transformed_cplx(const DCplxTrans t)

Description: Transform the ruler or marker with the given complex transformation

t:The magnifying transformation to apply
Returns:The transformed object

[const] Annotation transformed_cplx(const ICplxTrans t)

Description: Transform the ruler or marker with the given complex transformation

t:The magnifying transformation to apply
Returns:The transformed object (in this case an integer coordinate object)

This method has been introduced in version 0.18.