Verovio
Source code documentation
systemmilestone.h
1 // Name: systemmilestone.h
3 // Author: Laurent Pugin
4 // Created: 2016
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_SYSTEM_MILESTONE_H__
9 #define __VRV_SYSTEM_MILESTONE_H__
10 
11 #include "systemelement.h"
12 #include "vrvdef.h"
13 
14 namespace vrv {
15 
16 class Measure;
17 class Object;
18 class PrepareMilestonesFunctor;
19 class ResetDataFunctor;
20 
21 //----------------------------------------------------------------------------
22 // SystemMilestoneEnd
23 //----------------------------------------------------------------------------
24 
29 public:
34  SystemMilestoneEnd(Object *start);
36  virtual ~SystemMilestoneEnd();
37  void Reset() override;
38  std::string GetClassName() const override { return "systemMilestoneEnd"; }
40 
41  void SetMeasure(Measure *measure) { m_drawingMeasure = measure; }
42  Measure *GetMeasure() { return m_drawingMeasure; }
43  const Measure *GetMeasure() const { return m_drawingMeasure; }
44 
48  Object *GetStart() { return m_start; }
50  const Object *GetStart() const { return m_start; }
51  std::string GetStartClassName() const { return m_startClassName; }
53 
54  //----------//
55  // Functors //
56  //----------//
57 
61  FunctorCode Accept(Functor &functor) override;
63  FunctorCode Accept(ConstFunctor &functor) const override;
64  FunctorCode AcceptEnd(Functor &functor) override;
65  FunctorCode AcceptEnd(ConstFunctor &functor) const override;
67 
68 protected:
69  //
70 private:
71  //
72 public:
73  //
74 protected:
75  Object *m_start;
76 
77 private:
79  std::string m_startClassName;
81  Measure *m_drawingMeasure;
82 };
83 
84 //----------------------------------------------------------------------------
85 // SystemMilestoneInterface
86 //----------------------------------------------------------------------------
87 
92 public:
99  virtual ~SystemMilestoneInterface();
100  virtual void Reset();
102 
103  void SetMeasure(Measure *measure) { m_drawingMeasure = measure; }
104  Measure *GetMeasure() { return m_drawingMeasure; }
105  const Measure *GetMeasure() const { return m_drawingMeasure; }
106 
111  void SetEnd(SystemMilestoneEnd *end);
113  SystemMilestoneEnd *GetEnd() { return m_end; }
114  const SystemMilestoneEnd *GetEnd() const { return m_end; }
115  bool IsSystemMilestone() const { return (m_end != NULL); }
117 
121  void ConvertToPageBasedMilestone(Object *object, Object *parent);
122 
123  //-----------------//
124  // Pseudo functors //
125  //-----------------//
126 
132  FunctorCode InterfaceResetData(ResetDataFunctor &functor);
134 
135 protected:
136  //
137 private:
138  //
139 public:
140  //
141 protected:
142  SystemMilestoneEnd *m_end;
143 
144 private:
146  Measure *m_drawingMeasure;
147 };
148 
149 } // namespace vrv
150 
151 #endif
vrv::Measure
This class represents a measure in a page-based score (Doc).
Definition: measure.h:37
vrv::SystemMilestoneInterface
This class is an interface for container elements that have to be turned to milestones in a page-base...
Definition: systemmilestone.h:91
vrv::PrepareMilestonesFunctor
This class sets the Measure of Ending.
Definition: preparedatafunctor.h:865
vrv::SystemElement
This class represents elements appearing within a measure.
Definition: systemelement.h:25
vrv::Object
This class represents a basic object.
Definition: object.h:59
vrv::SystemMilestoneInterface::InterfacePrepareMilestones
FunctorCode InterfacePrepareMilestones(PrepareMilestonesFunctor &functor)
We have functor code in the interface for avoiding code duplication in each implementation class.
vrv::SystemMilestoneEnd
This class models an end milestone element at the system level.
Definition: systemmilestone.h:28
vrv::Functor
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
vrv::ConstFunctor
This abstract class is the base class for all const functors.
Definition: functor.h:126
vrv::SystemMilestoneEnd::Accept
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
vrv::SystemMilestoneEnd::Reset
void Reset() override
Reset the object, that is 1) removing all children and 2) resetting all attributes.
vrv::ResetDataFunctor
This class resets the drawing values before calling PrepareData after changes.
Definition: resetfunctor.h:22