Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl Class Reference
Collaboration diagram for geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl:
Collaboration graph
[legend]

Public Member Functions

 ImageTaskSceneManagerImpl (ImageTaskSceneManager *pQ)
 
ImageTaskSceneManagerImpl operator= (const ImageTaskSceneManagerImpl &)=delete
 
 ImageTaskSceneManagerImpl (const ImageTaskSceneManagerImpl &)=delete
 
 ~ImageTaskSceneManagerImpl ()=default
 
void setViews (ImageTaskGraphicsView &pixmapView, ImageTaskGraphicsView &svgView)
 
void setTargetPixmap (const QPixmap &pixmap)
 
void setTargetPixmapOpacity (const float opacity)
 
void updateScenes (const QPixmap &pixmap, const std::vector< geometrize::ShapeResult > &shapes)
 
void reset ()
 
void fitPixmapSceneInView (ImageTaskGraphicsView &pixmapView)
 
void fitVectorSceneInView (ImageTaskGraphicsView &svgView)
 
void fitScenesInViews (ImageTaskGraphicsView &pixmapView, ImageTaskGraphicsView &svgView)
 
void setAreaOfInfluenceShape (const geometrize::Shape &shape)
 

Private Member Functions

void connectTargetItemSignals (geometrize::scene::ImageTaskPixmapGraphicsItem &item)
 

Private Attributes

geometrize::scene::ImageTaskPixmapScene m_pixmapScene
 
geometrize::scene::ImageTaskSvgScene m_svgScene
 

The scene containing the raster/pixel-based representation of the shapes

More...
 
ImageTaskSceneManagerq
 

The scene containing the vector-based representation of the shapes

More...
 
const double m_defaultViewMargins {20.0}
 

Constructor & Destructor Documentation

geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::ImageTaskSceneManagerImpl ( ImageTaskSceneManager pQ)
inline
29  : q{pQ}
30  {
33  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
ImageTaskPixmapGraphicsItem & getTargetPixmapItem()
getTargetPixmapItem Gets a refernece to the graphics item that houses the target pixmap.
Definition: imagetaskscene.cpp:101
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137
ImageTaskSceneManager * q
The scene containing the vector-based representation of the shapes
Definition: imagetaskscenemanager.cpp:140
void connectTargetItemSignals(geometrize::scene::ImageTaskPixmapGraphicsItem &item)
Definition: imagetaskscenemanager.cpp:109
geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::ImageTaskSceneManagerImpl ( const ImageTaskSceneManagerImpl )
delete
geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::~ImageTaskSceneManagerImpl ( )
default

Member Function Documentation

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::connectTargetItemSignals ( geometrize::scene::ImageTaskPixmapGraphicsItem item)
inlineprivate
110  {
113  });
114  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onHoverMoveEvent, [this](const double lastX, const double lastY, const double x, const double y, const bool ctrlModifier) {
115  q->signal_onTargetImageHoverMoveEvent(lastX, lastY, x, y, ctrlModifier);
116  });
117  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onMouseMoveEvent, [this](const double lastX, const double lastY, const double x, const double y, const bool ctrlModifier) {
118  q->signal_onTargetImageMouseMoveEvent(lastX, lastY, x, y, ctrlModifier);
119  });
120  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onMousePressEvent, [this](const double x, const double y, const bool ctrlModifier) {
121  q->signal_onTargetImageMousePressEvent(x, y, ctrlModifier);
122  });
123  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onMouseReleaseEvent, [this](const double x, const double y, const bool ctrlModifier) {
124  q->signal_onTargetImageMouseReleaseEvent(x, y, ctrlModifier);
125  });
126  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onWheelEvent, [this](const double x, const double y, const int amount, const bool ctrlModifier) {
127  q->signal_onTargetImageWheelEvent(x, y, amount, ctrlModifier);
128  });
129  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onKeyPressEvent, [this](const int key, const bool ctrlModifier) {
130  q->signal_onTargetImageKeyPressEvent(key, ctrlModifier);
131  });
132  connect(&item, &geometrize::scene::ImageTaskPixmapGraphicsItem::signal_onKeyReleaseEvent, [this](const int key, const bool ctrlModifier) {
133  q->signal_onTargetImageKeyReleaseEvent(key, ctrlModifier);
134  });
135  }
void signal_onMousePressEvent(double x, double y, bool ctrlModifier)
void signal_onWheelEvent(double x, double y, int amount, bool ctrlModifier)
void signal_onTargetImageHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void signal_onKeyReleaseEvent(int key, bool ctrlModifier)
void signal_onCustomTabletEvent(const geometrize::scene::CustomTabletEvent &event)
The CustomTabletEvent class represents a tablet event (specifically from a Wacom Pro pen) that can be...
Definition: customtabletevent.h:87
void signal_onTargetImageMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void signal_onTargetImageMousePressEvent(double x, double y, bool ctrlModifier)
void signal_onKeyPressEvent(int key, bool ctrlModifier)
void signal_onTargetImageMouseReleaseEvent(double x, double y, bool ctrlModifier)
ImageTaskSceneManager * q
The scene containing the vector-based representation of the shapes
Definition: imagetaskscenemanager.cpp:140
void signal_onMouseReleaseEvent(double x, double y, bool ctrlModifier)
void signal_onTargetImageWheelEvent(double x, double y, int amount, bool ctrlModifier)
void signal_onTargetImageKeyReleaseEvent(int key, bool ctrlModifier)
void signal_onTargetImageKeyPressEvent(int key, bool ctrlModifier)
void signal_onHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void signal_onMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void signal_onTargetImageTabletEvent(const geometrize::scene::CustomTabletEvent &event)
void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::fitPixmapSceneInView ( ImageTaskGraphicsView pixmapView)
inline
68  {
69  const double margin{m_defaultViewMargins};
70  const QRectF imageViewRect{m_pixmapScene.itemsBoundingRect().adjusted(-margin, -margin, margin, margin)};
71  pixmapView.fitInView(imageViewRect, Qt::KeepAspectRatio);
72  }
const double m_defaultViewMargins
Definition: imagetaskscenemanager.cpp:142
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137

Here is the caller graph for this function:

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::fitScenesInViews ( ImageTaskGraphicsView pixmapView,
ImageTaskGraphicsView svgView 
)
inline
82  {
83  fitPixmapSceneInView(pixmapView);
84  fitVectorSceneInView(svgView);
85  }
void fitPixmapSceneInView(ImageTaskGraphicsView &pixmapView)
Definition: imagetaskscenemanager.cpp:67
void fitVectorSceneInView(ImageTaskGraphicsView &svgView)
Definition: imagetaskscenemanager.cpp:74

Here is the call graph for this function:

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::fitVectorSceneInView ( ImageTaskGraphicsView svgView)
inline
75  {
76  const double margin{m_defaultViewMargins};
77  const QRectF svgRect{m_svgScene.itemsBoundingRect().adjusted(-margin, -margin, margin, margin)};
78  svgView.fitInView(svgRect, Qt::KeepAspectRatio);
79  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
const double m_defaultViewMargins
Definition: imagetaskscenemanager.cpp:142

Here is the caller graph for this function:

ImageTaskSceneManagerImpl geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::operator= ( const ImageTaskSceneManagerImpl )
delete
void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::reset ( )
inline
63  {
65  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
void removeShapes()
removeShapes Removes all shapes from the scene.
Definition: imagetasksvgscene.cpp:73

Here is the call graph for this function:

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::setAreaOfInfluenceShape ( const geometrize::Shape &  shape)
inline
88  {
89  const std::uint32_t width = static_cast<std::uint32_t>(m_pixmapScene.getTargetPixmapItem().pixmap().width());
90  const std::uint32_t height = static_cast<std::uint32_t>(m_pixmapScene.getTargetPixmapItem().pixmap().height());
91 
92  const QString svgString{QString::fromStdString(
93  geometrize::exporter::exportSingleShapeSVG(geometrize::rgba{32, 32, 128, 128}, shape, width, height)
94  )};
95  const QByteArray svgData{svgString.toUtf8()};
96 
97  const auto makeItem = [](const QByteArray& data) -> AreaOfInfluenceShapeItem* {
98  return new AreaOfInfluenceShapeItem(data);
99  };
100 
101  auto pixmapInfluenceItem = makeItem(svgData);
102  auto svgInfluenceItem = makeItem(svgData);
103 
104  m_pixmapScene.setOverlayShape(pixmapInfluenceItem);
105  m_svgScene.setOverlayShape(svgInfluenceItem);
106  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
void setOverlayShape(SvgItem *item)
setOverlayItem Sets the given overlay shape upon the scene.
Definition: imagetaskscene.cpp:106
ImageTaskPixmapGraphicsItem & getTargetPixmapItem()
getTargetPixmapItem Gets a refernece to the graphics item that houses the target pixmap.
Definition: imagetaskscene.cpp:101
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137

Here is the call graph for this function:

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::setTargetPixmap ( const QPixmap &  pixmap)
inline
45  {
48  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137
void setTargetPixmap(const QPixmap &pixmap)
setTargetPixmap Sets the pixmap that provides the target/goal image visualization.
Definition: imagetaskscene.cpp:96

Here is the call graph for this function:

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::setTargetPixmapOpacity ( const float  opacity)
inline
51  {
54  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
void setTargetPixmapOpacity(float opacity)
setTargetPixmapOpacity Sets the opacity of the target pixmap.
Definition: imagetaskscene.cpp:91
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137

Here is the call graph for this function:

void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::setViews ( ImageTaskGraphicsView pixmapView,
ImageTaskGraphicsView svgView 
)
inline
39  {
40  pixmapView.setScene(&m_pixmapScene);
41  svgView.setScene(&m_svgScene);
42  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137
void geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::updateScenes ( const QPixmap &  pixmap,
const std::vector< geometrize::ShapeResult > &  shapes 
)
inline
57  {
59  m_svgScene.addShapes(shapes, static_cast<std::uint32_t>(pixmap.size().width()), static_cast<std::uint32_t>(pixmap.size().height()));
60  }
geometrize::scene::ImageTaskSvgScene m_svgScene
The scene containing the raster/pixel-based representation of the shapes
Definition: imagetaskscenemanager.cpp:138
void addShapes(const std::vector< geometrize::ShapeResult > &shapes, const std::uint32_t width, const std::uint32_t height)
addShapes Updates the SVG data based on the given shapes.
Definition: imagetasksvgscene.cpp:68
void setWorkingPixmap(const QPixmap &pixmap)
setWorkingPixmap Sets the pixmap that provides the current/working image visualization.
Definition: imagetaskpixmapscene.cpp:43
geometrize::scene::ImageTaskPixmapScene m_pixmapScene
Definition: imagetaskscenemanager.cpp:137

Here is the call graph for this function:

Member Data Documentation

const double geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::m_defaultViewMargins {20.0}
private
geometrize::scene::ImageTaskPixmapScene geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::m_pixmapScene
private
geometrize::scene::ImageTaskSvgScene geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::m_svgScene
private

The scene containing the raster/pixel-based representation of the shapes

ImageTaskSceneManager* geometrize::scene::ImageTaskSceneManager::ImageTaskSceneManagerImpl::q
private

The scene containing the vector-based representation of the shapes


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