GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRRod.h
1 #ifndef GRRod_H
2 #define GRRod_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 class GRNotationElement;
19 class GRSystem;
20 class GRStaff;
21 class GRVoice;
22 class GRStaffManager;
23 class GRSpring;
24 
25 template <class T> class KF_IPointerList;
26 template <class T> class KF_IVector;
27 
30 
33 class GRRod
34 {
35  friend class GRSystem;
36  friend class GRStaff;
37  friend class GRVoice;
38 
39 public:
40  GRRod( const GRRod & rod);
41  GRRod( float inLength, int inSpring1, int inSpring2 , float aOptForce);
42  GRRod( const GRNotationElement * gr1, const GRNotationElement * gr2, int lastspringid, float aOptForce);
43  GRRod(const GRNotationElement * gr1, const GRNotationElement * gr2, int lastspringid, float spacedistance, float aOptForce);
44  virtual ~GRRod() { }
45 
46  int resetForce(const GRRod & rd);
47  int getSpr1() const { return mSpr1; }
48  int getSpr2() const { return mSpr2; }
49  bool getIsSpaceRod() const { return mIsSpaceRod; }
50  void setIsSpaceRod(bool flag) { mIsSpaceRod = flag; }
51  float getLength() const { return mLength; }
52  void setLength( float in ) { mLength = in; }
53  float stretchsprings(float inForce, SpringVector * sprvect);
54  float calclength(float inForce ,SpringVector * sprvect);
55  float calcforce(SpringVector * sprvect);
56  int spansOne() const;
57  void setSpringIDs(int id1, int id2) { mSpr1 = id1; mSpr2 = id2; }
58 
59  int operator < (const GRRod & r2) const;
60 
61 protected:
63  float optForce;
64  float mForce;
65  int mSpr1;
66  int mSpr2;
67 
68 private:
69  bool mIsSpaceRod;
70  float mLength;
71 };
72 
73 inline int rodpcomp(const GRRod * r1, const GRRod * r2) { return *r1 < *r2; }
74 inline int GRRod::spansOne() const { return (mSpr1 == mSpr2 - 1) ? 1 : 0; }
75 
76 #endif
GRRod::mForce
float mForce
Definition: GRRod.h:64
GRRod::mGrStaff
GRStaff * mGrStaff
Definition: GRRod.h:62
GRSpring
Used with rods and space fore functions.
Definition: GRSpring.h:38
GRStaffManager
This class manages the staffs of a system.
Definition: GRStaffManager.h:160
GRRod::getLength
float getLength() const
Definition: GRRod.h:51
GRNotationElement
parent class for all notation elements.
Definition: GRNotationElement.h:54
GRRod::operator<
int operator<(const GRRod &r2) const
GRRod::spansOne
int spansOne() const
Definition: GRRod.h:74
GRRod
Used with springs and space-force functions.
Definition: GRRod.h:33
GRRod::calcforce
float calcforce(SpringVector *sprvect)
GRRod::mSpr1
int mSpr1
Definition: GRRod.h:65
GRRod::resetForce
int resetForce(const GRRod &rd)
GRStaff
A GRStaff represents a single line of music.
Definition: GRStaff.h:181
GRRod::setIsSpaceRod
void setIsSpaceRod(bool flag)
Definition: GRRod.h:50
KF_IPointerList
Definition: ARMusicalVoiceState.h:33
GRRod::mSpr2
int mSpr2
Definition: GRRod.h:66
GRRod::GRRod
GRRod(const GRRod &rod)
GRRod::calclength
float calclength(float inForce, SpringVector *sprvect)
GRRod::setLength
void setLength(float in)
Definition: GRRod.h:52
GRVoice
Graphical representation of a voice.
Definition: GRVoice.h:49
GRRod::~GRRod
virtual ~GRRod()
Definition: GRRod.h:44
GRRod::stretchsprings
float stretchsprings(float inForce, SpringVector *sprvect)
GRRod::getSpr2
int getSpr2() const
Definition: GRRod.h:48
KF_IVector
Definition: GRPossibleBreakState.h:20
GRRod::getIsSpaceRod
bool getIsSpaceRod() const
Definition: GRRod.h:49
GRRod::getSpr1
int getSpr1() const
Definition: GRRod.h:47
GRSystem
Manages a number of staffs and has a given start and end timeposition. GRSystem is the grafical repre...
Definition: GRSystem.h:52
GRRod::optForce
float optForce
Definition: GRRod.h:63
GRRod::setSpringIDs
void setSpringIDs(int id1, int id2)
Definition: GRRod.h:57

Guido Project Copyright © 2019 Grame-CNCM