8 #ifndef __VRV_STAFF_H__
9 #define __VRV_STAFF_H__
11 #include "atts_shared.h"
12 #include "drawinginterface.h"
13 #include "facsimileinterface.h"
25 class TimeSpanningInterface;
54 ListOfConstObjects m_events;
61 m_events.push_back(
object);
65 void MergeWith(
const Dash &other)
68 this->m_x1 = std::min(other.m_x1, this->m_x1);
69 this->m_x2 = std::max(other.m_x2, this->m_x2);
71 if (!other.m_events.empty()) {
72 this->m_events.insert(this->m_events.end(), other.m_events.begin(), other.m_events.end());
110 public AttVisibility {
118 Staff(
int n = 1,
bool isOssia =
false);
121 void Reset()
override;
122 std::string GetClassName()
const override {
return (this->IsOssia() ?
"oStaff" :
"staff"); }
134 FacsimileInterface *GetFacsimileInterface()
override {
return vrv_cast<FacsimileInterface *>(
this); }
137 return vrv_cast<const FacsimileInterface *>(
this);
139 VisibilityDrawingInterface *GetVisibilityDrawingInterface()
override
141 return vrv_cast<VisibilityDrawingInterface *>(
this);
143 const VisibilityDrawingInterface *GetVisibilityDrawingInterface()
const override
145 return vrv_cast<const VisibilityDrawingInterface *>(
this);
153 bool IsOssia()
const {
return (m_isOssia); }
154 void SetOssia(
bool isOssia) { m_isOssia = isOssia; }
155 int GetNForOssia()
const;
156 int GetNFromOssia()
const;
163 void AttributesToExternal()
override;
164 void AttributesToInternal()
override;
172 void SetDrawingRotation(
double drawingRotation) { m_drawingRotation = drawingRotation; }
173 double GetDrawingRotation()
const {
return m_drawingRotation; }
174 bool HasDrawingRotation()
const {
return (m_drawingRotation != 0.0); }
175 int GetDrawingRotationOffsetFor(
int x);
199 int GetDrawingX()
const override;
200 int GetDrawingY()
const override;
201 virtual double GetDrawingRotate()
const;
224 bool IsMensural()
const;
225 bool IsNeume()
const;
226 bool IsTablature()
const;
231 bool IsTabWithStemsOutside()
const;
250 void SetAlignment(StaffAlignment *alignment) { m_staffAlignment = alignment; }
259 ArrayOfLedgerLines &GetLedgerLinesAboveCue() {
return m_ledgerLinesAboveCue; }
260 const ArrayOfLedgerLines &GetLedgerLinesAboveCue()
const {
return m_ledgerLinesAboveCue; }
261 ArrayOfLedgerLines &GetLedgerLinesBelow() {
return m_ledgerLinesBelow; }
262 const ArrayOfLedgerLines &GetLedgerLinesBelow()
const {
return m_ledgerLinesBelow; }
263 ArrayOfLedgerLines &GetLedgerLinesBelowCue() {
return m_ledgerLinesBelowCue; }
264 const ArrayOfLedgerLines &GetLedgerLinesBelowCue()
const {
return m_ledgerLinesBelowCue; }
273 void AddLedgerLineBelow(
int count,
int left,
int right,
int extension,
bool cueSize,
const Object *event);
310 FunctorCode AcceptEnd(
Functor &functor)
override;
311 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
318 void AddLedgerLines(ArrayOfLedgerLines &lines,
int count,
int left,
int right,
int extension,
const Object *event);
361 ArrayOfLedgerLines m_ledgerLinesAbove;
362 ArrayOfLedgerLines m_ledgerLinesBelow;
363 ArrayOfLedgerLines m_ledgerLinesAboveCue;
364 ArrayOfLedgerLines m_ledgerLinesBelowCue;
371 double m_drawingRotation;
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
Definition: facsimileinterface.h:27
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This is a class with no MEI equivalent for representing legder lines.
Definition: staff.h:37
void AddDash(int left, int right, int extension, const Object *event)
Add a dash to the ledger line object.
std::list< Dash > m_dashes
A list of dashes relative to the staff position.
Definition: staff.h:86
This class represents a measure in a page-based score (Doc).
Definition: measure.h:46
This class represents a basic object.
Definition: object.h:64
int GetIdx() const
Return the index position of the object in its parent (-1 if not found)
This class stores an alignement position staves will point to.
Definition: verticalaligner.h:172
This class represents a MEI staffDef.
Definition: staffdef.h:37
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:110
std::vector< Object * > m_timeSpanningElements
A vector of all the spanning elements overlapping with the previous measure.
Definition: staff.h:339
void SetFromFacsimile(Doc *doc)
Set staff parameters based on facsimile information (if it exists).
ArrayOfLedgerLines & GetLedgerLinesAbove()
Return the ledger line arrays.
Definition: staff.h:257
int GetNearestInterStaffPosition(int y, const Doc *doc, data_STAFFREL place) const
Find the nearest unit position in the direction indicated by place.
int m_drawingFacsY
The Y absolute position of the staff for facsimile (transcription) encodings.
Definition: staff.h:345
data_NOTATIONTYPE m_drawingNotationType
Notation type (CMN, mensural, black mensural, etc.), from the staffDef.
Definition: staff.h:329
int GetDrawingStaffNotationSize() const
Return the drawing staff size for staff notation, including for tablature staves.
void ClearLedgerLines()
Delete all the legder line arrays.
bool AddChildAdditionalCheck(Object *child) override
Additional check when adding a child.
Object * Clone() const override
Method call for copying child classes.
Definition: staff.h:120
int CalcPitchPosYRel(const Doc *doc, int loc) const
Calculate the yRel for the staff given a @loc value.
StaffAlignment * GetAlignment()
Getter and setter for the StaffAlignment.
Definition: staff.h:248
bool DrawingIsVisible() const
Check if the staff is currently visible.
int GetStaffIdx() const
Return the index position of the staff in its measure parent.
Definition: staff.h:237
int m_drawingLines
Number of lines copied from the staffDef for fast access when drawing.
Definition: staff.h:324
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void AddLedgerLineAbove(int count, int left, int right, int extension, bool cueSize, const Object *event)
Add the ledger lines above or below.
void AdjustDrawingStaffSize()
Adjust drawingStaffSize based on rotate angle.
void CloneReset() override
Overriding CloneReset() method to be called after copy / assignment calls.
int m_drawingStaffSize
The drawing staff size (scale), from the staffDef.
Definition: staff.h:334
int GetOssiaDrawingShift(const Measure *measure, Doc *doc) const
Get the drawing x if the staff is an ossia and has an ossia staffDef.
bool IsOnStaffLine(int y, const Doc *doc) const
Used for calculating note groups information/dot position.
This class models the MEI <tuning> element.
Definition: tuning.h:23
This class is an interface for MEI element that can be hidden during drawing.
Definition: drawinginterface.h:448