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

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

#include <WTransferFunctionPoint.h>

+ Inheritance diagram for WTransferFunctionPoint:
+ Collaboration diagram for WTransferFunctionPoint:

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...
 
WTransferFunctionPointgetLeft () const
 Get point to the left. More...
 
void setRight (WTransferFunctionPoint *right)
 Set point to the right. More...
 
WTransferFunctionPointgetRight () const
 Get point to the right. More...
 
void setLine (WTransferFunctionLine *line)
 Set the line pointing to the right. More...
 
WTransferFunctionLinegetLine () 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...
 
WTransferFunctionPointleft
 pointer to point to the left More...
 
WTransferFunctionPointright
 pointer to point to the right More...
 
WTransferFunctionLineline
 pointer to line to the right More...
 
WTransferFunctionWidget_parent
 reference to the parent widget More...
 

Detailed Description

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.

Member Typedef Documentation

◆ BaseClass

type of the base class

Definition at line 44 of file WTransferFunctionPoint.h.

Constructor & Destructor Documentation

◆ WTransferFunctionPoint()

WTransferFunctionPoint::WTransferFunctionPoint ( WTransferFunctionWidget parent = NULL)
explicit

Default constructor.

Parameters
parentpointer to parent widget

Definition at line 35 of file WTransferFunctionPoint.cpp.

◆ ~WTransferFunctionPoint()

WTransferFunctionPoint::~WTransferFunctionPoint ( )
virtual

Default destructor.

Definition at line 45 of file WTransferFunctionPoint.cpp.

Member Function Documentation

◆ boundingRect()

QRectF WTransferFunctionPoint::boundingRect ( ) const

Get the bounding rectangle.

Returns
the bounding rect of this object

Definition at line 80 of file WTransferFunctionPoint.cpp.

References radius.

◆ clampToLeftAndRight()

void WTransferFunctionPoint::clampToLeftAndRight ( QPointF *const  pos) const
protected

Helper to itemChange.

Parameters
posthe position that is clamped between the left and right neighbors

Definition at line 162 of file WTransferFunctionPoint.cpp.

References left, and right.

Referenced by itemChange().

+ Here is the caller graph for this function:

◆ clampToRectangle()

void WTransferFunctionPoint::clampToRectangle ( QPointF *const  pos,
const QRectF &  rectangle 
) const
protected

Helper to itemChange.

Parameters
posposition that is clamped to rectangle
rectanglethe rectangle

Definition at line 181 of file WTransferFunctionPoint.cpp.

Referenced by itemChange().

+ Here is the caller graph for this function:

◆ getLeft()

WTransferFunctionPoint * WTransferFunctionPoint::getLeft ( ) const

Get point to the left.

Returns
point to the left

Definition at line 65 of file WTransferFunctionPoint.cpp.

References left.

Referenced by WTransferFunctionWidget::keyPressEvent().

+ Here is the caller graph for this function:

◆ getLine()

WTransferFunctionLine * WTransferFunctionPoint::getLine ( ) const

The current line if there is one.

NULL if not.

Returns
the line if any has been set (i.e., may be 0)

Definition at line 54 of file WTransferFunctionPoint.cpp.

References line.

Referenced by WTransferFunctionWidget::clearTransferFunction(), WTransferFunctionWidget::insertPoint(), and WTransferFunctionWidget::keyPressEvent().

+ Here is the caller graph for this function:

◆ getRight()

WTransferFunctionPoint * WTransferFunctionPoint::getRight ( ) const

◆ itemChange()

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

Handle item changes and change requests.

Parameters
changethe proposed change
valuethe proposed value
Returns
the requested change

Definition at line 110 of file WTransferFunctionPoint.cpp.

References _parent, clampToLeftAndRight(), clampToRectangle(), WTransferFunctionWidget::dataChanged(), left, and right.

+ Here is the call graph for this function:

◆ mousePressEvent()

void WTransferFunctionPoint::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Handle mouse press events for selections and highlighting.

Parameters
eventthe handled event

Definition at line 154 of file WTransferFunctionPoint.cpp.

References _parent, and WTransferFunctionWidget::setCurrent().

+ Here is the call graph for this function:

◆ paint()

void WTransferFunctionPoint::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *   
)
virtual

Paint the object.

Parameters
painterthe painter to use
optionthe options for painting

Definition at line 87 of file WTransferFunctionPoint.cpp.

References radius.

◆ setLeft()

void WTransferFunctionPoint::setLeft ( WTransferFunctionPoint left)

Set point to the left.

Parameters
leftnew point to the left

Definition at line 60 of file WTransferFunctionPoint.cpp.

References left.

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

+ Here is the caller graph for this function:

◆ setLine()

void WTransferFunctionPoint::setLine ( WTransferFunctionLine line)

Set the line pointing to the right.

Parameters
linethe new line

Definition at line 49 of file WTransferFunctionPoint.cpp.

References line.

Referenced by WTransferFunctionWidget::insertPoint().

+ Here is the caller graph for this function:

◆ setPos()

void WTransferFunctionPoint::setPos ( QPointF  point)
virtual

Overloaded form base class for debugging.

Parameters
pointthe point that should be set

Definition at line 201 of file WTransferFunctionPoint.cpp.

Referenced by WTransferFunctionWidget::insertPoint().

+ Here is the caller graph for this function:

◆ setRight()

void WTransferFunctionPoint::setRight ( WTransferFunctionPoint right)

Set point to the right.

Parameters
rightnew point to the right

Definition at line 70 of file WTransferFunctionPoint.cpp.

References right.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ _parent

WTransferFunctionWidget* WTransferFunctionPoint::_parent
private

reference to the parent widget

Definition at line 167 of file WTransferFunctionPoint.h.

Referenced by itemChange(), and mousePressEvent().

◆ left

WTransferFunctionPoint* WTransferFunctionPoint::left
private

pointer to point to the left

Definition at line 159 of file WTransferFunctionPoint.h.

Referenced by clampToLeftAndRight(), getLeft(), itemChange(), and setLeft().

◆ line

WTransferFunctionLine* WTransferFunctionPoint::line
private

pointer to line to the right

Definition at line 164 of file WTransferFunctionPoint.h.

Referenced by getLine(), and setLine().

◆ radius

double WTransferFunctionPoint::radius
private

the radius of the object

Definition at line 156 of file WTransferFunctionPoint.h.

Referenced by boundingRect(), and paint().

◆ right

WTransferFunctionPoint* WTransferFunctionPoint::right
private

pointer to point to the right

Definition at line 161 of file WTransferFunctionPoint.h.

Referenced by clampToLeftAndRight(), getRight(), itemChange(), and setRight().


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