![]() |
Verovio
Source code documentation
|
This class represents a basic object in the layout domain. More...
#include <boundingbox.h>
Public Member Functions | |
| virtual void | ResetBoundingBox () |
| Reset the bounding box values. | |
| bool | Encloses (const Point point) const |
| Return true if the bounding box encloses the point. | |
| int | Intersects (const FloatingCurvePositioner *curve, Accessor type, int margin=0) const |
| Return intersection between the bounding box and the curve represented by the FloatingPositioner. More... | |
| int | Intersects (const BeamDrawingInterface *beamInterface, Accessor type, int margin=0, bool fromBeamContentSide=false) const |
| Return intersection between the bounding box and the beam represented by the BeamDrawingInterface. More... | |
Constructors, destructors, reset methods | |
Reset method resets all attribute classes | |
| BoundingBox () | |
| virtual | ~BoundingBox () |
| virtual ClassId | GetClassId () const =0 |
| bool | Is (ClassId classId) const |
| bool | Is (const std::vector< ClassId > &classIds) const |
Methods for updating the bounding boxes and for providing information about their status. | |
| virtual void | UpdateContentBBoxX (int x1, int x2) |
| virtual void | UpdateContentBBoxY (int y1, int y2) |
| virtual void | UpdateSelfBBoxX (int x1, int x2) |
| virtual void | UpdateSelfBBoxY (int y1, int y2) |
| void | SetEmptyBB () |
| bool | HasSelfBB () const |
| bool | HasSelfHorizontalBB () const |
| bool | HasSelfVerticalBB () const |
| bool | HasContentBB () const |
| bool | HasContentHorizontalBB () const |
| bool | HasContentVerticalBB () const |
| bool | HasEmptyBB () const |
| void | SetBoundingBoxGlyph (char32_t smuflGlyph, int fontSize) |
| Set and get the smuflGlyph / fontsize for a bounding box that is the one of a single SMuFL glyph. | |
| char32_t | GetBoundingBoxGlyph () const |
| int | GetBoundingBoxGlyphFontSize () const |
Get the X and Y drawing position. | |
Pure virtual methods | |
| virtual int | GetDrawingX () const =0 |
| virtual int | GetDrawingY () const =0 |
Reset the cached values of the drawingX and Y values. | |
Pure virtual methods. | |
| virtual void | ResetCachedDrawingX () const =0 |
| virtual void | ResetCachedDrawingY () const =0 |
Get positions for self and content | |
| int | GetSelfBottom () const |
| int | GetSelfTop () const |
| int | GetSelfLeft () const |
| int | GetSelfRight () const |
| int | GetContentBottom () const |
| int | GetContentTop () const |
| int | GetContentLeft () const |
| int | GetContentRight () const |
| int | GetSelfX1 () const |
| int | GetSelfX2 () const |
| int | GetSelfY1 () const |
| int | GetSelfY2 () const |
| int | GetContentX1 () const |
| int | GetContentX2 () const |
| int | GetContentY1 () const |
| int | GetContentY2 () const |
Get wrappers | |
| int | GetBottomBy (Accessor type) const |
| int | GetTopBy (Accessor type) const |
| int | GetLeftBy (Accessor type) const |
| int | GetRightBy (Accessor type) const |
| int | GetX1By (Accessor type) const |
| int | GetX2By (Accessor type) const |
| int | GetY1By (Accessor type) const |
| int | GetY2By (Accessor type) const |
Return true if the bounding box has a horizontal / vertical overlap with the other one. | |
Makes an overal bounding box overlap calculation without looking at anchor points | |
| bool | HorizontalContentOverlap (const BoundingBox *other, int margin=0) const |
| bool | VerticalContentOverlap (const BoundingBox *other, int margin=0) const |
| bool | HorizontalSelfOverlap (const BoundingBox *other, int margin=0) const |
| bool | VerticalSelfOverlap (const BoundingBox *other, int margin=0) const |
Return the overlap on the left / right / top / bottom looking at bounding box anchor points | |
| int | HorizontalLeftOverlap (const BoundingBox *other, const Doc *doc, int margin=0, int vMargin=0) const |
| int | HorizontalRightOverlap (const BoundingBox *other, const Doc *doc, int margin=0, int vMargin=0) const |
| int | VerticalTopOverlap (const BoundingBox *other, const Doc *doc, int margin=0, int hMargin=0) const |
| int | VerticalBottomOverlap (const BoundingBox *other, const Doc *doc, int margin=0, int hMargin=0) const |
Return the left / right / top / bottom of the cut out rectangles (and use self bounding rect if there are | |
none) | |
| int | GetCutOutTop (const Resources &resources) const |
| int | GetCutOutBottom (const Resources &resources) const |
| int | GetCutOutLeft (const Resources &resources) const |
| int | GetCutOutRight (const Resources &resources) const |
| int | GetCutOutLeft (const Resources &resources, bool fromTop) const |
| int | GetCutOutRight (const Resources &resources, bool fromTop) const |
Static Public Member Functions | |
| static std::pair< double, int > | ApproximateBezierExtrema (const Point bezier[4], bool isMaxExtrema, int approximationSteps=BEZIER_APPROXIMATION) |
| static double | CalcDistance (const Point &p1, const Point &p2) |
| Calculate the euclidean distance between two points. | |
| static bool | ArePointsClose (const Point &p1, const Point &p2, int margin) |
| static double | CalcSlope (const Point &p1, const Point &p2) |
| Calculate the slope represented by two points. | |
| static Point | CalcPositionAfterRotation (Point point, float alpha, Point center) |
| Calculate the position of a point after a rotation of alpha (in radian) around the center. | |
| static double | CalcBezierParamAtPosition (const Point bezier[4], int x) |
| Calculate the t parameter of a bezier at position x. | |
| static int | CalcBezierAtPosition (const Point bezier[4], int x) |
| Calculate the y position of a bezier at position x. | |
| static void | CalcLinearInterpolation (Point &dest, const Point &a, const Point &b, double t) |
| Calculate linear interpolation between two points at time t. | |
| static Point | CalcPointAtBezier (const Point bezier[4], double t) |
| Calculate point (X,Y) coordinaties on the bezier curve. | |
| static double | GetBezierThicknessCoefficient (const Point bezier[4], int currentThickness, int penWidth) |
| Calculate thickness coefficient to be applient for bezier curve to fit MEI units thickness. | |
| static Point | CalcDeCasteljau (const Point bezier[4], double t) |
| Calculate the point bezier point position for a t between 0.0 and 1.0. | |
| static void | CalcThickBezier (const Point bezier[4], int thickness, Point topBezier[4], Point bottomBezier[4]) |
| Calculate the position of the bezier above and below for a thick bezier. | |
| static void | ApproximateBezierBoundingBox (const Point bezier[4], Point &pos, int &width, int &height, int &minYPos, int &maxYPos) |
| Approximate the bounding box of a bezier taking into accound the height and the width. | |
| static std::set< double > | SolveCubicPolynomial (double a, double b, double c, double d) |
| Solve the cubic equation ax^3 + bx^2 + cx + d = 0 Returns up to three real roots. | |
| static int | RectLeftOverlap (const Point rect1[2], const Point rect2[2], int margin, int vMargin) |
| Calculate the left / right / top / bottom overlap of two rectangle taking into account the margin / v-h-Margins. | |
| static int | RectRightOverlap (const Point rect1[2], const Point rect2[2], int margin, int vMargin) |
| static int | RectTopOverlap (const Point rect1[2], const Point rect2[2], int margin, int hMargin) |
| static int | RectBottomOverlap (const Point rect1[2], const Point rect2[2], int margin, int hMargin) |
Protected Attributes | |
| int | m_cachedDrawingX |
| The cached version of the drawingX and drawingY values. More... | |
| int | m_cachedDrawingY |
This class represents a basic object in the layout domain.
|
static |
| int vrv::BoundingBox::Intersects | ( | const BeamDrawingInterface * | beamInterface, |
| Accessor | type, | ||
| int | margin = 0, |
||
| bool | fromBeamContentSide = false |
||
| ) | const |
Return intersection between the bounding box and the beam represented by the BeamDrawingInterface.
A segment of the beam that matches horizontal position of the bounding box is taken to find whether there is intersection.
| int vrv::BoundingBox::Intersects | ( | const FloatingCurvePositioner * | curve, |
| Accessor | type, | ||
| int | margin = 0 |
||
| ) | const |
Return intersection between the bounding box and the curve represented by the FloatingPositioner.
The Object pointed by the FloatingPositioner is expected to be a SLUR or a TIE
|
mutableprotected |
The cached version of the drawingX and drawingY values.
These are reset by ResetCachedDrawingX/Y methods when necessary. Mutable because to be updated in GetDrawingX/Y const.