Verovio
Source code documentation
staffdef.h
1 // Name: staffdef.h
3 // Author: Laurent Pugin
4 // Created: 2017
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_STAFFDEF_H__
9 #define __VRV_STAFFDEF_H__
10 
11 #include "atts_mei.h"
12 #include "atts_midi.h"
13 #include "atts_shared.h"
14 #include "atts_stringtab.h"
15 #include "scoredef.h"
16 
17 namespace vrv {
18 
19 //----------------------------------------------------------------------------
20 // StaffDef
21 //----------------------------------------------------------------------------
22 
26 class StaffDef : public ScoreDefElement,
28  public AttDistances,
29  public AttLabelled,
30  public AttNInteger,
31  public AttNotationType,
32  public AttScalable,
33  public AttStaffDefLog,
34  public AttStaffDefVis,
35  public AttStaffDefVisTablature,
36  public AttTimeBase,
37  public AttTransposition {
38 public:
43  StaffDef();
45  virtual ~StaffDef();
46  Object *Clone() const override { return new StaffDef(*this); }
47  void Reset() override;
48  std::string GetClassName() const override { return "staffDef"; }
50 
54  bool IsSupportedChild(ClassId classId) override;
56 
60  int GetInsertOrderFor(ClassId classId) const override;
61 
65  VisibilityOptimization GetDrawingVisibility() const { return m_drawingVisibility; }
67  void SetDrawingVisibility(VisibilityOptimization drawingIsVisible) { m_drawingVisibility = drawingIsVisible; }
69 
73  bool HasLayerDefWithLabel() const;
74 
75  //----------//
76  // Functors //
77  //----------//
78 
82  FunctorCode Accept(Functor &functor) override;
84  FunctorCode Accept(ConstFunctor &functor) const override;
85  FunctorCode AcceptEnd(Functor &functor) override;
86  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
88 
89 private:
90  //
91 public:
92  //
93 private:
100  VisibilityOptimization m_drawingVisibility;
101 };
102 
103 } // namespace vrv
104 
105 #endif
vrv::StaffDef
This class represents a MEI staffDef.
Definition: staffdef.h:26
vrv::StaffDef::HasLayerDefWithLabel
bool HasLayerDefWithLabel() const
Return true if the label has layerDef with a label.
vrv::ScoreDefElement
This class is a base class for MEI scoreDef or staffDef elements.
Definition: scoredef.h:42
vrv::Object
This class represents a basic object.
Definition: object.h:59
vrv::StaffDefDrawingInterface
This class is an interface for MEI scoreDef or staffDef attributes clef, keysig and mensur.
Definition: drawinginterface.h:244
vrv::StaffDef::Accept
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
vrv::StaffDef::GetInsertOrderFor
int GetInsertOrderFor(ClassId classId) const override
Return an order for the given ClassId.
vrv::StaffDef::Clone
Object * Clone() const override
Method call for copying child classes.
Definition: staffdef.h:46
vrv::StaffDef::IsSupportedChild
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.