OpenWalnut  1.5.0dev
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
WTransferFunctionColorPoint Class Reference

A control point for the color function. More...

#include <WTransferFunctionColorPoint.h>

+ Inheritance diagram for WTransferFunctionColorPoint:
+ Collaboration diagram for WTransferFunctionColorPoint:

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...
 
WTransferFunctionColorPointgetLeft () const
 Returns the item left of the this item. More...
 
WTransferFunctionColorPointgetRight () 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...
 
WTransferFunctionColorPointleft
 the entry left of this entry More...
 
WTransferFunctionColorPointright
 the entry to the right of our entry More...
 
WTransferFunctionWidget_parent
 the parent widget More...
 
QColor color
 the color entry More...
 

Detailed Description

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.

Member Typedef Documentation

◆ BaseClass

type of our base class

Definition at line 47 of file WTransferFunctionColorPoint.h.

Constructor & Destructor Documentation

◆ WTransferFunctionColorPoint()

WTransferFunctionColorPoint::WTransferFunctionColorPoint ( WTransferFunctionWidget parent = 0x0)
explicit

Default constructor.

Parameters
parentthe parent widget

Definition at line 38 of file WTransferFunctionColorPoint.cpp.

◆ ~WTransferFunctionColorPoint()

WTransferFunctionColorPoint::~WTransferFunctionColorPoint ( )
virtual

Default destructor.

Definition at line 58 of file WTransferFunctionColorPoint.cpp.

Member Function Documentation

◆ boundingRect()

QRectF WTransferFunctionColorPoint::boundingRect ( ) const

The bounding rectangle used for paint and click events.

Returns
the bounding rectangle

Definition at line 82 of file WTransferFunctionColorPoint.cpp.

References radius.

◆ clampToLeftAndRight()

void WTransferFunctionColorPoint::clampToLeftAndRight ( )
protected

Helper for item changed.

Definition at line 243 of file WTransferFunctionColorPoint.cpp.

References left, and right.

Referenced by mouseMoveEvent().

+ Here is the caller graph for this function:

◆ clampToRectangle()

void WTransferFunctionColorPoint::clampToRectangle ( const QRectF &  rectangle)
protected

Helper for item changed.

Parameters
rectanglea rectangle

Definition at line 261 of file WTransferFunctionColorPoint.cpp.

Referenced by mouseMoveEvent().

+ Here is the caller graph for this function:

◆ colorSelected

void WTransferFunctionColorPoint::colorSelected ( const QColor &  color)
slot

Called by the color dialog every time the user changes the color.

Parameters
colorthe new color

Definition at line 189 of file WTransferFunctionColorPoint.cpp.

References _parent, color, and WTransferFunctionWidget::dataChanged().

Referenced by WTransferFunctionWidget::insertColor(), and showColorPicker().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contextMenuEvent()

void WTransferFunctionColorPoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)

Handler for context menu envents.

Currently disabled because it conflicts with other mouse interactions.

Parameters
eventthe event to hanlde

Definition at line 305 of file WTransferFunctionColorPoint.cpp.

References showColorPicker().

+ Here is the call graph for this function:

◆ dragEnterEvent()

void WTransferFunctionColorPoint::dragEnterEvent ( QGraphicsSceneDragDropEvent *  event)
virtual

Drag enter implementation for items that contain a color.

Parameters
eventthe event to handle

Definition at line 285 of file WTransferFunctionColorPoint.cpp.

◆ dropEvent()

void WTransferFunctionColorPoint::dropEvent ( QGraphicsSceneDragDropEvent *  event)
virtual

Drop implementation for items that contain a color.

Parameters
eventthe event to handle

Definition at line 293 of file WTransferFunctionColorPoint.cpp.

References _parent, color, and WTransferFunctionWidget::dataChanged().

+ Here is the call graph for this function:

◆ getColor()

QColor WTransferFunctionColorPoint::getColor ( ) const

◆ getLeft()

WTransferFunctionColorPoint * WTransferFunctionColorPoint::getLeft ( ) const

Returns the item left of the this item.

Returns
the item left of us

Definition at line 67 of file WTransferFunctionColorPoint.cpp.

References left.

Referenced by WTransferFunctionWidget::keyPressEvent().

+ Here is the caller graph for this function:

◆ getRight()

WTransferFunctionColorPoint * WTransferFunctionColorPoint::getRight ( ) const

◆ itemChange()

QVariant WTransferFunctionColorPoint::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protected

Handles change notifications.

Parameters
changethe requrested change
valuethe requested value
Returns
the proposed value

Definition at line 140 of file WTransferFunctionColorPoint.cpp.

References _parent, color, and WTransferFunctionWidget::dataChanged().

+ Here is the call graph for this function:

◆ mouseDoubleClickEvent()

void WTransferFunctionColorPoint::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handles mouse double click events by opening a color selector if the item is clicked.

Parameters
eventthe event

Definition at line 182 of file WTransferFunctionColorPoint.cpp.

References showColorPicker().

+ Here is the call graph for this function:

◆ mouseMoveEvent()

void WTransferFunctionColorPoint::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handles mouse move events.

Parameters
eventthe event

Definition at line 200 of file WTransferFunctionColorPoint.cpp.

References clampToLeftAndRight(), clampToRectangle(), left, and right.

+ Here is the call graph for this function:

◆ mousePressEvent()

void WTransferFunctionColorPoint::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handles press move events.

Parameters
eventthe event

Definition at line 230 of file WTransferFunctionColorPoint.cpp.

References _parent, and WTransferFunctionWidget::setCurrentColor().

+ Here is the call graph for this function:

◆ mouseReleaseEvent()

void WTransferFunctionColorPoint::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handles mouse move events.

Parameters
eventthe event

Definition at line 237 of file WTransferFunctionColorPoint.cpp.

◆ paint()

void WTransferFunctionColorPoint::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0x0 
)
virtual

Paint the handle and additional item hints.

Parameters
painterthe painter used
optionthe paint options used
widgetthe widget used for painting

Definition at line 89 of file WTransferFunctionColorPoint.cpp.

References color, left, radius, and right.

◆ setLeft()

void WTransferFunctionColorPoint::setLeft ( WTransferFunctionColorPoint left)

Set the item left of us.

Parameters
leftthe item left of us

Definition at line 62 of file WTransferFunctionColorPoint.cpp.

References left.

Referenced by WTransferFunctionWidget::insertColor(), and WTransferFunctionWidget::keyPressEvent().

+ Here is the caller graph for this function:

◆ setRight()

void WTransferFunctionColorPoint::setRight ( WTransferFunctionColorPoint right)

Set the item right of us.

Parameters
rightthe item right of us

Definition at line 72 of file WTransferFunctionColorPoint.cpp.

References right.

Referenced by WTransferFunctionWidget::insertColor(), and WTransferFunctionWidget::keyPressEvent().

+ Here is the caller graph for this function:

◆ showColorPicker()

void WTransferFunctionColorPoint::showColorPicker ( )
protected

Show the color picker dialog.

Definition at line 330 of file WTransferFunctionColorPoint.cpp.

References color, and colorSelected().

Referenced by contextMenuEvent(), and mouseDoubleClickEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _parent

WTransferFunctionWidget* WTransferFunctionColorPoint::_parent
private

the parent widget

Definition at line 204 of file WTransferFunctionColorPoint.h.

Referenced by colorSelected(), dropEvent(), itemChange(), and mousePressEvent().

◆ color

QColor WTransferFunctionColorPoint::color
private

the color entry

Definition at line 207 of file WTransferFunctionColorPoint.h.

Referenced by colorSelected(), dropEvent(), getColor(), itemChange(), paint(), and showColorPicker().

◆ left

WTransferFunctionColorPoint* WTransferFunctionColorPoint::left
private

the entry left of this entry

Definition at line 198 of file WTransferFunctionColorPoint.h.

Referenced by clampToLeftAndRight(), getLeft(), mouseMoveEvent(), paint(), and setLeft().

◆ radius

double WTransferFunctionColorPoint::radius
private

the radius used for paining of the handle

Definition at line 195 of file WTransferFunctionColorPoint.h.

Referenced by boundingRect(), and paint().

◆ right

WTransferFunctionColorPoint* WTransferFunctionColorPoint::right
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().


The documentation for this class was generated from the following files: