Verovio
Source code documentation
scoreorpartelement.h
1 // Name: scoreorpartelement.h
3 // Author: Laurent Pugin
4 // Created: 29/08/2016
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_SCOREORPARTELEMENT_H__
9 #define __VRV_SCOREORPARTELEMENT_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 // ScoreOrPart
23 //----------------------------------------------------------------------------
24 
32  public AttLabelled,
33  public AttNNumberLike {
34 
35 public:
41  ScoreOrPartElement(ClassId classId);
42  ScoreOrPartElement(ClassId classId, bool createScoreDef);
43  virtual ~ScoreOrPartElement();
44  void Reset() override;
45  std::string GetClassName() const override { return "score"; }
47 
52  bool IsSupportedChild(ClassId classId) override;
54 
59  void SetScoreDefSubtree(Object *subtree, ScoreDef *scoreScoreDef);
60  ScoreDef *GetScoreDef() { return m_scoreDef; }
61  const ScoreDef *GetScoreDef() const { return m_scoreDef; }
62  Object *GetScoreDefSubtree() { return m_scoreDefSubtree; }
63  void ClearScoreDef();
65 
72 
76  bool ScoreDefNeedsOptimization(int optionCondense) const;
77 
78  //----------//
79  // Functors //
80  //----------//
81 
86  FunctorCode Accept(Functor &functor) override;
87  FunctorCode Accept(ConstFunctor &functor) const override;
88  FunctorCode AcceptEnd(Functor &functor) override;
89  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
91 
92 private:
98  ScoreDef *m_scoreDef;
103  Object *m_scoreDefSubtree;
104 
105 public:
111  int m_drawingPgHeadHeight;
112  int m_drawingPgFootHeight;
113  int m_drawingPgHead2Height;
114  int m_drawingPgFoot2Height;
116 private:
117  //
118 };
119 
120 } // namespace vrv
121 
122 #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:66
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:136
This class represents a <score> or a <part> in MEI.
Definition: scoreorpartelement.h:33
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
void Reset() override
Reset the object, that is 1) removing all children and 2) resetting all attributes.
void SetScoreDefSubtree(Object *subtree, ScoreDef *scoreScoreDef)
Getter for the score/scoreDef.
bool ScoreDefNeedsOptimization(int optionCondense) const
Check whether we need to optimize score based on the condense option.
void CalcRunningElementHeight(Doc *doc)
Calculate the height of the pgHead/pgHead2 and pgFoot/pgFoot2 (if any) Requires the Doc to have an em...