8 #ifndef __VRV_LAYER_H__
9 #define __VRV_LAYER_H__
11 #include "atts_shared.h"
12 #include "drawinginterface.h"
39 public AttVisibility {
49 void Reset()
override;
50 std::string GetClassName()
const override {
return "layer"; }
113 void SetDrawingStemDir(data_STEMDIRECTION stemDirection) { m_drawingStemDir = stemDirection; }
114 data_STEMDIRECTION GetDrawingStemDir(
const LayerElement *element)
const;
115 data_STEMDIRECTION GetDrawingStemDir(
const ArrayOfBeamElementCoords *coords)
const;
116 data_STEMDIRECTION GetDrawingStemDir()
const {
return m_drawingStemDir; }
124 std::set<int> GetLayersNForTimeSpanOf(
const LayerElement *element)
const;
125 int GetLayerCountForTimeSpanOf(
const LayerElement *element)
const;
133 std::set<int> GetLayersNInTimeSpan(
134 const Fraction &time,
const Fraction &duration,
const Measure *measure,
int staff)
const;
135 int GetLayerCountInTimeSpan(
136 const Fraction &time,
const Fraction &duration,
const Measure *measure,
int staff)
const;
166 KeySig *GetCurrentKeySig();
167 const KeySig *GetCurrentKeySig()
const;
168 Mensur *GetCurrentMensur();
169 const Mensur *GetCurrentMensur()
const;
171 const MeterSig *GetCurrentMeterSig()
const;
173 const Proport *GetCurrentProport()
const;
176 void ResetStaffDefObjects();
184 bool DrawKeySigCancellation()
const {
return m_drawKeySigCancellation; }
185 void SetDrawKeySigCancellation(
bool drawKeySigCancellation) { m_drawKeySigCancellation = drawKeySigCancellation; }
187 Clef *GetStaffDefClef() {
return m_staffDefClef; }
188 const Clef *GetStaffDefClef()
const {
return m_staffDefClef; }
189 KeySig *GetStaffDefKeySig() {
return m_staffDefKeySig; }
190 const KeySig *GetStaffDefKeySig()
const {
return m_staffDefKeySig; }
191 Mensur *GetStaffDefMensur() {
return m_staffDefMensur; }
192 const Mensur *GetStaffDefMensur()
const {
return m_staffDefMensur; }
193 MeterSig *GetStaffDefMeterSig() {
return m_staffDefMeterSig; }
194 const MeterSig *GetStaffDefMeterSig()
const {
return m_staffDefMeterSig; }
195 MeterSigGrp *GetStaffDefMeterSigGrp() {
return m_staffDefMeterSigGrp; }
196 const MeterSigGrp *GetStaffDefMeterSigGrp()
const {
return m_staffDefMeterSigGrp; }
198 bool HasStaffDef()
const
200 return (m_staffDefClef || m_staffDefKeySig || m_staffDefMensur || m_staffDefMeterSig || m_staffDefMeterSigGrp);
210 bool DrawCautionKeySigCancel()
const {
return m_drawCautionKeySigCancel; }
211 void SetDrawCautionKeySigCancel(
bool drawCautionKeySig) { m_drawCautionKeySigCancel = drawCautionKeySig; }
213 Clef *GetCautionStaffDefClef() {
return m_cautionStaffDefClef; }
214 const Clef *GetCautionStaffDefClef()
const {
return m_cautionStaffDefClef; }
215 KeySig *GetCautionStaffDefKeySig() {
return m_cautionStaffDefKeySig; }
216 const KeySig *GetCautionStaffDefKeySig()
const {
return m_cautionStaffDefKeySig; }
217 Mensur *GetCautionStaffDefMensur() {
return m_cautionStaffDefMensur; }
218 const Mensur *GetCautionStaffDefMensur()
const {
return m_cautionStaffDefMensur; }
219 MeterSig *GetCautionStaffDefMeterSig() {
return m_cautionStaffDefMeterSig; }
220 const MeterSig *GetCautionStaffDefMeterSig()
const {
return m_cautionStaffDefMeterSig; }
222 bool HasCautionStaffDef()
const
225 m_cautionStaffDefClef || m_cautionStaffDefKeySig || m_cautionStaffDefMensur || m_cautionStaffDefMeterSig);
233 void SetCrossStaffFromAbove(
bool crossStaff) { m_crossStaffFromAbove = crossStaff; }
234 bool HasCrossStaffFromAbove()
const {
return m_crossStaffFromAbove; }
235 void SetCrossStaffFromBelow(
bool crossStaff) { m_crossStaffFromBelow = crossStaff; }
236 bool HasCrossStaffFromBelow()
const {
return m_crossStaffFromBelow; }
249 FunctorCode AcceptEnd(
Functor &functor)
override;
250 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
261 data_STEMDIRECTION m_drawingStemDir;
266 bool m_crossStaffFromBelow;
267 bool m_crossStaffFromAbove;
270 Clef *m_staffDefClef;
275 bool m_drawKeySigCancellation;
278 Clef *m_cautionStaffDefClef;
279 KeySig *m_cautionStaffDefKeySig;
280 Mensur *m_cautionStaffDefMensur;
281 MeterSig *m_cautionStaffDefMeterSig;
282 bool m_drawCautionKeySigCancel;
This class models the MEI <clef> element.
Definition: clef.h:39
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: drawinginterface.h:33
Definition: fraction.h:19
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class models the MEI <keySig> element.
Definition: keysig.h:52
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
int GetCrossStaffClefLocOffset(const LayerElement *element, int locOffset) const
Return the clef offset for the position if there are cross-staff clefs on the same layer.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
Clef * GetClef(const LayerElement *test)
Get the current clef for the test element.
void SetDrawingStaffDefValues(StaffDef *currentStaffDef)
Set drawing clef, keysig, mensur, metersig, metersiggrp if necessary and if available.
void SetDrawingCautionValues(StaffDef *currentStaffDef)
Set drawing caution clef, keysig, mensur, metersig if necessary and if available.
int GetClefLocOffset(const LayerElement *test) const
Return the clef offset for the position x.
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
Object * Clone() const override
Method call for copying child classes.
Definition: layer.h:48
ListOfObjects GetLayerElementsForTimeSpanOf(const LayerElement *element, bool excludeCurrent=false)
Get the list of the layer elements for the duration of an element Takes into account cross-staff situ...
void CloneReset() override
Overriding CloneReset() method to be called after copy / assignment calls.
Clef * GetCurrentClef()
Get the current clef, keysig, mensur and meterSig.
Clef * GetClefFacs(const LayerElement *test)
Get the current clef based on facsimile for the test element.
int GetLayerIdx() const
Return the index position of the layer in its staff parent.
Definition: layer.h:69
ListOfObjects GetLayerElementsInTimeSpan(const Fraction &time, const Fraction &duration, const Measure *measure, int staff, bool excludeCurrent)
Get the list of the layer elements used within a time span.
This class represents a measure in a page-based score (Doc).
Definition: measure.h:46
This class models the MEI <mensur> element.
Definition: mensur.h:34
This class represents a MEI meterSigGrp.
Definition: metersiggrp.h:28
This class models the MEI <meterSig> element.
Definition: metersig.h:34
This class represents a basic object.
Definition: object.h:61
int GetIdx() const
Return the index position of the object in its parent (-1 if not found)
This class is an pseudo interface for elements maintaining a flat list of children LayerElement for p...
Definition: object.h:893
This class models the MEI <proport> element.
Definition: proport.h:23
This class represents a MEI staffDef.
Definition: staffdef.h:37