#include <TransferPoint.hpp>
List of all members.
Detailed Description
Class which represents a point at the transfer function. Holds a color, alpha value and the position.
- Author:
- Christian Hirsch
-
Clemens Roegner
Constructor & Destructor Documentation
TransferPoint::TransferPoint |
( |
qreal |
relX, |
|
|
qreal |
relY |
|
) |
| |
Constructor. Creates a new point at the transfer function at the relative x and y position.
- Parameters:
-
relX | The relative x position. If position is 1.0 or 0.0 then the point can't be moved along the x axis. |
relY | The relative y position. Represents the alpha value of a point. |
Member Function Documentation
QRectF TransferPoint::boundingRect |
( |
) |
const |
Returns the bounding rectangle of the point.
- Returns:
- The bounding rectangle of the point.
QColor TransferPoint::getColor |
( |
) |
|
Getter for the color. return The representing color.
qreal TransferPoint::getRelativeX |
( |
) |
|
Getter for relative x position.
- Returns:
- Relative x position.
qreal TransferPoint::getRelativeY |
( |
) |
|
Getter for relative y position.
- Returns:
- Relative y position.
void TransferPoint::mouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event ) |
[protected] |
Handles the mouse move event. Moves a point on the transfer widget.
void TransferPoint::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event ) |
[protected] |
Handles the mouse press event. (Nothing is done, but mousemove event needs this).
- Parameters:
-
event | Pointer to the called event. |
void TransferPoint::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget = 0 |
|
) |
| |
Paints the point with a black bounding box, filled with its color, which is represented.
void TransferPoint::setColor |
( |
QColor |
_color = Qt::white ) |
|
Sets the representing color of the point.
- Parameters:
-
_color | New representing color. |
void TransferPoint::setColorFromDialog |
( |
) |
|
Opens a color-dialog, in which the user can decide which color to use.
void TransferPoint::setFixed |
( |
bool |
fixed ) |
|
Sets if a point is fixed (can't be moved along x axis) or not.
- Parameters:
-
fixed | If true, then the point is fixed. |
void TransferPoint::setRelativePos |
( |
qreal |
x, |
|
|
qreal |
y |
|
) |
| |
Setter for the relative x and y Position, where x = 1.0 is the right side, and y = 1.0 is at the top.
- Parameters:
-
x | New relative x position. |
y | New relative y position. |
void TransferPoint::updateScene |
( |
) |
|
Redraws the scene of the transfer widget.
The documentation for this class was generated from the following files:
- C:/Users/chrivieh/Desktop/My Dropbox/Studium/5. Semester/Visualisierung/Lab2/src/TransferPoint.hpp
- C:/Users/chrivieh/Desktop/My Dropbox/Studium/5. Semester/Visualisierung/Lab2/src/TransferPoint.cpp