GUIDOLib  1.7.7
Guido Engine Internal Documentation
GROctava.h
1 #ifndef GROctava_H
2 #define GROctava_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2002-2017 Grame
8 
9  This Source Code Form is subject to the terms of the Mozilla Public
10  License, v. 2.0. If a copy of the MPL was not distributed with this
11  file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 
13  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
14  research@grame.fr
15 
16 */
17 
18 #include <map>
19 #include <vector>
20 
21 #include "TagParameterString.h"
22 #include "GRARNotationElement.h"
23 #include "GRPositionTag.h"
24 
25 class NVstring;
26 class GRStaff;
27 class NVPoint;
28 class VGDevice;
29 class AROctava;
30 
34 {
35  public:
36  GROctava( GRStaff *, const NVstring & txt, const AROctava* ar, bool bassa );
37  virtual ~GROctava();
38 
39  virtual void tellPosition(GObject *caller, const NVPoint & );
40 
41  virtual void OnDraw( VGDevice & hdc ) const;
42  virtual void setColRef(const TagParameterString *tps);
43  virtual bool DeleteStaff(GRStaff * grstaff);
44 
45  private:
46  typedef struct segment {
47  float x1 = 0;
48  float x2 = 0;
49  float x3 = 0;
50  float y = 0;
51  int index = 0;
52  void reset() { x1 = x2 = x3 = y = 0; }
53  } TSegment;
54  std::vector<TSegment> fSegments;
55  std::map<const GRSystem*, TSegment> fSegmentsMap;
56  TSegment fCurrent;
57 
58  int fOctava = 0;
59 
60  NVRect getExtensionLine (const NEPointerList * assoc, GuidoPos start, GuidoPos end) const;
61  NVRect getEltBox (const GRNotationElement* el) const;
62 
63  TSegment nvrect2Segment(const NVRect& r) const;
64  void drawText (const TSegment& seg, VGDevice & hdc ) const;
65  void drawLine (const TSegment& seg, bool last, VGDevice & hdc ) const;
66 
67  GRStaff * fStaff;
68  NVstring fText;
69  bool fBassa;
70  bool fHidden;
71  float fTextHeight;
72  float fDx = 0;
73  float fDy = 0;
74 };
75 
76 #endif
77 
GObject
The base class for all graphic objects.
Definition: GObject.h:54
GROctava::~GROctava
virtual ~GROctava()
AROctava
The Octava tag.
Definition: AROctava.h:45
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
GROctava::GROctava
GROctava(GRStaff *, const NVstring &txt, const AROctava *ar, bool bassa)
NVPoint
Definition: NVPoint.h:20
GROctava::OnDraw
virtual void OnDraw(VGDevice &hdc) const
GRStaff
A GRStaff represents a single line of music.
Definition: GRStaff.h:181
GRPositionTag
The GRPositionTag is the base class for representing range tags.
Definition: GRPositionTag.h:65
GROctava::tellPosition
virtual void tellPosition(GObject *caller, const NVPoint &)
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GROctava::setColRef
virtual void setColRef(const TagParameterString *tps)
GROctava::DeleteStaff
virtual bool DeleteStaff(GRStaff *grstaff)
NVstring
Definition: nvstring.h:21
NVRect
Definition: NVRect.h:22
TagParameterString
A string-type tag parameter.
Definition: TagParameterString.h:25
GRARNotationElement
This class is the base class for all graphical elements that have a direct counterpart in the Abstrac...
Definition: GRARNotationElement.h:25
NEPointerList
Definition: NEPointerList.h:34
GROctava
not yet documented
Definition: GROctava.h:33

Guido Project Copyright © 2019 Grame-CNCM