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 "offsetinterface.h"
15 #include "vrvdef.h"
16 
17 namespace vrv {
18 
19 class ScoreDefInterface;
20 
21 //----------------------------------------------------------------------------
22 // Clef
23 //----------------------------------------------------------------------------
24 
28 class Clef : public LayerElement,
29  public OffsetInterface,
30  public AttClefLog,
31  public AttClefShape,
32  public AttColor,
33  public AttEnclosingChars,
34  public AttExtSymAuth,
35  public AttExtSymNames,
36  public AttLineLoc,
37  public AttOctave,
38  public AttOctaveDisplacement,
39  public AttStaffIdent,
40  public AttTypography,
41  public AttVisibility {
42 public:
48  Clef();
49  virtual ~Clef();
50  Object *Clone() const override { return new Clef(*this); }
51  void Reset() override;
52  std::string GetClassName() const override { return "clef"; }
54 
59  OffsetInterface *GetOffsetInterface() override { return vrv_cast<OffsetInterface *>(this); }
60  const OffsetInterface *GetOffsetInterface() const override { return vrv_cast<const OffsetInterface *>(this); }
62 
64  bool HasToBeAligned() const override { return true; }
65 
67  bool IsScoreDefElement() const override { return (this->GetParent() && this->GetFirstAncestor(SCOREDEF)); }
68 
72  int GetClefLocOffset() const;
73 
74  //----------------//
75  // Static methods //
76  //----------------//
77 
81  char32_t GetClefGlyph(const data_NOTATIONTYPE notationType) const;
82 
83  //----------//
84  // Functors //
85  //----------//
86 
91  FunctorCode Accept(Functor &functor) override;
92  FunctorCode Accept(ConstFunctor &functor) const override;
93  FunctorCode AcceptEnd(Functor &functor) override;
94  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
96 
97 private:
98  //
99 public:
100  //
101 private:
102  //
103 };
104 
105 } // namespace vrv
106 
107 #endif
This class models the MEI <clef> element.
Definition: clef.h:41
int GetClefLocOffset() const
Return the offset of the clef.
void Reset() override
Virtual reset method.
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:50
bool IsScoreDefElement() const override
Override the method since check is required.
Definition: clef.h:67
bool HasToBeAligned() const override
Override the method since alignment is required.
Definition: clef.h:64
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:64
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:398
This class is an interface for elements having a single visual offset, such as arpeg,...
Definition: offsetinterface.h:28