8 #ifndef __VRV_DRAWING_INTERFACE_H__
9 #define __VRV_DRAWING_INTERFACE_H__
12 #include "devicecontextbase.h"
16 #include "metersiggrp.h"
106 virtual void Reset();
122 void InitCoords(
const ArrayOfObjects &childList,
Staff *staff, data_BEAMPLACE place);
123 void InitCoords(
const ListOfObjects &childList,
Staff *staff, data_BEAMPLACE place);
138 bool IsHorizontal()
const;
140 bool IsRepeatedPattern()
const;
202 bool IsHorizontalMixedBeam(
const std::vector<int> &items,
const std::vector<data_BEAMPLACE> &directions)
const;
208 bool m_hasMultipleStemDir;
210 Staff *m_crossStaffContent;
211 data_STAFFREL_basic m_crossStaffRel;
212 bool m_isSpanningElement;
213 data_DURATION m_shortestDur;
214 data_STEMDIRECTION m_notesStemDir;
215 data_BEAMPLACE m_drawingPlace;
220 int m_beamWidthBlack;
221 int m_beamWidthWhite;
253 virtual void Reset();
267 bool DrawClef()
const {
return (m_drawClef && m_currentClef.HasShape()); }
268 void SetDrawClef(
bool drawClef) { m_drawClef = drawClef; }
269 bool DrawKeySig()
const {
return (m_drawKeySig); }
270 void SetDrawKeySig(
bool drawKeySig) { m_drawKeySig = drawKeySig; }
271 bool DrawMensur()
const {
return (m_drawMensur && (m_currentMensur.HasSign() || m_currentMensur.HasNum())); }
272 void SetDrawMensur(
bool drawMensur) { m_drawMensur = drawMensur; }
273 bool DrawMeterSig()
const
275 return (m_drawMeterSig && (m_currentMeterSig.HasUnit() || m_currentMeterSig.HasSym()));
277 void SetDrawMeterSig(
bool drawMeterSig) { m_drawMeterSig = drawMeterSig; }
278 bool DrawMeterSigGrp()
const;
279 void SetDrawMeterSigGrp(
bool drawMeterSigGrp) { m_drawMeterSigGrp = drawMeterSigGrp; }
286 void SetCurrentClef(
const Clef *clef);
287 void SetCurrentKeySig(
const KeySig *keySig);
288 void SetCurrentMensur(
const Mensur *mensur);
289 void SetCurrentMeterSig(
const MeterSig *meterSig);
290 void SetCurrentMeterSigGrp(
const MeterSigGrp *meterSigGrp);
291 void AlternateCurrentMeterSig(
const Measure *measure);
292 void SetCurrentProport(
const Proport *proport);
300 Clef *GetCurrentClef() {
return &m_currentClef; }
301 const Clef *GetCurrentClef()
const {
return &m_currentClef; }
302 KeySig *GetCurrentKeySig() {
return &m_currentKeySig; }
303 const KeySig *GetCurrentKeySig()
const {
return &m_currentKeySig; }
304 Mensur *GetCurrentMensur() {
return &m_currentMensur; }
305 const Mensur *GetCurrentMensur()
const {
return &m_currentMensur; }
306 MeterSig *GetCurrentMeterSig() {
return &m_currentMeterSig; }
307 const MeterSig *GetCurrentMeterSig()
const {
return &m_currentMeterSig; }
308 MeterSigGrp *GetCurrentMeterSigGrp() {
return &m_currentMeterSigGrp; }
309 const MeterSigGrp *GetCurrentMeterSigGrp()
const {
return &m_currentMeterSigGrp; }
310 Proport *GetCurrentProport() {
return &m_currentProport; }
311 const Proport *GetCurrentProport()
const {
return &m_currentProport; }
318 void AddOssiaAbove(StaffDef *ossiaStaffDef) { m_ossiasAbove.push_back(ossiaStaffDef); }
319 void AddOssiaBelow(StaffDef *ossiaStaffDef) { m_ossiasBelow.push_back(ossiaStaffDef); }
320 void GetOssiaAboveNs(std::vector<int> &staffNs)
const;
321 void GetOssiaBelowNs(std::vector<int> &staffNs)
const;
322 StaffDef *GetOssiaStaffDef(
int staffN);
323 const StaffDef *GetOssiaStaffDef(
int staffN)
const;
359 bool m_drawMeterSigGrp;
366 std::list<StaffDef *> m_ossiasAbove;
367 std::list<StaffDef *> m_ossiasBelow;
387 virtual void Reset();
394 void SetDrawingStem(
Stem *stem);
404 void SetDrawingStemDir(data_STEMDIRECTION stemDir);
405 data_STEMDIRECTION GetDrawingStemDir()
const;
406 void SetDrawingStemLen(
int drawingStemLen);
407 int GetDrawingStemLen()
const;
408 int GetDrawingStemModRelY()
const;
411 Point GetDrawingStemStart(
const Object *
object = NULL)
const;
412 Point GetDrawingStemEnd(
const Object *
object = NULL)
const;
418 virtual Point GetStemUpSE(
const Doc *doc,
int staffSize,
bool graceSize)
const = 0;
419 virtual Point GetStemDownNW(
const Doc *doc,
int staffSize,
bool graceSize)
const = 0;
420 virtual int CalcStemLenInThirdUnits(
const Staff *staff, data_STEMDIRECTION stemDir)
const = 0;
456 virtual void Reset();
463 void SetVisibility(VisibilityType visibility) { m_visibility = visibility; }
464 bool IsHidden()
const {
return (m_visibility == Hidden); }
477 VisibilityType m_visibility;
This class is an interface for MEI beam elements (beam, beamSpan).
Definition: drawinginterface.h:98
void InitGraceStemDir(bool graceGrp)
Initialize m_notesStemDir value based on the @graceGrp attribute and presence of child elements with ...
ArrayOfBeamElementCoords m_beamElementCoords
An array of coordinates for each element.
Definition: drawinginterface.h:227
void GetBeamChildOverflow(StaffAlignment *&above, StaffAlignment *&below) const
Get above/below overflow for the children.
virtual std::pair< int, int > GetAdditionalBeamCount() const
Helper to find number of additional beams.
Definition: drawinginterface.h:161
virtual std::pair< int, int > GetFloatingBeamCount() const
Helper to get number of beams represented by attributes @beam and @beam.float.
Definition: drawinginterface.h:166
bool HasCoords() const
Initializes the m_beamElementCoords vector objects.
Definition: drawinginterface.h:121
int GetPosition(const LayerElement *element) const
Return the position of the element in the beam.
bool IsFirstIn(const LayerElement *element) const
Return information about the position in the beam.
void GetBeamOverflow(StaffAlignment *&above, StaffAlignment *&below) const
Get above/below overflow.
void ClearCoords()
Clear the m_beamElementCoords vector and delete all the objects.
int GetTotalBeamWidth() const
Get total beam width with regards to the shortest duration of the beam (counting both beams and white...
void InitCue(bool beamCue)
Initialize m_cueSize value based on the @cue attribute and presence of child elements with @cue attri...
bool HasOneStepHeight() const
Checks whether difference between highest and lowest notes of the beam is just one step.
FunctorCode InterfaceResetData(ResetDataFunctor &functor)
Called explicitly from ResetDataFunctor.
This class models the MEI <clef> element.
Definition: clef.h:41
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This class is an interface for elements with duration, such as notes and rests.
Definition: drawinginterface.h:34
void AddToDrawingList(Object *element)
Add an element to the drawing list.
ArrayOfObjects m_drawingList
The list of object for which drawing is postponed.
Definition: drawinginterface.h:83
FunctorCode InterfaceResetData(ResetDataFunctor &functor)
Called explicitly from ResetDataFunctor.
void ResetDrawingList()
Reset the drawing list.
ArrayOfObjects * GetDrawingList()
Return the drawing list.
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 models the MEI <mensur> element.
Definition: mensur.h:34
This class represents a MEI meterSigGrp.
Definition: metersiggrp.h:32
This class models the MEI <meterSig> element.
Definition: metersig.h:34
This class represents a basic object.
Definition: object.h:64
This class is an pseudo interface for elements maintaining a flat list of children LayerElement for p...
Definition: object.h:916
Simple class for representing points.
Definition: devicecontextbase.h:203
This class models the MEI <proport> element.
Definition: proport.h:23
This class resets the drawing values before calling PrepareData after changes.
Definition: resetfunctor.h:22
This class stores an alignement position staves will point to.
Definition: verticalaligner.h:172
This class is an interface for MEI scoreDef or staffDef attributes clef, keysig and mensur.
Definition: drawinginterface.h:245
FunctorCode InterfaceResetData(ResetDataFunctor &functor)
Called explicitly from ResetDataFunctor.
void ResetOssiaStaffDefs()
Clear the ossia staffDef lists.
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:110
This class models a stem as a layer element part and as MEI <stem> element.
Definition: stem.h:27
This class is an interface for MEI stemmed element.
Definition: drawinginterface.h:379
Stem * m_drawingStem
A pointer to the child Stem set by PrepareLayerElementParts.
Definition: drawinginterface.h:438
FunctorCode InterfaceResetData(ResetDataFunctor &functor)
Called explicitly from ResetDataFunctor.
This class is an interface for MEI element that can be hidden during drawing.
Definition: drawinginterface.h:448