API reference - Class AnnotationNotation used in Ruby API documentation Description: A layout annotation (i.e. ruler)
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. See Ruler properties for more details about the appearance options. Annotations are inserted into a layout view using LayoutView#insert_annotation. Here is some sample code in Ruby: app = RBA::Application.instance mw = app.main_window view = mw.current_view ant = RBA::Annotation::new ant.p1 = RBA::DPoint::new(0, 0) ant.p2 = RBA::DPoint::new(100, 0) ant.style = RBA::Annotation::StyleRuler view.insert_annotation(ant) Annotations can be retrieved from a view with LayoutView#each_annotation and all annotations can be cleared with LayoutView#clear_annotations. To change an existing annotation, employ the ID of the existing annotation and use LayoutView#replace_annotation to replace it with a new one. Changing the annotation's properties directly won't have an immediate effect. Please note that LayoutView#each_annotation returns a const object, so that we have to create a copy to modify them. Here is some sample code for changing the style of all annotations present in the view: view = RBA::LayoutView::current begin view.transaction("Restyle annotations") view.each_annotation do |a| adup = a.dup adup.style = RBA::Annotation::StyleArrowBoth view.replace_annotation(a.id, adup) end ensure view.commit end Public constructors
Public methods
Public static methods and constants
Deprecated methods (protected, public, static, non-static and constructors)
Detailed description[const] bool !=(const Annotation other)Description: Inequality operator [const] bool ==(const Annotation other)Description: Equality operator [static] int AngleAnyDescription: Gets the any angle code for use with the angle_constraint method If this value is specified for the angle constraint, all angles will be allowed. [static] int AngleDiagonalDescription: Gets the diagonal angle code for use with the angle_constraint method If this value is specified for the angle constraint, only multiples of 45 degree are allowed. [static] int AngleGlobalDescription: Gets the global angle code for use with the angle_constraint method. This code will tell the ruler or marker to use the angle constraint defined globally. [static] int AngleHorizontalDescription: Gets the horizontal angle code for use with the angle_constraint method If this value is specified for the angle constraint, only horizontal rulers are allowed. [static] int AngleOrthoDescription: Gets the ortho angle code for use with the angle_constraint method If this value is specified for the angle constraint, only multiples of 90 degree are allowed. [static] int AngleVerticalDescription: Gets the vertical angle code for use with the angle_constraint method If this value is specified for the angle constraint, only vertical rulers are allowed. [static] int OutlineBoxDescription: Gets the box outline code for use with the outline method When this outline style is specified, a box is drawn with the corners specified by the start and end point. All box edges are drawn in the style specified with the style attribute. [static] int OutlineDiagDescription: Gets the diagonal output code for use with the outline method When this outline style is specified, a line connecting start and end points in the given style (ruler, arrow or plain line) is drawn. [static] int OutlineDiagXYDescription: outline_xy code used by the outline method When this outline style is specified, three lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see style method). [static] int OutlineDiagYXDescription: Gets the yx plus diagonal outline code for use with the outline method When this outline style is specified, three lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see style method). Python specific notes:This method is not available for Python [static] int OutlineXYDescription: Gets the xy outline code for use with the outline method When this outline style is specified, two lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. The lines are drawn in the specified style (see style method). [static] int OutlineYXDescription: Gets the yx outline code for use with the outline method When this outline style is specified, two lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. The lines are drawn in the specified style (see style method). Python specific notes:This method is not available for Python [static] int StyleArrowBothDescription: Gets the both arrow ends style code for use the style method When this style is specified, a two-headed arrow is drawn. [static] int StyleArrowEndDescription: Gets the end arrow style code for use the style method When this style is specified, an arrow is drawn pointing from the start to the end point. [static] int StyleArrowStartDescription: Gets the start arrow style code for use the style method When this style is specified, an arrow is drawn pointing from the end to the start point. [static] int StyleLineDescription: Gets the line style code for use with the style method When this style is specified, plain line is drawn. [static] int StyleRulerDescription: Gets the ruler style code for use the style method When this style is specified, the annotation will show a ruler with some ticks at distances indicating a decade of units and a suitable subdivision into minor ticks at intervals of 1, 2 or 5 units. void _createDescription: 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 _destroyDescription: 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. [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] 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. void _manageDescription: 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. void _unmanageDescription: 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. [static] int angle_anyDescription: Gets the any angle code for use with the angle_constraint method Use of this method is deprecated. Use AngleAny instead [const] int angle_constraintDescription: Returns the angle constraint attribute See angle_constraint= for a more detailed description. Python specific notes:The object exposes a readable attribute 'angle_constraint'. This is the getter. void angle_constraint=(int flag)Description: Sets 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. Python specific notes:The object exposes a writable attribute 'angle_constraint'. This is the setter. [static] int angle_diagonalDescription: Gets the diagonal angle code for use with the angle_constraint method Use of this method is deprecated. Use AngleDiagonal instead [static] int angle_globalDescription: Gets the global angle code for use with the angle_constraint method. Use of this method is deprecated. Use AngleGlobal instead [static] int angle_horizontalDescription: Gets the horizontal angle code for use with the angle_constraint method Use of this method is deprecated. Use AngleHorizontal instead [static] int angle_orthoDescription: Gets the ortho angle code for use with the angle_constraint method Use of this method is deprecated. Use AngleOrtho instead [static] int angle_verticalDescription: Gets the vertical angle code for use with the angle_constraint method Use of this method is deprecated. Use AngleVertical instead void assign(const Annotation other)Description: Assigns another object to self [const] DBox boxDescription: Gets the bounding box of the object (not including text)
void createDescription: Ensures the C++ object is created Use of this method is deprecated. Use _create instead void destroyDescription: Explicitly destroys the object Use of this method is deprecated. Use _destroy instead [const] bool destroyed?Description: Returns a value indicating whether the object was already destroyed Use of this method is deprecated. Use _destroyed? instead [const] new Annotation ptr dupDescription: Creates a copy of self [const] string fmtDescription: Returns the format used for the label
Format strings can contain placeholders for values and formulas for computing derived values. See Ruler properties for more details. Python specific notes:The object exposes a readable attribute 'fmt'. This is the getter. void fmt=(string format)Description: Sets the format used for the label
Format strings can contain placeholders for values and formulas for computing derived values. See Ruler properties for more details. Python specific notes:The object exposes a writable attribute 'fmt'. This is the setter. [const] string fmt_xDescription: Returns the format used for the x-axis label
Format strings can contain placeholders for values and formulas for computing derived values. See Ruler properties for more details. Python specific notes:The object exposes a readable attribute 'fmt_x'. This is the getter. void fmt_x=(string format)Description: Sets the format used for the x-axis label
X-axis labels are only used for styles that have a horizontal component. Format strings can contain placeholders for values and formulas for computing derived values. See Ruler properties for more details. Python specific notes:The object exposes a writable attribute 'fmt_x'. This is the setter. [const] string fmt_yDescription: Returns the format used for the y-axis label
Format strings can contain placeholders for values and formulas for computing derived values. See Ruler properties for more details. Python specific notes:The object exposes a readable attribute 'fmt_y'. This is the getter. void fmt_y=(string format)Description: Sets the format used for the y-axis label
Y-axis labels are only used for styles that have a vertical component. Format strings can contain placeholders for values and formulas for computing derived values. See Ruler properties for more details. Python specific notes:The object exposes a writable attribute 'fmt_y'. This is the setter. [const] int idDescription: Returns the annotation's ID The annotation ID is an integer that uniquely identifies an annotation inside a view. The ID is used for replacing an annotation (see LayoutView#replace_annotation). This method was introduced in version 0.24. [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 [static] new Annotation ptr newDescription: Create a new ruler or marker with the default attributes Python specific notes:This method is the default initializer of the object [const] int outlineDescription: Returns the outline style of the annotation object Python specific notes:The object exposes a readable attribute 'outline'. This is the getter. void outline=(int outline)Description: Sets 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. Python specific notes:The object exposes a writable attribute 'outline'. This is the setter. [static] int outline_boxDescription: Gets the box outline code for use with the outline method Use of this method is deprecated. Use OutlineBox instead [static] int outline_diagDescription: Gets the diagonal output code for use with the outline method Use of this method is deprecated. Use OutlineDiag instead [static] int outline_diag_xyDescription: outline_xy code used by the outline method Use of this method is deprecated. Use OutlineDiagXY instead [static] int outline_diag_yxDescription: Gets the yx plus diagonal outline code for use with the outline method Use of this method is deprecated. Use OutlineDiagYX instead [static] int outline_xyDescription: Gets the xy outline code for use with the outline method Use of this method is deprecated. Use OutlineXY instead [static] int outline_yxDescription: Gets the yx outline code for use with the outline method Use of this method is deprecated. Use OutlineYX instead [const] DPoint p1Description: Gets 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. Python specific notes:The object exposes a readable attribute 'p1'. This is the getter. void p1=(const DPoint point)Description: Sets 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. Python specific notes:The object exposes a writable attribute 'p1'. This is the setter. [const] DPoint p2Description: Gets 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. Python specific notes:The object exposes a readable attribute 'p2'. This is the getter. void p2=(const DPoint point)Description: Sets 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. Python specific notes:The object exposes a writable attribute 'p2'. This is the setter. void snap=(bool flag)Description: Sets the 'snap to objects' attribute If this attribute is set to true, the ruler or marker snaps to other objects when moved. Python specific notes:The object exposes a writable attribute 'snap'. This is the setter. [const] bool snap?Description: Returns the 'snap to objects' attribute Python specific notes:The object exposes a readable attribute 'snap'. This is the getter. [const] int styleDescription: Returns the style of the annotation object Python specific notes:The object exposes a readable attribute 'style'. This is the getter. void style=(int style)Description: Sets 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. Python specific notes:The object exposes a writable attribute 'style'. This is the setter. [static] int style_arrow_bothDescription: Gets the both arrow ends style code for use the style method Use of this method is deprecated. Use StyleArrowBoth instead [static] int style_arrow_endDescription: Gets the end arrow style code for use the style method Use of this method is deprecated. Use StyleArrowEnd instead [static] int style_arrow_startDescription: Gets the start arrow style code for use the style method Use of this method is deprecated. Use StyleArrowStart instead [static] int style_lineDescription: Gets the line style code for use with the style method Use of this method is deprecated. Use StyleLine instead [static] int style_rulerDescription: Gets the ruler style code for use the style method Use of this method is deprecated. Use StyleRuler instead [const] string textDescription: Returns the formatted text for the main label [const] string text_xDescription: Returns the formatted text for the x-axis label [const] string text_yDescription: Returns the formatted text for the y-axis label [const] string to_sDescription: Returns the string representation of the ruler This method was introduced in version 0.19. Python specific notes:This method is also available as 'str(object)' [const] Annotation transformed(const DTrans t)Description: Transforms the ruler or marker with the given simple transformation
[const] Annotation transformed_cplx(const DCplxTrans t)Description: Transforms the ruler or marker with the given complex transformation
[const] Annotation transformed_cplx(const ICplxTrans t)Description: Transforms the ruler or marker with the given complex transformation
This method has been introduced in version 0.18. |