OpenWalnut
1.5.0dev
|
A control point for the color function. More...
#include <WTransferFunctionColorPoint.h>
Public Types | |
typedef QGraphicsObject | BaseClass |
type of our base class More... | |
Public Slots | |
void | colorSelected (const QColor &color) |
Called by the color dialog every time the user changes the color. More... | |
Public Member Functions | |
WTransferFunctionColorPoint (WTransferFunctionWidget *parent=0x0) | |
Default constructor. More... | |
virtual | ~WTransferFunctionColorPoint () |
Default destructor. More... | |
WTransferFunctionColorPoint * | getLeft () const |
Returns the item left of the this item. More... | |
WTransferFunctionColorPoint * | getRight () const |
Returns the item right of this item. More... | |
void | setLeft (WTransferFunctionColorPoint *left) |
Set the item left of us. More... | |
void | setRight (WTransferFunctionColorPoint *right) |
Set the item right of us. More... | |
QRectF | boundingRect () const |
The bounding rectangle used for paint and click events. More... | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0x0) |
Paint the handle and additional item hints. More... | |
QColor | getColor () const |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
Drag enter implementation for items that contain a color. More... | |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
Drop implementation for items that contain a color. More... | |
void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
Handler for context menu envents. More... | |
Protected Member Functions | |
void | clampToRectangle (const QRectF &rectangle) |
Helper for item changed. More... | |
void | clampToLeftAndRight () |
Helper for item changed. More... | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Handles change notifications. More... | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
Handles mouse move events. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
Handles press move events. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
Handles mouse move events. More... | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
Handles mouse double click events by opening a color selector if the item is clicked. More... | |
void | showColorPicker () |
Show the color picker dialog. More... | |
Private Attributes | |
double | radius |
the radius used for paining of the handle More... | |
WTransferFunctionColorPoint * | left |
the entry left of this entry More... | |
WTransferFunctionColorPoint * | right |
the entry to the right of our entry More... | |
WTransferFunctionWidget * | _parent |
the parent widget More... | |
QColor | color |
the color entry More... | |
A control point for the color function.
Internals: The point has links to its left and right neighbors (double-linked list).
Definition at line 41 of file WTransferFunctionColorPoint.h.
type of our base class
Definition at line 47 of file WTransferFunctionColorPoint.h.
|
explicit |
Default constructor.
parent | the parent widget |
Definition at line 38 of file WTransferFunctionColorPoint.cpp.
|
virtual |
Default destructor.
Definition at line 58 of file WTransferFunctionColorPoint.cpp.
QRectF WTransferFunctionColorPoint::boundingRect | ( | ) | const |
The bounding rectangle used for paint and click events.
Definition at line 82 of file WTransferFunctionColorPoint.cpp.
References radius.
|
protected |
Helper for item changed.
Definition at line 243 of file WTransferFunctionColorPoint.cpp.
Referenced by mouseMoveEvent().
|
protected |
Helper for item changed.
rectangle | a rectangle |
Definition at line 261 of file WTransferFunctionColorPoint.cpp.
Referenced by mouseMoveEvent().
|
slot |
Called by the color dialog every time the user changes the color.
color | the new color |
Definition at line 189 of file WTransferFunctionColorPoint.cpp.
References _parent, color, and WTransferFunctionWidget::dataChanged().
Referenced by WTransferFunctionWidget::insertColor(), and showColorPicker().
void WTransferFunctionColorPoint::contextMenuEvent | ( | QGraphicsSceneContextMenuEvent * | event | ) |
Handler for context menu envents.
Currently disabled because it conflicts with other mouse interactions.
event | the event to hanlde |
Definition at line 305 of file WTransferFunctionColorPoint.cpp.
References showColorPicker().
|
virtual |
Drag enter implementation for items that contain a color.
event | the event to handle |
Definition at line 285 of file WTransferFunctionColorPoint.cpp.
|
virtual |
Drop implementation for items that contain a color.
event | the event to handle |
Definition at line 293 of file WTransferFunctionColorPoint.cpp.
References _parent, color, and WTransferFunctionWidget::dataChanged().
QColor WTransferFunctionColorPoint::getColor | ( | ) | const |
Definition at line 280 of file WTransferFunctionColorPoint.cpp.
References color.
Referenced by WTransferFunctionWidget::insertColor(), WTransferFunctionWidget::sample1DTransferFunction(), WTransferFunctionWidget::sample1DTransferFunctionForDisplay(), and WTransferFunctionWidget::updateTransferFunction().
WTransferFunctionColorPoint * WTransferFunctionColorPoint::getLeft | ( | ) | const |
Returns the item left of the this item.
Definition at line 67 of file WTransferFunctionColorPoint.cpp.
References left.
Referenced by WTransferFunctionWidget::keyPressEvent().
WTransferFunctionColorPoint * WTransferFunctionColorPoint::getRight | ( | ) | const |
Returns the item right of this item.
Definition at line 77 of file WTransferFunctionColorPoint.cpp.
References right.
Referenced by WTransferFunctionWidget::clearTransferFunction(), WTransferFunctionWidget::insertColor(), WTransferFunctionWidget::keyPressEvent(), WTransferFunctionWidget::sample1DTransferFunction(), WTransferFunctionWidget::sample1DTransferFunctionForDisplay(), and WTransferFunctionWidget::updateTransferFunction().
|
protected |
Handles change notifications.
change | the requrested change |
value | the requested value |
Definition at line 140 of file WTransferFunctionColorPoint.cpp.
References _parent, color, and WTransferFunctionWidget::dataChanged().
|
protected |
Handles mouse double click events by opening a color selector if the item is clicked.
event | the event |
Definition at line 182 of file WTransferFunctionColorPoint.cpp.
References showColorPicker().
|
protected |
Handles mouse move events.
event | the event |
Definition at line 200 of file WTransferFunctionColorPoint.cpp.
References clampToLeftAndRight(), clampToRectangle(), left, and right.
|
protected |
Handles press move events.
event | the event |
Definition at line 230 of file WTransferFunctionColorPoint.cpp.
References _parent, and WTransferFunctionWidget::setCurrentColor().
|
protected |
Handles mouse move events.
event | the event |
Definition at line 237 of file WTransferFunctionColorPoint.cpp.
|
virtual |
void WTransferFunctionColorPoint::setLeft | ( | WTransferFunctionColorPoint * | left | ) |
Set the item left of us.
left | the item left of us |
Definition at line 62 of file WTransferFunctionColorPoint.cpp.
References left.
Referenced by WTransferFunctionWidget::insertColor(), and WTransferFunctionWidget::keyPressEvent().
void WTransferFunctionColorPoint::setRight | ( | WTransferFunctionColorPoint * | right | ) |
Set the item right of us.
right | the item right of us |
Definition at line 72 of file WTransferFunctionColorPoint.cpp.
References right.
Referenced by WTransferFunctionWidget::insertColor(), and WTransferFunctionWidget::keyPressEvent().
|
protected |
Show the color picker dialog.
Definition at line 330 of file WTransferFunctionColorPoint.cpp.
References color, and colorSelected().
Referenced by contextMenuEvent(), and mouseDoubleClickEvent().
|
private |
the parent widget
Definition at line 204 of file WTransferFunctionColorPoint.h.
Referenced by colorSelected(), dropEvent(), itemChange(), and mousePressEvent().
|
private |
the color entry
Definition at line 207 of file WTransferFunctionColorPoint.h.
Referenced by colorSelected(), dropEvent(), getColor(), itemChange(), paint(), and showColorPicker().
|
private |
the entry left of this entry
Definition at line 198 of file WTransferFunctionColorPoint.h.
Referenced by clampToLeftAndRight(), getLeft(), mouseMoveEvent(), paint(), and setLeft().
|
private |
the radius used for paining of the handle
Definition at line 195 of file WTransferFunctionColorPoint.h.
Referenced by boundingRect(), and paint().
|
private |
the entry to the right of our entry
Definition at line 201 of file WTransferFunctionColorPoint.h.
Referenced by clampToLeftAndRight(), getRight(), mouseMoveEvent(), paint(), and setRight().