OpenWalnut
1.5.0dev
|
A control point for the alpha function. More...
#include <WTransferFunctionPoint.h>
Public Types | |
typedef QGraphicsItem | BaseClass |
type of the base class More... | |
Public Member Functions | |
WTransferFunctionPoint (WTransferFunctionWidget *parent=NULL) | |
Default constructor. More... | |
virtual | ~WTransferFunctionPoint () |
Default destructor. More... | |
void | setLeft (WTransferFunctionPoint *left) |
Set point to the left. More... | |
WTransferFunctionPoint * | getLeft () const |
Get point to the left. More... | |
void | setRight (WTransferFunctionPoint *right) |
Set point to the right. More... | |
WTransferFunctionPoint * | getRight () const |
Get point to the right. More... | |
void | setLine (WTransferFunctionLine *line) |
Set the line pointing to the right. More... | |
WTransferFunctionLine * | getLine () const |
The current line if there is one. More... | |
QRectF | boundingRect () const |
Get the bounding rectangle. More... | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) |
Paint the object. More... | |
virtual void | setPos (QPointF point) |
Overloaded form base class for debugging. More... | |
Protected Member Functions | |
void | clampToRectangle (QPointF *const pos, const QRectF &rectangle) const |
Helper to itemChange. More... | |
void | clampToLeftAndRight (QPointF *const pos) const |
Helper to itemChange. More... | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Handle item changes and change requests. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
Handle mouse press events for selections and highlighting. More... | |
Private Attributes | |
double | radius |
the radius of the object More... | |
WTransferFunctionPoint * | left |
pointer to point to the left More... | |
WTransferFunctionPoint * | right |
pointer to point to the right More... | |
WTransferFunctionLine * | line |
pointer to line to the right More... | |
WTransferFunctionWidget * | _parent |
reference to the parent widget More... | |
A control point for the alpha function.
Internals: The point has pointers to its left and right neighbors (double-linked list) and a pointer to the line connecting this point to the next point to the right.
Definition at line 40 of file WTransferFunctionPoint.h.
type of the base class
Definition at line 44 of file WTransferFunctionPoint.h.
|
explicit |
Default constructor.
parent | pointer to parent widget |
Definition at line 35 of file WTransferFunctionPoint.cpp.
|
virtual |
Default destructor.
Definition at line 45 of file WTransferFunctionPoint.cpp.
QRectF WTransferFunctionPoint::boundingRect | ( | ) | const |
Get the bounding rectangle.
Definition at line 80 of file WTransferFunctionPoint.cpp.
References radius.
|
protected |
Helper to itemChange.
pos | the position that is clamped between the left and right neighbors |
Definition at line 162 of file WTransferFunctionPoint.cpp.
Referenced by itemChange().
|
protected |
Helper to itemChange.
pos | position that is clamped to rectangle |
rectangle | the rectangle |
Definition at line 181 of file WTransferFunctionPoint.cpp.
Referenced by itemChange().
WTransferFunctionPoint * WTransferFunctionPoint::getLeft | ( | ) | const |
Get point to the left.
Definition at line 65 of file WTransferFunctionPoint.cpp.
References left.
Referenced by WTransferFunctionWidget::keyPressEvent().
WTransferFunctionLine * WTransferFunctionPoint::getLine | ( | ) | const |
The current line if there is one.
NULL if not.
Definition at line 54 of file WTransferFunctionPoint.cpp.
References line.
Referenced by WTransferFunctionWidget::clearTransferFunction(), WTransferFunctionWidget::insertPoint(), and WTransferFunctionWidget::keyPressEvent().
WTransferFunctionPoint * WTransferFunctionPoint::getRight | ( | ) | const |
Get point to the right.
Definition at line 75 of file WTransferFunctionPoint.cpp.
References right.
Referenced by WTransferFunctionWidget::clearTransferFunction(), WTransferFunctionWidget::findCPointOnLeft(), WTransferFunctionWidget::findPointOnLeft(), WTransferFunctionWidget::insertPoint(), WTransferFunctionWidget::keyPressEvent(), WTransferFunctionWidget::sample1DTransferFunction(), and WTransferFunctionWidget::updateTransferFunction().
|
protected |
Handle item changes and change requests.
change | the proposed change |
value | the proposed value |
Definition at line 110 of file WTransferFunctionPoint.cpp.
References _parent, clampToLeftAndRight(), clampToRectangle(), WTransferFunctionWidget::dataChanged(), left, and right.
|
protected |
Handle mouse press events for selections and highlighting.
event | the handled event |
Definition at line 154 of file WTransferFunctionPoint.cpp.
References _parent, and WTransferFunctionWidget::setCurrent().
|
virtual |
Paint the object.
painter | the painter to use |
option | the options for painting |
Definition at line 87 of file WTransferFunctionPoint.cpp.
References radius.
void WTransferFunctionPoint::setLeft | ( | WTransferFunctionPoint * | left | ) |
Set point to the left.
left | new point to the left |
Definition at line 60 of file WTransferFunctionPoint.cpp.
References left.
Referenced by WTransferFunctionWidget::insertPoint(), and WTransferFunctionWidget::keyPressEvent().
void WTransferFunctionPoint::setLine | ( | WTransferFunctionLine * | line | ) |
Set the line pointing to the right.
line | the new line |
Definition at line 49 of file WTransferFunctionPoint.cpp.
References line.
Referenced by WTransferFunctionWidget::insertPoint().
|
virtual |
Overloaded form base class for debugging.
point | the point that should be set |
Definition at line 201 of file WTransferFunctionPoint.cpp.
Referenced by WTransferFunctionWidget::insertPoint().
void WTransferFunctionPoint::setRight | ( | WTransferFunctionPoint * | right | ) |
Set point to the right.
right | new point to the right |
Definition at line 70 of file WTransferFunctionPoint.cpp.
References right.
Referenced by WTransferFunctionWidget::insertPoint(), and WTransferFunctionWidget::keyPressEvent().
|
private |
reference to the parent widget
Definition at line 167 of file WTransferFunctionPoint.h.
Referenced by itemChange(), and mousePressEvent().
|
private |
pointer to point to the left
Definition at line 159 of file WTransferFunctionPoint.h.
Referenced by clampToLeftAndRight(), getLeft(), itemChange(), and setLeft().
|
private |
pointer to line to the right
Definition at line 164 of file WTransferFunctionPoint.h.
|
private |
the radius of the object
Definition at line 156 of file WTransferFunctionPoint.h.
Referenced by boundingRect(), and paint().
|
private |
pointer to point to the right
Definition at line 161 of file WTransferFunctionPoint.h.
Referenced by clampToLeftAndRight(), getRight(), itemChange(), and setRight().