GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRStem.h
1 #ifndef GRStem_H
2 #define GRStem_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2003 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 "NVPoint.h"
19 #include "GRNotationElement.h"
20 #include "ARTHead.h"
21 
22 class GREvent;
23 class GRSingleNote;
24 class GRGlobalStem;
25 
28 class GRStem : public GRNotationElement
29 {
30 public:
31  // the constructur for global stems ...
32  GRStem(GRGlobalStem * gstem);
33  GRStem(GREvent * sngnot, const TYPE_DURATION & dur, GDirection dir, float length, float notebreite);
34 
35  virtual ~GRStem();
36 
37  virtual void configureStem(const TYPE_DURATION& dur);
38 
39  virtual void setStemLength( float inLen );
40  virtual void setStemDir(GDirection dir);
41  virtual void addToOffset(const NVPoint &pt) { mOffset += pt; }
42 
43  virtual void OnDraw( VGDevice & hdc ) const;
44 
45  virtual const NVPoint& getReferencePosition() const { return sRefpos; }
46  virtual const NVPoint& getOffset() const { return mOffset; }
47  virtual float getSize() const { return mSize; }
48  virtual GDirection getStemDir() const { return mStemDir; }
49  virtual float getStemLength() const { return mStemLen; }
50  virtual const unsigned char * getColRef() const { return mColRef; }
51 
52  bool getFirstSegmentDrawingState() const { return fDrawActivated; }
53  ARTHead::HEADSTATE getHeadOrientation() const { return fHeadOrientation; }
54 
55  virtual void setColRef( const unsigned char * inColor );
56 
57  void setOffsetStartPosition(float inOffset) { fOffsetStartPosition = inOffset; }
58  void setFirstSegmentDrawingState(bool inDrawActivated) { fDrawActivated = inDrawActivated; }
59  /* Only for GlobalStem */
60  void setLastHeadOrientation(ARTHead::HEADSTATE value) { fLastHeadOrientation = value; }
61 
62 private:
63  void DrawWithGlyph ( VGDevice & hdc ) const;
64  void DrawWithLine ( VGDevice & hdc ) const;
65  void DrawStem ( VGDevice & hdc, unsigned int symbol1, unsigned int symbol2, float starty, float length ) const;
66  float GetStartYOffset ( bool up, float lineSpace) const;
67 
68  float mStemLen;
69  GDirection mStemDir;
70 
71  float mSize; // (JB) is it related to the height of the 'stem' glyph in the musical font ?
72  unsigned char * mColRef;
73  NVPoint mOffset;
74 
75  static NVPoint sRefpos;
76 
77  float fOffsetStartPosition; // depends on the notehead
78  bool fDrawActivated;
79 
80  int fNoteHeadType;
81 
82  ARTHead::HEADSTATE fHeadOrientation;
83  ARTHead::HEADSTATE fLastHeadOrientation;
84 
85  GREvent *fSngnot;
86  GDirection fDir;
87  float fLength;
88  float fNotebreite;
89 };
90 
91 #endif
92 
GRStem::getFirstSegmentDrawingState
bool getFirstSegmentDrawingState() const
Definition: GRStem.h:52
GRSingleNote
Graphical representation of a note event.
Definition: GRSingleNote.h:38
GRStem::getColRef
virtual const unsigned char * getColRef() const
Definition: GRStem.h:50
GRStem::getOffset
virtual const NVPoint & getOffset() const
Definition: GRStem.h:46
Fraction
Numerator and denominator.
Definition: Fraction.h:23
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
GREvent
Graphical representation for an event (= has duration).
Definition: GREvent.h:61
NVPoint
Definition: NVPoint.h:20
GRStem::setColRef
virtual void setColRef(const unsigned char *inColor)
GRStem::~GRStem
virtual ~GRStem()
GRStem::getStemDir
virtual GDirection getStemDir() const
Definition: GRStem.h:48
GRStem::getStemLength
virtual float getStemLength() const
Definition: GRStem.h:49
GRStem::configureStem
virtual void configureStem(const TYPE_DURATION &dur)
GRStem::getHeadOrientation
ARTHead::HEADSTATE getHeadOrientation() const
Definition: GRStem.h:53
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GRStem::OnDraw
virtual void OnDraw(VGDevice &hdc) const
GRStem::getReferencePosition
virtual const NVPoint & getReferencePosition() const
Retrieves the Symbol-reference-position with respect to the GUIDO-reference-position.
Definition: GRStem.h:45
GRStem::setOffsetStartPosition
void setOffsetStartPosition(float inOffset)
Definition: GRStem.h:57
ARTHead::HEADSTATE
HEADSTATE
Definition: ARTHead.h:80
GRStem::addToOffset
virtual void addToOffset(const NVPoint &pt)
Definition: GRStem.h:41
GRGlobalStem
Shared stem.
Definition: GRGlobalStem.h:36
GRStem
Graphical representation of a stem.
Definition: GRStem.h:28
GRStem::setStemLength
virtual void setStemLength(float inLen)
GRStem::getSize
virtual float getSize() const
Definition: GRStem.h:47
GRStem::setStemDir
virtual void setStemDir(GDirection dir)
GRStem::setFirstSegmentDrawingState
void setFirstSegmentDrawingState(bool inDrawActivated)
Definition: GRStem.h:58
GRStem::setLastHeadOrientation
void setLastHeadOrientation(ARTHead::HEADSTATE value)
Definition: GRStem.h:60
GRStem::GRStem
GRStem(GRGlobalStem *gstem)

Guido Project Copyright © 2019 Grame-CNCM