![]() |
Verovio
Source code documentation
|
This class represents a basic object for a curve (slur, tie) in the layout domain. More...
#include <floatingobject.h>
Public Member Functions | |
FloatingCurvePositioner (FloatingObject *object, StaffAlignment *alignment, char spanningType) | |
ClassId | GetClassId () const override |
void | ResetPositioner () override |
void | ResetCurveParams () |
Reset the curve parameters in FloatingCurvePositioner::FloatingCurvePositioner and in FloatingCurvePositioner::ResetPositioner. | |
int | CalcMinMaxY (const Point points[4]) const |
Calculate the min or max Y for a set of points. | |
void | ClearSpannedElements () |
Deletes all the CurveSpannedElement objects. | |
void | AddSpannedElement (CurveSpannedElement *spannedElement) |
Add a CurveSpannedElement to the FloatingCurvePositioner. More... | |
const ArrayOfCurveSpannedElements * | GetSpannedElements () |
Return a const pointer to the spanned elements. | |
std::pair< int, int > | CalcRequestedStaffSpace (const StaffAlignment *alignment) const |
Calculate the requested staff space above and below. | |
void | UpdateCurveParams (const Point points[4], int thickness, curvature_CURVEDIR curveDir) |
Update the curve parameters. More... | |
void | UpdatePoints (const BezierCurve &bezier) |
void | MoveFrontHorizontal (int distance) |
Moves bounding points horizontally or vertically by a specified distance. | |
void | MoveBackHorizontal (int distance) |
void | MoveFrontVertical (int distance) |
void | MoveBackVertical (int distance) |
int | CalcAdjustment (const BoundingBox *boundingBox, bool &discard, int margin=0, bool horizontalOverlap=true) const |
Calculate the adjustment needed for an element for the curve not to overlap with it. More... | |
int | CalcDirectionalAdjustment (const BoundingBox *boundingBox, bool isCurveAbove, bool &discard, int margin=0, bool horizontalOverlap=true) const |
std::pair< int, int > | CalcLeftRightAdjustment (const BoundingBox *boundingBox, bool &discard, int margin=0, bool horizontalOverlap=true) const |
std::pair< int, int > | CalcDirectionalLeftRightAdjustment (const BoundingBox *boundingBox, bool isCurveAbove, bool &discard, int margin=0, bool horizontalOverlap=true) const |
Getters for the current parameters | |
void | GetPoints (Point points[4]) const |
int | GetThickness () const |
curvature_CURVEDIR | GetDir () const |
Getter and setter for cached x1 and x2 | |
bool | HasCachedX12 () const |
std::pair< int, int > | GetCachedX12 () const |
void | SetCachedX12 (const std::pair< int, int > &cachedX12) |
Getter, setter and checker for the crossStaff | |
void | SetCrossStaff (Staff *crossStaff) |
Staff * | GetCrossStaff () |
const Staff * | GetCrossStaff () const |
bool | IsCrossStaff () const |
Getter, setter for the requested staff space | |
void | SetRequestedStaffSpace (int space) |
int | GetRequestedStaffSpace () const |
![]() | |
FloatingPositioner (FloatingObject *object, StaffAlignment *alignment, char spanningType) | |
void | ResetCachedDrawingX () const override |
void | ResetCachedDrawingY () const override |
char | GetSpanningType () const |
Getter for the spanning type. | |
data_STAFFREL | GetDrawingPlace () const |
bool | HasHorizontalOverlapWith (const BoundingBox *bbox, int unit) const |
Check for horizontal overlap with special consideration for extender lines. | |
int | GetAdmissibleHorizOverlapMargin (const BoundingBox *bbox, int unit) const |
Return the horizontal margin for overlap with another element This can be negative, if elements are allowed to slightly overlap. | |
void | CalcDrawingYRel (const Doc *doc, const StaffAlignment *staffAlignment, const BoundingBox *horizOverlappingBBox) |
Update the Y drawing relative position based on collision detection with the overlapping bounding box. | |
void | AdjustExtenders () |
Align extender elements across systems. | |
int | GetSpaceBelow (const Doc *doc, const StaffAlignment *staffAlignment, const BoundingBox *horizOverlappingBBox) const |
Calculate the vertical space below the element and above the bounding box. | |
bool | HasVerticalContentOverlap (const Doc *doc, const BoundingBox *horizOverlappingBBox, int margin) const |
Version of Boundary::VerticalContentOverlap which takes refined boundaries into account. | |
int | GetDrawingX () const override |
int | GetDrawingY () const override |
void | SetObjectXY (Object *objectX, Object *objectY) |
Object * | GetObjectX () |
const Object * | GetObjectX () const |
Object * | GetObjectY () |
const Object * | GetObjectY () const |
FloatingObject * | GetObject () |
Getter for the FloatingObject (asserted, cannot be NULL) | |
const FloatingObject * | GetObject () const |
StaffAlignment * | GetAlignment () |
Getter for the StaffAlignment (asserted, cannot be NULL) | |
const StaffAlignment * | GetAlignment () const |
int | GetDrawingYRel () const |
virtual void | SetDrawingYRel (int drawingYRel, bool force=false) |
int | GetDrawingXRel () const |
virtual void | SetDrawingXRel (int drawingXRel) |
int | GetDrawingExtenderWidth () const |
void | SetDrawingExtenderWidth (int extenderWidth) |
std::pair< int, bool > | GetVerticalContentBoundaryRel (const Doc *doc, const BoundingBox *horizOverlappingBBox, bool contentTop) const |
Determine the vertical content boundary. More... | |
int | GetVerticalContentBoundary (const Doc *doc, const BoundingBox *horizOverlappingBBox, bool contentTop) const |
![]() | |
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... | |
BoundingBox () | |
virtual | ~BoundingBox () |
bool | Is (ClassId classId) const |
bool | Is (const std::vector< ClassId > &classIds) const |
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 |
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 |
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 |
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 |
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 |
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 |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
char | m_spanningType |
The spanning type of the positioner for spanning control elements. | |
![]() | |
int | m_drawingXRel |
The X drawing relative position of the object. More... | |
int | m_drawingYRel |
The Y drawing relative position of the object. More... | |
int | m_drawingExtenderWidth |
The horizontal width of the extender line whenever it is not included in the bounding box. | |
FloatingObject * | m_object |
A pointer to the FloatingObject it represents. | |
StaffAlignment * | m_alignment |
A pointer to the StaffAlignment that owns it. | |
data_STAFFREL | m_place |
![]() | |
int | m_cachedDrawingX |
The cached version of the drawingX and drawingY values. More... | |
int | m_cachedDrawingY |
This class represents a basic object for a curve (slur, tie) in the layout domain.
|
inline |
Add a CurveSpannedElement to the FloatingCurvePositioner.
The element is owned by the positioner.
int vrv::FloatingCurvePositioner::CalcAdjustment | ( | const BoundingBox * | boundingBox, |
bool & | discard, | ||
int | margin = 0 , |
||
bool | horizontalOverlap = true |
||
) | const |
Calculate the adjustment needed for an element for the curve not to overlap with it.
Discard will be true if the element already fits.
void vrv::FloatingCurvePositioner::UpdateCurveParams | ( | const Point | points[4], |
int | thickness, | ||
curvature_CURVEDIR | curveDir | ||
) |
Update the curve parameters.
Stored points are made relative to the curve drawingY.