8 #ifndef __VRV_STAFF_H__
9 #define __VRV_STAFF_H__
11 #include "atts_shared.h"
12 #include "facsimileinterface.h"
23 class TimeSpanningInterface;
52 ListOfConstObjects m_events;
59 m_events.push_back(
object);
63 void MergeWith(
const Dash &other)
66 this->m_x1 = std::min(other.m_x1, this->m_x1);
67 this->m_x2 = std::max(other.m_x2, this->m_x2);
69 if (!other.m_events.empty()) {
70 this->m_events.insert(this->m_events.end(), other.m_events.begin(), other.m_events.end());
107 public AttVisibility {
119 std::string GetClassName()
const override {
return "staff"; }
131 FacsimileInterface *GetFacsimileInterface()
override {
return vrv_cast<FacsimileInterface *>(
this); }
134 return vrv_cast<const FacsimileInterface *>(
this);
143 void SetDrawingRotation(
double drawingRotation) { m_drawingRotation = drawingRotation; }
144 double GetDrawingRotation()
const {
return m_drawingRotation; }
145 bool HasDrawingRotation()
const {
return (m_drawingRotation != 0.0); }
146 int GetDrawingRotationOffsetFor(
int x);
170 int GetDrawingX()
const override;
171 int GetDrawingY()
const override;
172 virtual double GetDrawingRotate()
const;
195 bool IsMensural()
const;
196 bool IsNeume()
const;
197 bool IsTablature()
const;
202 bool IsTabWithStemsOutside()
const;
221 void SetAlignment(StaffAlignment *alignment) { m_staffAlignment = alignment; }
230 ArrayOfLedgerLines &GetLedgerLinesAboveCue() {
return m_ledgerLinesAboveCue; }
231 const ArrayOfLedgerLines &GetLedgerLinesAboveCue()
const {
return m_ledgerLinesAboveCue; }
232 ArrayOfLedgerLines &GetLedgerLinesBelow() {
return m_ledgerLinesBelow; }
233 const ArrayOfLedgerLines &GetLedgerLinesBelow()
const {
return m_ledgerLinesBelow; }
234 ArrayOfLedgerLines &GetLedgerLinesBelowCue() {
return m_ledgerLinesBelowCue; }
235 const ArrayOfLedgerLines &GetLedgerLinesBelowCue()
const {
return m_ledgerLinesBelowCue; }
244 void AddLedgerLineBelow(
int count,
int left,
int right,
int extension,
bool cueSize,
const Object *event);
276 FunctorCode AcceptEnd(
Functor &functor)
override;
277 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
284 void AddLedgerLines(ArrayOfLedgerLines &lines,
int count,
int left,
int right,
int extension,
const Object *event);
327 ArrayOfLedgerLines m_ledgerLinesAbove;
328 ArrayOfLedgerLines m_ledgerLinesBelow;
329 ArrayOfLedgerLines m_ledgerLinesAboveCue;
330 ArrayOfLedgerLines m_ledgerLinesBelowCue;
337 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:35
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:84
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 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:107
std::vector< Object * > m_timeSpanningElements
A vector of all the spanning elements overlapping with the previous measure.
Definition: staff.h:305
void SetFromFacsimile(Doc *doc)
Set staff parameters based on facsimile information (if it exists).
ArrayOfLedgerLines & GetLedgerLinesAbove()
Return the ledger line arrays.
Definition: staff.h:228
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:311
data_NOTATIONTYPE m_drawingNotationType
Notation type (CMN, mensural, black mensural, etc.), from the staffDef.
Definition: staff.h:295
int GetDrawingStaffNotationSize() const
Return the drawing staff size for staff notation, including for tablature staves.
void ClearLedgerLines()
Delete all the legder line arrays.
void Reset() override
Virtual reset method.
bool AddChildAdditionalCheck(Object *child) override
Additional check when adding a child.
Object * Clone() const override
Method call for copying child classes.
Definition: staff.h:117
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:219
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:208
int m_drawingLines
Number of lines copied from the staffDef for fast access when drawing.
Definition: staff.h:290
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:300
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