Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
drawablefunctionmark.h
Go to the documentation of this file.
1 
8 #ifndef DRAWABLEFUNCTIONMARK_H_
9 #define DRAWABLEFUNCTIONMARK_H_
10 
12 #include "core/functionmark.h"
13 
14 class CAFunctionMark;
16 
18 public:
19  CADrawableFunctionMark(CAFunctionMark *function, CADrawableFunctionMarkContext *context, double x, double y);
21 
22  void draw(QPainter *p, const CADrawSettings s);
24 
27 
29  void setExtenderLineVisible(bool visible) { _extenderLineVisible = visible; }
31  void setExtenderLineOnly( bool line ) { _extenderLineOnly = line; }
32 
33 private:
34  bool _extenderLineVisible; // Should the function draw a horizontal line until the end of the function
35  QString _text; // Function transformed to String which is rendered then
36  bool _extenderLineOnly; // Only extender line should be rendered over the whole width of the function
37 };
38 
40 public:
42  Key,
48  };
49  // Key constructor
50  CADrawableFunctionMarkSupport(CADrawableFunctionMarkSupportType, const QString key, CADrawableContext *c, double x, double y);
51  // Rectangle, ChordArea, Tonicization, Ellipse constructor
53  // Alterations consructor
55 
57 
58  void draw(QPainter *p, const CADrawSettings s);
61 
63  void setExtenderLineVisible(bool visible) { _extenderLineVisible = visible; }
64  bool rectWider() { return _rectWider; }
65  void setRectWider(bool wider) { if (!_rectWider) { _rectWider = wider; _yPos -= 3; _height += 6; } }
66 
67 private:
69  QString _key;
70  CADrawableFunctionMark *_function1, *_function2; // Tonicization's start/end functions
71  bool _extenderLineVisible; // Extender line when tonicization used after
72  bool _rectWider; // Is rectangle wider in height. Default: false. Useful when doing a series of modulations where you don't know which rectangle belongs to which function. Every 2nd rectangle is then a bit higher than the others.
73 };
74 
75 #endif /* DRAWABLEFUNCTIONMARK_H_ */