GUIDOLib  1.7.7
Guido Engine Internal Documentation
GRPage.h
1 #ifndef GRPage_H
2 #define GRPage_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2003, 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 <vector>
19 
20 #include "GREvent.h"
21 #include "GUIDOEngine.h" // for GuidoOnDrawDesc
22 
23 class ARPageFormat;
24 class ARMusic;
25 
26 class GRSystem;
27 class GRMusic;
28 class GRStaffManager;
29 class TCollisions;
30 
31 extern GRSystem * gCurSystem;
32 extern NVRect gClipRect;
33 
34 typedef std::vector<GRSystem *> SystemPointerList;
35 
40 class GRPage : public GREvent
41 {
42  public:
43  GRPage( GRMusic * grmusic, GRStaffManager * grstafmgr,
44  const TYPE_TIMEPOSITION & inDate, GuidoLayoutSettings &aSettings, GRPage * prevpage = 0 );
45  virtual ~GRPage();
46 
47  bool addSystem( GRSystem * inSystem, float * ioUsedSystemDistance );
48  void systemFinished(GRSystem * inSystem);
49  void finishPage( bool islastpage = false ); // system distribution
50  void setSpringParameter(float npar);
51  void setPageFormat(const ARPageFormat * inFormat);
52  void adjustPageSize();
53  void checkCollisions(TCollisions& state, bool lyrics) const;
54  float getNotesDensity() const;
55 
56  const ARMusic * getARMusic() const;
57 
58  // - Graphic
59  virtual void trace( VGDevice & hdc ) const;
60  virtual void OnDraw( VGDevice & hdc ) const;
61  virtual void OnDraw( VGDevice & hdc, const GuidoOnDrawDesc & inDrawInfos ) const;
62  virtual void GetMap( GuidoElementSelector sel, MapCollector& f, MapInfos& infos ) const;
63 
64  virtual void print(std::ostream& os) const;
65  virtual void accept (GRVisitor& visitor);
66 
67  void getMarginsCm( float * ml, float * mt, float * mr, float * mb );
68  void getPageFormat( GuidoPageFormat * outFormat ) const;
69 
70  float getMarginLeft() const { return mLeftMargin; }
71  float getMarginTop() const { return mTopMargin; }
72  float getMarginRight() const { return mRightMargin; }
73  float getMarginBottom() const { return mBottomMargin; }
74 
75  float getPageWidth() const { return mWidth; }
76  float getPageHeight() const { return mHeight; }
77  float getInnerWidth() const;
78  float getInnerHeight() const;
79 
80  float getPageWidthCm() const;
81  float getPageHeightCm() const;
82  float getInnerWidthCm() const;
83  float getInnerHeightCm() const;
84 
85  void getScaling( float& vsizex, float& vsizey ) const;
86 
87  const SystemPointerList * getSystems() const { return &mSystems; }
88 
90 
91  protected:
92  void setScaling( VGDevice & hdc, float vsizex, float vsizey ) const;
93 
96 
97  float mLeftMargin; // now in internal units
98  float mTopMargin;
99  float mRightMargin;
101  float mWidth; // now in internal units
102  float mHeight;
104 
105  bool DPtoLPRect( VGDevice & hdc, float left, float top, float right, float bottom, NVRect * outRect ) const;
106  virtual void updateBoundingBox();
107  // old...
108  void setHorizontalSpacing();
109 
110  SystemPointerList mSystems;
112 };
113 
114 #endif
GRPage::setHorizontalSpacing
void setHorizontalSpacing()
GRVisitor
Definition: GRVisitor.h:39
GRPage::finishPage
void finishPage(bool islastpage=false)
GRPage::mBottomMargin
float mBottomMargin
Definition: GRPage.h:100
GRPage::trace
virtual void trace(VGDevice &hdc) const
MapCollector
an abstract class to be provided by clients to collect mappings
Definition: GUIDOScoreMap.h:109
GRPage::settings
GuidoLayoutSettings settings
Definition: GRPage.h:111
GRPage::getNotesDensity
float getNotesDensity() const
GuidoOnDrawDesc
Contains all graphic-related information required by GuidoOnDraw()
Definition: GUIDOEngine.h:152
GRPage::mCurMusic
GRMusic * mCurMusic
Definition: GRPage.h:95
GRPage::GRPage
GRPage(GRMusic *grmusic, GRStaffManager *grstafmgr, const TYPE_TIMEPOSITION &inDate, GuidoLayoutSettings &aSettings, GRPage *prevpage=0)
GRPage::getPageFormat
void getPageFormat(GuidoPageFormat *outFormat) const
GRPage::getSystems
const SystemPointerList * getSystems() const
Definition: GRPage.h:87
GRPage
Graphical representation of a score page. Contains one or more instances of class GRSystem.
Definition: GRPage.h:40
TCollisions
Definition: TCollisions.h:53
GRPage::getMarginsCm
void getMarginsCm(float *ml, float *mt, float *mr, float *mb)
GRPage::getPageWidth
float getPageWidth() const
Definition: GRPage.h:75
GRPage::adjustPageSize
void adjustPageSize()
GRPage::getPageWidthCm
float getPageWidthCm() const
GRPage::getInnerWidthCm
float getInnerWidthCm() const
GRPage::getMarginRight
float getMarginRight() const
Definition: GRPage.h:72
GRStaffManager
This class manages the staffs of a system.
Definition: GRStaffManager.h:160
Fraction
Numerator and denominator.
Definition: Fraction.h:23
GRMusic
Graphical representation of the music. It handles a list of voices and a list of pages.
Definition: GRMusic.h:41
GREvent
Graphical representation for an event (= has duration).
Definition: GREvent.h:61
GRPage::mLeftMargin
float mLeftMargin
Definition: GRPage.h:97
GRPage::m_staffmgr
GRStaffManager * m_staffmgr
Definition: GRPage.h:94
GuidoPageFormat
The page format parameters.
Definition: GUIDOEngine.h:316
GRPage::setSpringParameter
void setSpringParameter(float npar)
MapInfos
A class to propagate device related information.
Definition: GObject.h:42
GRPage::~GRPage
virtual ~GRPage()
GRPage::getMarginTop
float getMarginTop() const
Definition: GRPage.h:71
GRPage::accept
virtual void accept(GRVisitor &visitor)
GRPage::mSystems
SystemPointerList mSystems
Definition: GRPage.h:110
GRPage::mDebugPageDate
TYPE_TIMEPOSITION mDebugPageDate
Definition: GRPage.h:89
GRPage::mTopMargin
float mTopMargin
Definition: GRPage.h:98
GRPage::getARMusic
const ARMusic * getARMusic() const
GRPage::mWidth
float mWidth
Definition: GRPage.h:101
GRPage::checkCollisions
void checkCollisions(TCollisions &state, bool lyrics) const
GRPage::OnDraw
virtual void OnDraw(VGDevice &hdc) const
GRPage::getMarginBottom
float getMarginBottom() const
Definition: GRPage.h:73
GRPage::getInnerWidth
float getInnerWidth() const
GRPage::getPageHeight
float getPageHeight() const
Definition: GRPage.h:76
GRPage::getInnerHeight
float getInnerHeight() const
VGDevice
Generic platform independant drawing device.
Definition: VGDevice.h:68
GuidoLayoutSettings
Engine settings for the graphic score layout.
Definition: GUIDOEngine.h:255
ARPageFormat
not yet documented
Definition: ARPageFormat.h:52
GRPage::print
virtual void print(std::ostream &os) const
GRPage::DPtoLPRect
bool DPtoLPRect(VGDevice &hdc, float left, float top, float right, float bottom, NVRect *outRect) const
NVRect
Definition: NVRect.h:22
GRPage::getInnerHeightCm
float getInnerHeightCm() const
GRPage::setScaling
void setScaling(VGDevice &hdc, float vsizex, float vsizey) const
GuidoElementSelector
GuidoElementSelector
Definition: GUIDOScoreMap.h:40
GRSystem
Manages a number of staffs and has a given start and end timeposition. GRSystem is the grafical repre...
Definition: GRSystem.h:52
GRPage::getPageHeightCm
float getPageHeightCm() const
GRPage::mRightMargin
float mRightMargin
Definition: GRPage.h:99
GRPage::getMarginLeft
float getMarginLeft() const
Definition: GRPage.h:70
GRPage::mHeight
float mHeight
Definition: GRPage.h:102
GRPage::addSystem
bool addSystem(GRSystem *inSystem, float *ioUsedSystemDistance)
GRPage::updateBoundingBox
virtual void updateBoundingBox()
GRPage::systemFinished
void systemFinished(GRSystem *inSystem)
GRPage::GetMap
virtual void GetMap(GuidoElementSelector sel, MapCollector &f, MapInfos &infos) const
GRPage::setPageFormat
void setPageFormat(const ARPageFormat *inFormat)
ARMusic
Translation of a GUIDO Segment into a class.
Definition: ARMusic.h:31
GRPage::m_totalsystemheight
float m_totalsystemheight
Definition: GRPage.h:103
GRPage::getScaling
void getScaling(float &vsizex, float &vsizey) const

Guido Project Copyright © 2019 Grame-CNCM