|
enum | ItemType {
TFEditorUnknownPrimitiveType = 30,
TFEditorControlPointType,
TFControlPointConnectionType,
TFEditorIsovalueType,
Number_of_InviwoWidgetGraphicsItemTypes
} |
|
|
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget) override |
|
virtual QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
|
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) override |
|
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override |
|
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override |
|
virtual void | paintPrimitive (QPainter *painter)=0 |
|
virtual QPointF | prepareItemPositionChange (const QPointF &pos) |
|
virtual void | onItemPositionChange (const vec2 &) |
|
virtual void | onItemSceneHasChanged () |
|
void | forEachObserver (C callback) |
|
void | addObservationHelper (Observer *observer) |
|
void | removeObservationHelper (Observer *observer) |
|
|
int | defaultZValue_ = 10 |
|
double | size_ |
|
bool | isEditingPoint_ |
|
QPointF | currentPos_ |
| position within scene rect (not normalized)
|
|
bool | hovered_ |
|
TFPrimitive & | data_ |
|
◆ TFEditorPrimitive()
inviwo::TFEditorPrimitive::TFEditorPrimitive |
( |
TFPrimitive & |
primitive, |
|
|
QGraphicsScene * |
scene = nullptr , |
|
|
const vec2 & |
pos = vec2() , |
|
|
double |
size = 14.0 |
|
) |
| |
Constructs a TransferFunction editor primitive. The graphics item is positioned at the primitive location (scalar value and opacity) within the scene. The graphical representation should thus be centered around (0,0) in local coordinates.
- Parameters
-
primitive | pointer to the primitive |
scene | item will be added to this QGraphicsScene |
pos | normalized position of primitive (scalar value and opacity) |
size | base size of primitive |
◆ onItemPositionChange()
virtual void inviwo::TFEditorPrimitive::onItemPositionChange |
( |
const vec2 & |
| ) |
|
|
inlineprotectedvirtual |
gets called in itemChange() after a position change of the item. The position is already adjusted to lie within the scene bounding box and normalized.
- Parameters
-
newPos | new, normalized position of the primitive |
◆ onItemSceneHasChanged()
virtual void inviwo::TFEditorPrimitive::onItemSceneHasChanged |
( |
| ) |
|
|
inlineprotectedvirtual |
gets called in itemChange() when a scene change has happend
◆ paint()
void inviwo::TFEditorPrimitive::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
options, |
|
|
QWidget * |
widget |
|
) |
| |
|
overrideprotectedvirtual |
paints the primitive and the label if visible. Pen and brush are set up prior calling paintPrimitive() reflecting primitive color and selection.
◆ paintPrimitive()
virtual void inviwo::TFEditorPrimitive::paintPrimitive |
( |
QPainter * |
painter | ) |
|
|
protectedpure virtual |
draws the primitive. Gets called from within paint()
- Parameters
-
painter | painter for drawing the object, pen and brush are set up to match primitive color and selection status |
◆ prepareItemPositionChange()
virtual QPointF inviwo::TFEditorPrimitive::prepareItemPositionChange |
( |
const QPointF & |
pos | ) |
|
|
inlineprotectedvirtual |
Allows to adjust the position prior updating the graphicsitem position, e.g. when the movement of a TF point is restricted ("restrict" or "push"). This function is called in itemChange() before calling onItemPositionChange.
- Parameters
-
pos | candidate for new position (in scene coords) |
- Returns
- modified position which is used instead of pos
◆ setTFPosition()
void inviwo::TFEditorPrimitive::setTFPosition |
( |
const dvec2 & |
tfpos | ) |
|
set the position of the primitive using normalized coordinates within the transfer function.
- Parameters
-
tfpos | normalized position [0,1] corresponding to scalar value and opacity |
The documentation for this class was generated from the following files:
- tfeditorprimitive.h
- tfeditorprimitive.cpp