Verovio
Source code documentation
nc.h
1 // Name: nc.h
3 // Author: Andrew Tran
4 // Created: 2017
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_NC_H__
9 #define __VRV_NC_H__
10 
11 #include <cassert>
12 
13 //----------------------------------------------------------------------------
14 
15 #include "atts_analytical.h"
16 #include "atts_neumes.h"
17 #include "atts_shared.h"
18 #include "atts_visual.h"
19 #include "durationinterface.h"
20 #include "layerelement.h"
21 #include "offsetinterface.h"
22 #include "pitchinterface.h"
23 #include "positioninterface.h"
24 
25 namespace vrv {
26 
27 //----------------------------------------------------------------------------
28 // Nc
29 //----------------------------------------------------------------------------
30 
35 class Nc : public LayerElement,
36  public DurationInterface,
37  public OffsetInterface,
38  public PitchInterface,
39  public PositionInterface,
40  public AttColor,
41  public AttCurvatureDirection,
42  public AttIntervalMelodic,
43  public AttNcForm {
44 public:
50  Nc();
51  virtual ~Nc();
52  Object *Clone() const override { return new Nc(*this); }
53  void Reset() override;
54  std::string GetClassName() const override { return "nc"; }
56 
57  bool IsSupportedChild(ClassId classId) override;
58 
63  DurationInterface *GetDurationInterface() override { return vrv_cast<DurationInterface *>(this); }
64  const DurationInterface *GetDurationInterface() const override { return vrv_cast<const DurationInterface *>(this); }
65  OffsetInterface *GetOffsetInterface() override { return vrv_cast<OffsetInterface *>(this); }
66  const OffsetInterface *GetOffsetInterface() const override { return vrv_cast<const OffsetInterface *>(this); }
67  PitchInterface *GetPitchInterface() override { return vrv_cast<PitchInterface *>(this); }
68  const PitchInterface *GetPitchInterface() const override { return vrv_cast<const PitchInterface *>(this); }
69  PositionInterface *GetPositionInterface() override { return vrv_cast<PositionInterface *>(this); }
70  const PositionInterface *GetPositionInterface() const override { return vrv_cast<const PositionInterface *>(this); }
72 
77  int PitchOrLocDifferenceTo(const Nc *nc) const;
78 
79  //----------//
80  // Functors //
81  //----------//
82 
87  FunctorCode Accept(Functor &functor) override;
88  FunctorCode Accept(ConstFunctor &functor) const override;
89  FunctorCode AcceptEnd(Functor &functor) override;
90  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
92 
98  struct DrawingGlyph {
99  wchar_t m_fontNo = 0;
100  float m_xOffset = 0.0;
101  float m_yOffset = 0.0;
102  };
103 
104 private:
105  //
106 public:
108  std::vector<DrawingGlyph> m_drawingGlyphs;
109 
110 private:
111  //
112 };
113 
114 } // namespace vrv
115 
116 #endif
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class is an interface for elements with duration, such as notes and rests.
Definition: durationinterface.h:39
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 models the MEI <nc> element.
Definition: nc.h:43
std::vector< DrawingGlyph > m_drawingGlyphs
Drawing glyphs.
Definition: nc.h:108
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
Object * Clone() const override
Method call for copying child classes.
Definition: nc.h:52
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
int PitchOrLocDifferenceTo(const Nc *nc) const
Calclulate the pitch or loc difference between to nc.
void Reset() override
Virtual reset method.
This class represents a basic object.
Definition: object.h:64
This class is an interface for elements having a single visual offset, such as arpeg,...
Definition: offsetinterface.h:28
This class is an interface for elements with pitch, such as notes and neumes.
Definition: pitchinterface.h:28
This class is an interface for elements with a position on the staff, such as rests.
Definition: positioninterface.h:30
A Structure holding a glyph paramter for the nc.
Definition: nc.h:98