forked from rism-digital/verovio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot.cpp
82 lines (60 loc) · 2.15 KB
/
dot.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/////////////////////////////////////////////////////////////////////////////
// Name: dot.cpp
// Author: Laurent Pugin
// Created: 2014
// Copyright (c) Authors and others. All rights reserved.
/////////////////////////////////////////////////////////////////////////////
#include "dot.h"
//----------------------------------------------------------------------------
#include <assert.h>
//----------------------------------------------------------------------------
#include "functorparams.h"
#include "note.h"
namespace vrv {
//----------------------------------------------------------------------------
// Dot
//----------------------------------------------------------------------------
Dot::Dot() : LayerElement("dot-"), PositionInterface(), AttColor(), AttDotLog()
{
RegisterInterface(PositionInterface::GetAttClasses(), PositionInterface::IsInterface());
RegisterAttClass(ATT_COLOR);
RegisterAttClass(ATT_DOTLOG);
Reset();
}
Dot::~Dot() {}
void Dot::Reset()
{
LayerElement::Reset();
PositionInterface::Reset();
ResetColor();
ResetDotLog();
m_drawingNote = NULL;
m_drawingNextElement = NULL;
}
//----------------------------------------------------------------------------
// Functor methods
//----------------------------------------------------------------------------
int Dot::PreparePointersByLayer(FunctorParams *functorParams)
{
PreparePointersByLayerParams *params = dynamic_cast<PreparePointersByLayerParams *>(functorParams);
assert(params);
m_drawingNote = params->m_currentNote;
params->m_lastDot = this;
return FUNCTOR_CONTINUE;
}
int Dot::ResetDrawing(FunctorParams *functorParams)
{
// Call parent one too
LayerElement::ResetDrawing(functorParams);
PositionInterface::InterfaceResetDrawing(functorParams, this);
this->m_drawingNote = NULL;
this->m_drawingNextElement = NULL;
return FUNCTOR_CONTINUE;
}
int Dot::ResetHorizontalAlignment(FunctorParams *functorParams)
{
LayerElement::ResetHorizontalAlignment(functorParams);
PositionInterface::InterfaceResetHorizontalAlignment(functorParams, this);
return FUNCTOR_CONTINUE;
}
} // namespace vrv