GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRBowing.h
1 #ifndef GRBowing_H
2 #define GRBowing_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2004 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 <queue>
19 
20 #include "GRPTagARNotationElement.h"
21 
22 class ARBowing;
23 
24 class GRStaff;
25 class GRSystem;
26 class GRGlobalStem;
27 class GRStdNoteHead;
29 
30 
31 // - Graphic functions
32 void drawSlur( VGDevice & hdc, float x1, float y1, float x2, float y2, float x3, float y3, float inflexion = 6 ); // was = 5
33 
37 {
38  protected:
39  std::queue<GRNotationElement*> fDeferredTellPostion;
40 
41  class GRBowingContext // (JB) new
42  {
43  public:
44  GRBowingContext() : staff(0), openRight(false), openLeft(false),
47  stemDirLeft(dirOFF), stemDirRight(dirOFF),
49  curveDir(0)
50  { }
52  bool openRight;
53  bool openLeft;
62  int curveDir; // -1: downward, 0: unspecified, 1: upward.
63  };
64 
69  {
70  public:
71  GRBowingSaveStruct() : numoffsets(3), inflexion(4) { } // Previous default inflexion: 6
72 
73  virtual ~GRBowingSaveStruct() { }
75 
78  float inflexion;
83  };
84 
85 
86  public:
87  GRBowing( GRStaff * grstaff, GRNotationElement * startEl, GRNotationElement * endEl );
88  GRBowing( GRStaff * grstaff = 0); // constructor without REAL abstract Element
89  GRBowing( GRStaff * grstaff, const ARBowing * abstractRepresentationOfBowing );
90 
91  virtual ~GRBowing();
92 
94  virtual void OnDraw( VGDevice & hdc ) const;
95  virtual void updateBoundingBox();
96 
97  virtual void setOffset(int n_point, const NVPoint & p);
98  virtual void removeAssociation(GRNotationElement * el );
99  virtual void addAssociation(GRNotationElement * );
100 
101  virtual void tellPositionEnd(GRNotationElement * caller);
102  virtual void tellPosition(GObject * caller, const NVPoint & newPosition);
103  virtual GRNotationElement * getStartElement(GRStaff * grstaff) const;
104  virtual GRNotationElement * getEndElement(GRStaff * grstaff) const;
105 
106  protected:
107  virtual void automaticCurveDirection ( GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse );
108  virtual void automaticAnchorPoints ( const GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse );
109  virtual void automaticControlPoints ( const GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse );
110  virtual void updateBow ( GRStaff * grstaff, bool grace=false );
111 
112  private:
113  virtual void drawSlur( VGDevice & hdc, NVPoint pstart, NVPoint pmid, NVPoint pend ) const;
114 
115  virtual GRSystemStartEndStruct * prepareSSEStructForBow( const GRStaff * inStaff );
116 
117  virtual void getBowBeginingContext ( GRBowingContext * ioContext, GRSystemStartEndStruct * sse ) const;
118  virtual void getBowEndingContext ( GRBowingContext * ioContext, GRSystemStartEndStruct * sse ) const;
119 
120  virtual GRGlobalStem * findGlobalStem( const GRNotationElement * stemOwner ) const;
121 
122  // - Positionning of the curve.
123  virtual void graceAnchorPoints ( const GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse, GRStaff * staff );
124  virtual void manualAnchorPoints ( const GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse );
125  virtual void manualControlPoints ( const GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse );
126  virtual void applyAnchorPointsOffsets ( const GRBowingContext * context, const ARBowing * arBow, GRSystemStartEndStruct * sse );
127 
128  GRSystemStartEndStruct * initGRBowing( GRStaff * grstaff );
129 };
130 
131 #endif
132 
GRBowing::addAssociation
virtual void addAssociation(GRNotationElement *)
GRBowing::tellPositionEnd
virtual void tellPositionEnd(GRNotationElement *caller)
GRBowing::GRBowingContext
Definition: GRBowing.h:41
GRSystemStartEndStruct
This class is used to determine when a position tag ends.
Definition: GRPositionTag.h:32
GRBowing::automaticControlPoints
virtual void automaticControlPoints(const GRBowingContext *context, const ARBowing *arBow, GRSystemStartEndStruct *sse)
GRBowing::GRBowingContext::topRightHead
GRStdNoteHead * topRightHead
Definition: GRBowing.h:56
GRBowing::updateBow
virtual void updateBow(GRStaff *grstaff, bool grace=false)
GRBowing::GRBowingSaveStruct::inflexion
float inflexion
Definition: GRBowing.h:78
GObject
The base class for all graphic objects.
Definition: GObject.h:54
GRBowing::GRBowingSaveStruct
Save informations needed to draw the bow when different staves are needed, see GRPositionTag for comm...
Definition: GRBowing.h:68
GRBowing::setOffset
virtual void setOffset(int n_point, const NVPoint &p)
GRBowing::GRBowingSaveStruct::offsets
NVPoint offsets[3]
Definition: GRBowing.h:76
GRBowing::GRBowingContext::leftChordStem
GRGlobalStem * leftChordStem
Definition: GRBowing.h:60
GRBowing::automaticAnchorPoints
virtual void automaticAnchorPoints(const GRBowingContext *context, const ARBowing *arBow, GRSystemStartEndStruct *sse)
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
NVPoint
Definition: NVPoint.h:20
GRBowing::fDeferredTellPostion
std::queue< GRNotationElement * > fDeferredTellPostion
Definition: GRBowing.h:39
GRBowing::~GRBowing
virtual ~GRBowing()
GRBowing::GRBowingSaveStruct::GRBowingSaveStruct
GRBowingSaveStruct()
Definition: GRBowing.h:71
GRBowing::getStartElement
virtual GRNotationElement * getStartElement(GRStaff *grstaff) const
GRPositionTag::GRSaveStruct
Definition: GRPositionTag.h:68
GRBowing::GRBowingSaveStruct::~GRBowingSaveStruct
virtual ~GRBowingSaveStruct()
Definition: GRBowing.h:73
GRBowing::getEndElement
virtual GRNotationElement * getEndElement(GRStaff *grstaff) const
GRBowing::GRBowingContext::bottomLeftHead
GRStdNoteHead * bottomLeftHead
Definition: GRBowing.h:55
GRStaff
A GRStaff represents a single line of music.
Definition: GRStaff.h:181
GRBowing::GRBowingSaveStruct::max
NVRect max
Definition: GRBowing.h:80
GRBowing::GRBowingSaveStruct::min
NVRect min
Definition: GRBowing.h:81
GRBowing::OnDraw
virtual void OnDraw(VGDevice &hdc) const
GRBowing
Base class for ties and slurs.
Definition: GRBowing.h:36
GRStdNoteHead
Graphical representation of a note head.
Definition: GRStdNoteHead.h:25
GRBowing::getNewGRSaveStruct
GRPositionTag::GRSaveStruct * getNewGRSaveStruct()
GRPTagARNotationElement
not yet documented
Definition: GRPTagARNotationElement.h:25
GRBowing::updateBoundingBox
virtual void updateBoundingBox()
GRBowing::GRBowingContext::stemDirLeft
int stemDirLeft
Definition: GRBowing.h:58
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GRBowing::GRBowingContext::bottomRightHead
GRStdNoteHead * bottomRightHead
Definition: GRBowing.h:57
GRBowing::GRBowingSaveStruct::numoffsets
int numoffsets
Definition: GRBowing.h:74
GRBowing::GRBowingContext::topLeftHead
GRStdNoteHead * topLeftHead
Definition: GRBowing.h:54
GRBowing::removeAssociation
virtual void removeAssociation(GRNotationElement *el)
NVRect
Definition: NVRect.h:22
GRBowing::GRBowingSaveStruct::context
GRBowingContext context
Definition: GRBowing.h:82
GRBowing::GRBowingContext::openRight
bool openRight
Definition: GRBowing.h:52
GRBowing::GRBowingContext::rightChordStem
GRGlobalStem * rightChordStem
Definition: GRBowing.h:61
GRBowing::GRBowingSaveStruct::position
NVPoint position
Definition: GRBowing.h:77
GRBowing::GRBowingSaveStruct::box
NVRect box
Definition: GRBowing.h:79
GRBowing::GRBowingContext::stemDirRight
int stemDirRight
Definition: GRBowing.h:59
GRBowing::GRBowingContext::openLeft
bool openLeft
Definition: GRBowing.h:53
GRBowing::automaticCurveDirection
virtual void automaticCurveDirection(GRBowingContext *context, const ARBowing *arBow, GRSystemStartEndStruct *sse)
GRGlobalStem
Shared stem.
Definition: GRGlobalStem.h:36
GRSystem
Manages a number of staffs and has a given start and end timeposition. GRSystem is the grafical repre...
Definition: GRSystem.h:52
GRBowing::GRBowingContext::GRBowingContext
GRBowingContext()
Definition: GRBowing.h:44
GRBowing::GRBowing
GRBowing(GRStaff *grstaff, GRNotationElement *startEl, GRNotationElement *endEl)
GRBowing::tellPosition
virtual void tellPosition(GObject *caller, const NVPoint &newPosition)
GRBowing::GRBowingContext::staff
GRStaff * staff
Definition: GRBowing.h:51
GRBowing::GRBowingContext::curveDir
int curveDir
Definition: GRBowing.h:62
ARBowing
Implement bowing abstract objects (slur, ties...)
Definition: ARBowing.h:23

Guido Project Copyright © 2019 Grame-CNCM