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:
37  Score();
39  virtual ~Score();
40  void Reset() override;
41  std::string GetClassName() const override { return "score"; }
43 
47  bool IsSupportedChild(ClassId classId) override;
50 
54  ScoreDef *GetScoreDef() { return &m_scoreDef; }
56  const ScoreDef *GetScoreDef() const { return &m_scoreDef; }
58 
64  void CalcRunningElementHeight(Doc *doc);
65 
69  bool ScoreDefNeedsOptimization(int optionCondense) const;
70 
71  //----------//
72  // Functors //
73  //----------//
74 
78  FunctorCode Accept(Functor &functor) override;
80  FunctorCode Accept(ConstFunctor &functor) const override;
81  FunctorCode AcceptEnd(Functor &functor) override;
82  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
84 
85 private:
89  ScoreDef m_scoreDef;
90 
91 public:
96  int m_drawingPgHeadHeight;
98  int m_drawingPgFootHeight;
99  int m_drawingPgHead2Height;
100  int m_drawingPgFoot2Height;
102 private:
103  //
104 };
105 
106 } // namespace vrv
107 
108 #endif
vrv::Score::IsSupportedChild
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
vrv::Score::GetScoreDef
ScoreDef * GetScoreDef()
Getter for the score/scoreDef.
Definition: score.h:55
vrv::PageMilestoneInterface
This class is an interface for container elements that have to be turned to milestones in a page-base...
Definition: pagemilestone.h:83
vrv::Score::Reset
void Reset() override
Reset the object, that is 1) removing all children and 2) resetting all attributes.
vrv::Score::Accept
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
vrv::Doc
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
vrv::PageElement
This class represents elements appearing within a page.
Definition: pageelement.h:25
vrv::Functor
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
vrv::ConstFunctor
This abstract class is the base class for all const functors.
Definition: functor.h:126
vrv::ScoreDef
This class represents a MEI scoreDef.
Definition: scoredef.h:129
vrv::Score::CalcRunningElementHeight
void CalcRunningElementHeight(Doc *doc)
Calculate the height of the pgHead/pgHead2 and pgFoot/pgFoot2 (if any) Requires the Doc to have an em...
vrv::Score
This class represent a <score> in MEI.
Definition: score.h:30
vrv::Score::ScoreDefNeedsOptimization
bool ScoreDefNeedsOptimization(int optionCondense) const
Check whether we need to optimize score based on the condense option.