Verovio
Source code documentation
score.h
1 // Name: score.h
3 // Author: Laurent Pugin
4 // Created: 29/08/2016
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_SCORE_H__
9 #define __VRV_SCORE_H__
10 
11 #include "atts_shared.h"
12 #include "options.h"
13 #include "pageelement.h"
14 #include "pagemilestone.h"
15 #include "scoredef.h"
16 
17 namespace vrv {
18 
19 class SymbolDef;
20 
21 //----------------------------------------------------------------------------
22 // Score
23 //----------------------------------------------------------------------------
24 
30 class Score : public PageElement, public PageMilestoneInterface, public AttLabelled, public AttNNumberLike {
31 
32 public:
38  Score();
39  Score(bool createScoreDef);
40  virtual ~Score();
41  void Reset() override;
42  std::string GetClassName() const override { return "score"; }
44 
49  bool IsSupportedChild(ClassId classId) override;
51 
56  void SetScoreDefSubtree(Object *subtree, ScoreDef *scoreScoreDef);
57  ScoreDef *GetScoreDef() { return m_scoreDef; }
58  const ScoreDef *GetScoreDef() const { return m_scoreDef; }
59  Object *GetScoreDefSubtree() { return m_scoreDefSubtree; }
61 
68 
72  bool ScoreDefNeedsOptimization(int optionCondense) const;
73 
74  //----------//
75  // Functors //
76  //----------//
77 
82  FunctorCode Accept(Functor &functor) override;
83  FunctorCode Accept(ConstFunctor &functor) const override;
84  FunctorCode AcceptEnd(Functor &functor) override;
85  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
87 
88 private:
95  ScoreDef *m_scoreDef;
100  Object *m_scoreDefSubtree;
101 
102 public:
108  int m_drawingPgHeadHeight;
109  int m_drawingPgFootHeight;
110  int m_drawingPgHead2Height;
111  int m_drawingPgFoot2Height;
113 private:
114  //
115 };
116 
117 } // namespace vrv
118 
119 #endif
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
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class represents a basic object.
Definition: object.h:61
This class represents elements appearing within a page.
Definition: pageelement.h:25
This class is an interface for container elements that have to be turned to milestones in a page-base...
Definition: pagemilestone.h:83
This class represents a MEI scoreDef.
Definition: scoredef.h:135
This class represent a <score> in MEI.
Definition: score.h:30
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
bool ScoreDefNeedsOptimization(int optionCondense) const
Check whether we need to optimize score based on the condense option.
void Reset() override
Reset the object, that is 1) removing all children and 2) resetting all attributes.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void CalcRunningElementHeight(Doc *doc)
Calculate the height of the pgHead/pgHead2 and pgFoot/pgFoot2 (if any) Requires the Doc to have an em...
void SetScoreDefSubtree(Object *subtree, ScoreDef *scoreScoreDef)
Getter for the score/scoreDef.