11 #include "altsyminterface.h"
12 #include "atts_externalsymbols.h"
13 #include "atts_mensural.h"
14 #include "durationinterface.h"
15 #include "layerelement.h"
16 #include "positioninterface.h"
22 enum RestLayer { RL_UNSET = -1, RL_sameLayer, RL_otherLayer };
24 enum RestAccidental { RA_UNSET = -1, RA_none, RA_s, RA_f, RA_x, RA_n };
26 enum RestLayerPlace { RLP_UNSET = -1, RLP_restOnTopLayer, RLP_restOnBottomLayer };
28 enum RestNotePlace { RNP_UNSET = -1, RNP_noteInSpace, RNP_noteOnLine };
44 public AttExtSymNames,
45 public AttRestVisMensural {
56 std::string GetClassName()
const override {
return "rest"; }
74 AltSymInterface *GetAltSymInterface()
override {
return vrv_cast<AltSymInterface *>(
this); }
75 const AltSymInterface *GetAltSymInterface()
const override {
return vrv_cast<const AltSymInterface *>(
this); }
76 PositionInterface *GetPositionInterface()
override {
return vrv_cast<PositionInterface *>(
this); }
77 const PositionInterface *GetPositionInterface()
const override {
return vrv_cast<const PositionInterface *>(
this); }
78 DurationInterface *GetDurationInterface()
override {
return vrv_cast<DurationInterface *>(
this); }
79 const DurationInterface *GetDurationInterface()
const override {
return vrv_cast<const DurationInterface *>(
this); }
91 char32_t
GetRestGlyph(
const data_DURATION duration)
const;
114 FunctorCode AcceptEnd(
Functor &functor)
override;
115 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
122 std::pair<int, RestAccidental> GetLocationRelativeToOtherLayers(
123 const Layer *currentLayer,
bool isTopLayer,
bool &restOverlap)
const;
128 int GetLocationRelativeToCurrentLayer(
const Staff *currentStaff,
const Layer *currentLayer,
bool isTopLayer)
const;
133 int GetFirstRelativeElementLocation(
134 const Staff *currentStaff,
const Layer *currentLayer,
bool isPrevious,
bool isTopLayer)
const;
140 int GetMarginLayerLocation(
bool isTopLayer,
bool restOverlap)
const;
145 std::pair<int, RestAccidental> GetElementLocation(
const Object *
object,
const Layer *layer,
bool isTopLayer)
const;
150 int GetRestOffsetFromOptions(
151 RestLayer layer,
const std::pair<int, RestAccidental> &location,
bool isTopLayer)
const;
157 bool DetermineRestPosition(
const Staff *staff,
const Layer *layer,
bool &isTopLayer)
const;
This class is an interface for elements having a @altsym It is not an abstract class but should not b...
Definition: altsyminterface.h:30
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class is an interface for elements with duration, such as notes and rests.
Definition: durationinterface.h:39
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 layer in a laid-out score (Doc).
Definition: layer.h:39
This class represents a basic object.
Definition: object.h:61
This class is an interface for elements with a position on the staff, such as rests.
Definition: positioninterface.h:30
This class models the MEI <rest> element.
Definition: rest.h:45
char32_t GetRestGlyph() const
Get the SMuFL glyph or a rest considering its actual duration.
void UpdateFromTransLoc(const TransPitch &tp)
Update the rest location based on the input TransPitch.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void Reset() override
Virtual reset method.
bool HasToBeAligned() const override
Override the method since alignment is required.
Definition: rest.h:83
Object * Clone() const override
Method call for copying child classes.
Definition: rest.h:54
void AddChild(Object *object) override
Overwritten method for rest.
bool IsSupportedChild(ClassId classId) override
Add an element to a rest.
int GetOptimalLayerLocation(const Staff *staff, const Layer *layer, int defaultLocation) const
Get the vertical location for the rests that are located on other layers.
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:107
Definition: transposition.h:35