QtPdWidgets  2.3.1
BarStack.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2012 Florian Pose <fp@igh-essen.com>
4  *
5  * This file is part of the QtPdWidgets library.
6  *
7  * The QtPdWidgets library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, either version 3 of the License,
10  * or (at your option) any later version.
11  *
12  * The QtPdWidgets library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with the QtPdWidgets Library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  *
21  ****************************************************************************/
22 
23 #ifndef PD_BAR_STACK_H
24 #define PD_BAR_STACK_H
25 
26 #include <QtGui>
27 #include <QList>
28 
29 #include "Bar_p.h"
30 
31 /****************************************************************************/
32 namespace Pd {
33 
35 {
36  public:
37  Stack(BarPrivate *);
38  virtual ~Stack();
39 
40  void addSection(PdCom::Variable, const PdCom::Selector &,
41  const QtPdCom::Transmission & = QtPdCom::event_mode, double = 1.0,
42  double = 0.0, double = 0.0, QColor = Qt::black);
43  void addSection(PdCom::Process *, const QString &,
44  const PdCom::Selector &,
45  const QtPdCom::Transmission & = QtPdCom::event_mode, double = 1.0,
46  double = 0.0, double = 0.0, QColor = Qt::black);
47  void clearData();
48 
49  QRect &getRect() { return rect; }
50  const QRect &getRect() const { return rect; }
51 
52  void paint(QPainter &);
53 
54  void redrawEvent();
55  void update();
56 
57  private:
58  BarPrivate * const bar;
59  QRect rect;
60 
61  class Section;
62  typedef QList<Section *> SectionList;
64 
65  void paintColorBar(QPainter &);
66  void paintArrow(QPainter &);
67  const QColor findMultiColor(double) const;
68 
69  Stack();
70 };
71 
72 }
73 
74 #endif
75 
76 /****************************************************************************/
Definition: BarStack.h:34
SectionList sections
Definition: BarStack.h:63
void addSection(PdCom::Variable, const PdCom::Selector &, const QtPdCom::Transmission &=QtPdCom::event_mode, double=1.0, double=0.0, double=0.0, QColor=Qt::black)
Definition: Bar.h:36
void clearData()
Definition: BarStack.cpp:159
const QColor findMultiColor(double) const
Definition: BarStack.cpp:272
BarPrivate *const bar
Definition: BarStack.h:58
void paint(QPainter &)
Paint method.
Definition: BarStack.cpp:65
QRect & getRect()
Definition: BarStack.h:49
virtual ~Stack()
Destructor.
Definition: BarStack.cpp:53
void redrawEvent()
Definition: BarStack.cpp:142
const QRect & getRect() const
Definition: BarStack.h:50
void update()
Definition: BarStack.cpp:152
Definition: BarSection.h:33
QRect rect
Definition: BarStack.h:59
QList< Section * > SectionList
Definition: BarStack.h:61
void paintColorBar(QPainter &)
Paint method for ColorBar style.
Definition: BarStack.cpp:172
Bar graph widget.
Definition: Bar_p.h:43
void paintArrow(QPainter &)
Paint method for Arrow style.
Definition: BarStack.cpp:240