Geometrize  1.0
An application for geometrizing images into geometric primitives
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< ImageTaskSceneImpld
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ImageTaskScene()

geometrize::scene::ImageTaskScene::ImageTaskScene ( QObject *  parent = nullptr)
explicit
84  : QGraphicsScene{parent}, d{std::make_unique<ImageTaskScene::ImageTaskSceneImpl>(this)}
85 {
86 }

◆ ~ImageTaskScene()

geometrize::scene::ImageTaskScene::~ImageTaskScene ( )
virtual
89 {
90 }

Member Function Documentation

◆ event()

bool geometrize::scene::ImageTaskScene::event ( QEvent *  event)
overrideprotected
118 {
119  // Handle custom tablet events forwarded from the ImageTaskGraphicsView
121  const auto ev = static_cast<geometrize::scene::CustomTabletEvent*>(event);
122  QList<QGraphicsItem*> itemsUnderEvent = items(QPointF(ev->getData().xScenePos, ev->getData().yScenePos), Qt::IntersectsItemBoundingRect);
123  for(const auto& item : itemsUnderEvent) {
124  sendEvent(item, ev);
125  }
126  return true;
127  }
128  return QGraphicsScene::event(event);
129 }
Here is the caller graph for this function:

◆ focusInEvent()

void geometrize::scene::ImageTaskScene::focusInEvent ( QFocusEvent *  event)
overrideprotected
162 {
163  QGraphicsScene::focusInEvent(event);
164 }
Here is the call graph for this function:

◆ focusOutEvent()

void geometrize::scene::ImageTaskScene::focusOutEvent ( QFocusEvent *  event)
overrideprotected
167 {
168  QGraphicsScene::focusOutEvent(event);
169 }
Here is the call graph for this function:

◆ getTargetPixmapItem()

ImageTaskPixmapGraphicsItem & geometrize::scene::ImageTaskScene::getTargetPixmapItem ( )

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

Returns
The target pixmap item.
103 {
104  return d->getTargetPixmapItem();
105 }
Here is the caller graph for this function:

◆ keyPressEvent()

void geometrize::scene::ImageTaskScene::keyPressEvent ( QKeyEvent *  event)
overrideprotected
152 {
153  QGraphicsScene::keyPressEvent(event);
154 }
Here is the call graph for this function:

◆ keyReleaseEvent()

void geometrize::scene::ImageTaskScene::keyReleaseEvent ( QKeyEvent *  event)
overrideprotected
157 {
158  QGraphicsScene::keyReleaseEvent(event);
159 }
Here is the call graph for this function:

◆ mouseMoveEvent()

void geometrize::scene::ImageTaskScene::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected
137 {
138  QGraphicsScene::mouseMoveEvent(event);
139 }
Here is the call graph for this function:

◆ mousePressEvent()

void geometrize::scene::ImageTaskScene::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected
132 {
133  QGraphicsScene::mousePressEvent(event);
134 }
Here is the call graph for this function:

◆ mouseReleaseEvent()

void geometrize::scene::ImageTaskScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected
142 {
143  QGraphicsScene::mouseReleaseEvent(event);
144 }
Here is the call graph for this function:

◆ setOverlayShape()

void geometrize::scene::ImageTaskScene::setOverlayShape ( SvgItem item)

setOverlayItem Sets the given overlay shape upon the scene.

Parameters
itemThe item to add.
108 {
109  d->setOverlayShape(item);
110 }
Here is the caller graph for this function:

◆ setOverlayShapeVisibility()

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
113 {
114  d->setOverlayShapeVisibility(visible);
115 }

◆ setTargetPixmap()

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.
98 {
99  d->setTargetPixmap(pixmap);
100 }
Here is the caller graph for this function:

◆ setTargetPixmapOpacity()

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

setTargetPixmapOpacity Sets the opacity of the target pixmap.

Parameters
opacityThe opacity value.
93 {
94  d->setTargetPixmapOpacity(opacity);
95 }
Here is the caller graph for this function:

◆ wheelEvent()

void geometrize::scene::ImageTaskScene::wheelEvent ( QGraphicsSceneWheelEvent *  event)
overrideprotected
147 {
148  QGraphicsScene::wheelEvent(event);
149 }
Here is the call graph for this function:

Member Data Documentation

◆ d

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

The documentation for this class was generated from the following files:
geometrize::scene::CustomTabletEvent::customEventId
static const int customEventId
CustomTabletEventTypeId is the id for the corresponding custom tablet event type.
Definition: customtabletevent.h:93
geometrize::scene::CustomTabletEvent
The CustomTabletEvent class represents a tablet event (specifically from a Wacom Pro pen) that can be...
Definition: customtabletevent.h:88
geometrize::scene::ImageTaskScene::event
bool event(QEvent *event) override
Definition: imagetaskscene.cpp:117
geometrize::scene::ImageTaskScene::d
std::unique_ptr< ImageTaskSceneImpl > d
Definition: imagetaskscene.h:74