Verovio
Source code documentation
clef.h
1 // Name: clef.h
3 // Author: Laurent Pugin
4 // Created: 2011
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_CLEF_H__
9 #define __VRV_CLEF_H__
10 
11 #include "atts_externalsymbols.h"
12 #include "atts_shared.h"
13 #include "layerelement.h"
14 #include "vrvdef.h"
15 
16 namespace vrv {
17 
18 class ScoreDefInterface;
19 
20 //----------------------------------------------------------------------------
21 // Clef
22 //----------------------------------------------------------------------------
23 
27 class Clef : public LayerElement,
28  public AttClefLog,
29  public AttClefShape,
30  public AttColor,
31  public AttEnclosingChars,
32  public AttExtSymAuth,
33  public AttExtSymNames,
34  public AttLineLoc,
35  public AttOctave,
36  public AttOctaveDisplacement,
37  public AttStaffIdent,
38  public AttTypography,
39  public AttVisibility {
40 public:
46  Clef();
47  virtual ~Clef();
48  Object *Clone() const override { return new Clef(*this); }
49  void Reset() override;
50  std::string GetClassName() const override { return "clef"; }
52 
54  bool HasToBeAligned() const override { return true; }
55 
57  bool IsScoreDefElement() const override { return (this->GetParent() && this->GetFirstAncestor(SCOREDEF)); }
58 
62  int GetClefLocOffset() const;
63 
64  //----------------//
65  // Static methods //
66  //----------------//
67 
71  char32_t GetClefGlyph(const data_NOTATIONTYPE notationType) const;
72 
73  //----------//
74  // Functors //
75  //----------//
76 
81  FunctorCode Accept(Functor &functor) override;
82  FunctorCode Accept(ConstFunctor &functor) const override;
83  FunctorCode AcceptEnd(Functor &functor) override;
84  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
86 
87 private:
88  //
89 public:
90  //
91 private:
92  //
93 };
94 
95 } // namespace vrv
96 
97 #endif
This class models the MEI <clef> element.
Definition: clef.h:39
int GetClefLocOffset() const
Return the offset of the clef.
void Reset() override
Reset the object, that is 1) removing all children and 2) resetting all attributes.
char32_t GetClefGlyph(const data_NOTATIONTYPE notationType) const
Retrieves the appropriate SMuFL code for a data_CLEFSHAPE.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
Object * Clone() const override
Method call for copying child classes.
Definition: clef.h:48
bool IsScoreDefElement() const override
Override the method since check is required.
Definition: clef.h:57
bool HasToBeAligned() const override
Override the method since alignment is required.
Definition: clef.h:54
This abstract class is the base class for all const functors.
Definition: functor.h:126
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class represents a basic object.
Definition: object.h:61
Object * GetFirstAncestor(const ClassId classId, int maxSteps=-1)
Return the first ancestor of the specified type.
Object * GetParent()
Get the parent of the Object.
Definition: object.h:383