8 #ifndef __VRV_TUPLET_H__
9 #define __VRV_TUPLET_H__
12 #include "atts_shared.h"
13 #include "atts_visual.h"
14 #include "layerelement.h"
22 enum class MelodicDirection { None, Up, Down };
31 public AttDurationRatio,
32 public AttNumberPlacement,
44 std::string GetClassName()
const override {
return "tuplet"; }
63 const LayerElement *GetDrawingLeft()
const {
return m_drawingLeft; }
64 void SetDrawingLeft(LayerElement *drawingLeft) { m_drawingLeft = drawingLeft; }
65 LayerElement *GetDrawingRight() {
return m_drawingRight; }
66 const LayerElement *GetDrawingRight()
const {
return m_drawingRight; }
67 void SetDrawingRight(LayerElement *drawingRight) { m_drawingRight = drawingRight; }
68 data_STAFFREL_basic GetDrawingBracketPos()
const {
return m_drawingBracketPos; }
69 void SetDrawingBracketPos(data_STAFFREL_basic bracketPos) { m_drawingBracketPos = bracketPos; }
70 data_STAFFREL_basic GetDrawingNumPos()
const {
return m_drawingNumPos; }
71 void SetDrawingNumPos(data_STAFFREL_basic numPos) { m_drawingNumPos = numPos; }
78 Beam *GetBracketAlignedBeam() {
return m_bracketAlignedBeam; }
79 const Beam *GetBracketAlignedBeam()
const {
return m_bracketAlignedBeam; }
80 void SetBracketAlignedBeam(Beam *alignedBeam) { m_bracketAlignedBeam = alignedBeam; }
81 Beam *GetNumAlignedBeam() {
return m_numAlignedBeam; }
82 const Beam *GetNumAlignedBeam()
const {
return m_numAlignedBeam; }
83 void SetNumAlignedBeam(Beam *alignedBeam) { m_numAlignedBeam = alignedBeam; }
90 const std::set<const FloatingCurvePositioner *> &GetInnerSlurs()
const {
return m_innerSlurs; }
91 void AddInnerSlur(
const FloatingCurvePositioner *slur) { m_innerSlurs.insert(slur); }
92 void ResetInnerSlurs() { m_innerSlurs.clear(); }
133 FunctorCode AcceptEnd(
Functor &functor)
override;
134 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
141 void FilterList(ListOfConstObjects &childList)
const override;
159 data_STAFFREL_basic m_drawingBracketPos;
161 data_STAFFREL_basic m_drawingNumPos;
163 Beam *m_bracketAlignedBeam;
165 Beam *m_numAlignedBeam;
167 std::set<const FloatingCurvePositioner *> m_innerSlurs;
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class represents a basic object.
Definition: object.h:61
This class is an pseudo interface for elements maintaining a flat list of children LayerElement for p...
Definition: object.h:893
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:107
Object * Clone() const override
Method call for copying child classes.
Definition: tuplet.h:42
void GetDrawingLeftRightXRel(int &xRelLeft, int &xRelRight, const Doc *doc) const
Return the maximum and minimum X positions of the notes in the tuplets.
void AddChild(Object *object) override
Overwritten method for tuplet.
void CalculateTupletNumCrossStaff(LayerElement *layerElement)
Calculate corresponding cross-staff for the tuplet number if necessary.
void FilterList(ListOfConstObjects &childList) const override
Filter the flat list and keep only Note elements.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
MelodicDirection GetMelodicDirection() const
Determine the melodic direction.
void Reset() override
Virtual reset method.
bool IsSupportedChild(ClassId classId) override
Add an element (a note or a rest) to a tuplet.
void CalcDrawingBracketAndNumPos(bool tupletNumHead)
Calculate the position of the bracket and the num looking at the stem direction or at the encoded val...
bool HasValidTupletNumPosition(const Staff *preferredStaff, const Staff *otherStaff) const
Check whether tuplet number has valid positioning staffwise.