Verovio
Source code documentation
octave.h
1 // Name: octave.h
3 // Author: Laurent Pugin
4 // Created: 2016
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_OCTAVE_H__
9 #define __VRV_OCTAVE_H__
10 
11 #include "atts_cmn.h"
12 #include "atts_shared.h"
13 #include "controlelement.h"
14 #include "timeinterface.h"
15 
16 namespace vrv {
17 
18 //----------------------------------------------------------------------------
19 // Octave
20 //----------------------------------------------------------------------------
21 
25 class Octave : public ControlElement,
26  public TimeSpanningInterface,
27  public AttExtender,
28  public AttLineRend,
29  public AttLineRendBase,
30  public AttNNumberLike,
31  public AttOctaveDisplacement {
32 public:
38  Octave();
39  virtual ~Octave();
40  Object *Clone() const override { return new Octave(*this); }
41  void Reset() override;
42  std::string GetClassName() const override { return "octave"; }
44 
49  TimePointInterface *GetTimePointInterface() override { return vrv_cast<TimePointInterface *>(this); }
50  const TimePointInterface *GetTimePointInterface() const override
51  {
52  return vrv_cast<const TimePointInterface *>(this);
53  }
54  TimeSpanningInterface *GetTimeSpanningInterface() override { return vrv_cast<TimeSpanningInterface *>(this); }
55  const TimeSpanningInterface *GetTimeSpanningInterface() const override
56  {
57  return vrv_cast<const TimeSpanningInterface *>(this);
58  }
60 
66  void SetDrawingExtenderX(int left, int right);
68 
72  char32_t GetOctaveGlyph(bool withAltaBassa) const;
73 
77  int GetLineWidth(const Doc *doc, int unit) const;
78 
85  std::pair<int, bool> GetVerticalContentBoundaryRel(const Doc *doc, const FloatingPositioner *positioner,
86  const BoundingBox *horizOverlappingBBox, bool contentTop) const override;
87 
88  //----------//
89  // Functors //
90  //----------//
91 
96  FunctorCode Accept(Functor &functor) override;
97  FunctorCode Accept(ConstFunctor &functor) const override;
98  FunctorCode AcceptEnd(Functor &functor) override;
99  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
101 
102 protected:
103  //
104 private:
105  //
106 public:
107  //
108 private:
112  std::map<const FloatingPositioner *, std::pair<int, int>> m_drawingExtenderX;
113 };
114 
115 } // namespace vrv
116 
117 #endif
This class represents a basic object in the layout domain.
Definition: boundingbox.h:32
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class represents elements appearing within a measure.
Definition: controlelement.h:33
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This class represents a basic object in the layout domain.
Definition: floatingobject.h:165
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class represents a basic object.
Definition: object.h:61
This class models the MEI <octave> element.
Definition: octave.h:31
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void ResetDrawingExtenderX()
Store the horizontal extender line coordinates.
std::pair< int, bool > GetVerticalContentBoundaryRel(const Doc *doc, const FloatingPositioner *positioner, const BoundingBox *horizOverlappingBBox, bool contentTop) const override
Determine the vertical content boundary.
void Reset() override
Virtual reset method.
Object * Clone() const override
Method call for copying child classes.
Definition: octave.h:40
char32_t GetOctaveGlyph(bool withAltaBassa) const
Get the SMuFL glyph.
int GetLineWidth(const Doc *doc, int unit) const
Calculate the octave line width.
This class is an interface for elements having a single time point, such as tempo,...
Definition: timeinterface.h:39
This class is an interface for spanning elements, such as slur, hairpin, etc.
Definition: timeinterface.h:145