Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
geometrize::scene::ImageTaskScene Class Reference

The ImageTaskScene class models a graphics scene for viewing the results of image tasks. More...

#include <imagetaskscene.h>

Inheritance diagram for geometrize::scene::ImageTaskScene:
Inheritance graph
[legend]
Collaboration diagram for geometrize::scene::ImageTaskScene:
Collaboration graph
[legend]

Classes

class  ImageTaskSceneImpl
 

Public Member Functions

 ImageTaskScene (QObject *parent=nullptr)
 
virtual ~ImageTaskScene ()
 
void setTargetPixmapOpacity (float opacity)
 setTargetPixmapOpacity Sets the opacity of the target pixmap. More...
 
void setTargetPixmap (const QPixmap &pixmap)
 setTargetPixmap Sets the pixmap that provides the target/goal image visualization. More...
 
ImageTaskPixmapGraphicsItemgetTargetPixmapItem ()
 getTargetPixmapItem Gets a refernece to the graphics item that houses the target pixmap. More...
 
void setOverlayShape (SvgItem *item)
 setOverlayItem Sets the given overlay shape upon the scene. More...
 
void setOverlayShapeVisibility (bool visible)
 setOverlayShapeVisibility Whether the overlay shape(s) in the scene should be visible. More...
 

Protected Member Functions

bool event (QEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
void wheelEvent (QGraphicsSceneWheelEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void keyReleaseEvent (QKeyEvent *event) override
 
void focusInEvent (QFocusEvent *event) override
 
void focusOutEvent (QFocusEvent *event) override
 

Private Attributes

std::unique_ptr
< ImageTaskSceneImpl
d
 

Detailed Description

The ImageTaskScene class models a graphics scene for viewing the results of image tasks.

Constructor & Destructor Documentation

geometrize::scene::ImageTaskScene::ImageTaskScene ( QObject *  parent = nullptr)
explicit
83  : QGraphicsScene{parent}, d{std::make_unique<ImageTaskScene::ImageTaskSceneImpl>(this)}
84 {
85 }
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74
geometrize::scene::ImageTaskScene::~ImageTaskScene ( )
virtual
88 {
89 }

Member Function Documentation

bool geometrize::scene::ImageTaskScene::event ( QEvent *  event)
overrideprotected
117 {
118  // Handle custom tablet events forwarded from the ImageTaskGraphicsView
120  const auto ev = static_cast<geometrize::scene::CustomTabletEvent*>(event);
121  QList<QGraphicsItem*> itemsUnderEvent = items(QPointF(ev->getData().xScenePos, ev->getData().yScenePos), Qt::IntersectsItemBoundingRect);
122  for(const auto& item : itemsUnderEvent) {
123  sendEvent(item, ev);
124  }
125  return true;
126  }
127  return QGraphicsScene::event(event);
128 }
The CustomTabletEvent class represents a tablet event (specifically from a Wacom Pro pen) that can be...
Definition: customtabletevent.h:87
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
static const int customEventId
CustomTabletEventTypeId is the id for the corresponding custom tablet event type. ...
Definition: customtabletevent.h:93
void geometrize::scene::ImageTaskScene::focusInEvent ( QFocusEvent *  event)
overrideprotected
161 {
162  QGraphicsScene::focusInEvent(event);
163 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
void geometrize::scene::ImageTaskScene::focusOutEvent ( QFocusEvent *  event)
overrideprotected
166 {
167  QGraphicsScene::focusOutEvent(event);
168 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
ImageTaskPixmapGraphicsItem & geometrize::scene::ImageTaskScene::getTargetPixmapItem ( )

getTargetPixmapItem Gets a refernece to the graphics item that houses the target pixmap.

Returns
The target pixmap item.
102 {
103  return d->getTargetPixmapItem();
104 }
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74

Here is the caller graph for this function:

void geometrize::scene::ImageTaskScene::keyPressEvent ( QKeyEvent *  event)
overrideprotected
151 {
152  QGraphicsScene::keyPressEvent(event);
153 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
void geometrize::scene::ImageTaskScene::keyReleaseEvent ( QKeyEvent *  event)
overrideprotected
156 {
157  QGraphicsScene::keyReleaseEvent(event);
158 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
void geometrize::scene::ImageTaskScene::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected
136 {
137  QGraphicsScene::mouseMoveEvent(event);
138 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
void geometrize::scene::ImageTaskScene::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected
131 {
132  QGraphicsScene::mousePressEvent(event);
133 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
void geometrize::scene::ImageTaskScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected
141 {
142  QGraphicsScene::mouseReleaseEvent(event);
143 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116
void geometrize::scene::ImageTaskScene::setOverlayShape ( SvgItem item)

setOverlayItem Sets the given overlay shape upon the scene.

Parameters
itemThe item to add.
107 {
108  d->setOverlayShape(item);
109 }
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74

Here is the caller graph for this function:

void geometrize::scene::ImageTaskScene::setOverlayShapeVisibility ( bool  visible)

setOverlayShapeVisibility Whether the overlay shape(s) in the scene should be visible.

Parameters
visibleTrue if visible, false for invisible
112 {
113  d->setOverlayShapeVisibility(visible);
114 }
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74
void geometrize::scene::ImageTaskScene::setTargetPixmap ( const QPixmap &  pixmap)

setTargetPixmap Sets the pixmap that provides the target/goal image visualization.

Parameters
pixmapThe pixmap to set as the target/goal image visualization.
97 {
98  d->setTargetPixmap(pixmap);
99 }
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74

Here is the caller graph for this function:

void geometrize::scene::ImageTaskScene::setTargetPixmapOpacity ( float  opacity)

setTargetPixmapOpacity Sets the opacity of the target pixmap.

Parameters
opacityThe opacity value.
92 {
93  d->setTargetPixmapOpacity(opacity);
94 }
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74

Here is the caller graph for this function:

void geometrize::scene::ImageTaskScene::wheelEvent ( QGraphicsSceneWheelEvent *  event)
overrideprotected
146 {
147  QGraphicsScene::wheelEvent(event);
148 }
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:116

Member Data Documentation

std::unique_ptr<ImageTaskSceneImpl> geometrize::scene::ImageTaskScene::d
private

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