OpenWalnut  1.5.0dev
WTransferFunctionLine.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WTRANSFERFUNCTIONLINE_H
26 #define WTRANSFERFUNCTIONLINE_H
27 
28 #include "QGraphicsLineItem"
29 
32 
33 /**
34  * Line object for the connection of alpha control points.
35  */
37 {
38 public:
39  /** type of the base class */
41 
42  /**
43  * Default constructor.
44  *
45  * \param parent parent widget
46  */
47  explicit WTransferFunctionLine( WTransferFunctionWidget* parent = 0x0 );
48 
49  /**
50  * Default destructor.
51  **/
52  virtual ~WTransferFunctionLine();
53 
54  /**
55  * Get the point to the left.
56  *
57  * \returns point to the left
58  */
60 
61  /**
62  * Get the point to the right.
63  *
64  * \returns point to the right
65  */
67 
68  /**
69  * Sets point to the left.
70  *
71  * \param left new point to the left
72  */
74 
75  /**
76  * Sets point to the right.
77  *
78  * \param right new point to the right
79  */
81 
82  /**
83  * Paint the line.
84  *
85  * \param painter the painter used
86  * \param option the style option used for painting
87  * \param widget the widget used for painting
88  */
89  virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget* widget );
90 
91 protected:
92  // to be implemented: how do we want to handle moves of lines?
93  // I think a vertical move may be nice, but may even be implemented using
94  // itemChange(...)
95  //void mouseMoveEvent( QGraphicsSceneMouseEvent *event );
96  //void mousePressEvent( QGraphicsSceneMouseEvent *event );
97  //void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
98 
99 private:
100  /** the width of the line used for painting */
101  double lineWidth;
102 
103  /** the point to the left */
105 
106  /** the point to the right */
108 };
109 
110 #endif // WTRANSFERFUNCTIONLINE_H
111 
Line object for the connection of alpha control points.
void setRight(WTransferFunctionPoint *right)
Sets point to the right.
void setLeft(WTransferFunctionPoint *left)
Sets point to the left.
WTransferFunctionPoint * right
the point to the right
virtual ~WTransferFunctionLine()
Default destructor.
WTransferFunctionPoint * getLeft() const
Get the point to the left.
WTransferFunctionPoint * getRight() const
Get the point to the right.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Paint the line.
double lineWidth
the width of the line used for painting
QGraphicsLineItem BaseClass
type of the base class
WTransferFunctionPoint * left
the point to the left
WTransferFunctionLine(WTransferFunctionWidget *parent=0x0)
Default constructor.
A control point for the alpha function.
A widget that holds a scene to display and modify the transfer function.