Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
imagetaskscenemanager.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
6 #include <QObject>
7 
9 
10 class QPixmap;
11 
12 namespace geometrize
13 {
14 struct ShapeResult;
15 class Shape;
16 }
17 
18 namespace geometrize
19 {
20 namespace scene
21 {
22 class ImageTaskGraphicsView;
23 }
24 }
25 
26 namespace geometrize
27 {
28 
29 namespace scene
30 {
31 
36 class ImageTaskSceneManager : public QObject
37 {
38  Q_OBJECT
39 
40 public:
42  virtual ~ImageTaskSceneManager();
43 
49  void setViews(ImageTaskGraphicsView& pixmapView, ImageTaskGraphicsView& svgView);
50 
55  void setTargetPixmap(const QPixmap& pixmap);
56 
61  void setTargetPixmapOpacity(float opacity);
62 
68  void updateScenes(const QPixmap& pixmap, const std::vector<geometrize::ShapeResult>& shapes);
69 
73  void reset();
74 
80 
86 
93 
98  void setAreaOfInfluenceShape(const geometrize::Shape& shape);
99 
100 signals:
102  void signal_onTargetImageHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier);
103  void signal_onTargetImageMousePressEvent(double x, double y, bool ctrlModifier);
104  void signal_onTargetImageMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier);
105  void signal_onTargetImageMouseReleaseEvent(double x, double y, bool ctrlModifier);
106  void signal_onTargetImageWheelEvent(double x, double y, int amount, bool ctrlModifier);
107  void signal_onTargetImageKeyPressEvent(int key, bool ctrlModifier);
108  void signal_onTargetImageKeyReleaseEvent(int key, bool ctrlModifier);
109 
110  void signal_onAreaOfInfluenceShapeHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier);
111  void signal_onAreaOfInfluenceShapeMousePressEvent(double x, double y, bool ctrlModifier);
112  void signal_onAreaOfInfluenceShapeMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier);
113  void signal_onAreaOfInfluenceShapeMouseReleaseEvent(double x, double y, bool ctrlModifier);
114  void signal_onAreaOfInfluenceShapeMouseWheelEvent(double x, double y, int amount, bool ctrlModifier);
115  void signal_onAreaOfInfluenceShapeKeyPressEvent(int key, bool ctrlModifier);
116  void signal_onAreaOfInfluenceShapeKeyReleaseEvent(int key, bool ctrlModifier);
117 
118 private:
120  std::unique_ptr<ImageTaskSceneManagerImpl> d;
121 };
122 
123 }
124 
125 }
void signal_onAreaOfInfluenceShapeMouseWheelEvent(double x, double y, int amount, bool ctrlModifier)
void setAreaOfInfluenceShape(const geometrize::Shape &shape)
setAreaOfInfluenceShape Sets up a area of influence visual for the given shape.
Definition: imagetaskscenemanager.cpp:193
void signal_onAreaOfInfluenceShapeMouseReleaseEvent(double x, double y, bool ctrlModifier)
void setTargetPixmap(const QPixmap &pixmap)
setTargetPixmap Sets the pixmap that provides the target/goal image visualization.
Definition: imagetaskscenemanager.cpp:158
void signal_onTargetImageHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void signal_onAreaOfInfluenceShapeMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
virtual ~ImageTaskSceneManager()
Definition: imagetaskscenemanager.cpp:149
void updateScenes(const QPixmap &pixmap, const std::vector< geometrize::ShapeResult > &shapes)
updateScenes Updates the scenes to show the latest image/shapes.
Definition: imagetaskscenemanager.cpp:168
The CustomTabletEvent class represents a tablet event (specifically from a Wacom Pro pen) that can be...
Definition: customtabletevent.h:87
void signal_onAreaOfInfluenceShapeMousePressEvent(double x, double y, bool ctrlModifier)
void signal_onAreaOfInfluenceShapeKeyReleaseEvent(int key, bool ctrlModifier)
void setTargetPixmapOpacity(float opacity)
setTargetPixmapOpacity Sets the opacity of the target pixmap.
Definition: imagetaskscenemanager.cpp:163
void signal_onTargetImageMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void signal_onAreaOfInfluenceShapeHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void fitVectorSceneInView(ImageTaskGraphicsView &svgView)
fitVectorSceneInView Fits the SVG/vector scene into the given view.
Definition: imagetaskscenemanager.cpp:183
The ImageTaskSceneManager manages the scenes representing the graphical state of the shapes It mostly...
Definition: imagetaskscenemanager.h:36
void signal_onTargetImageMousePressEvent(double x, double y, bool ctrlModifier)
void signal_onAreaOfInfluenceShapeKeyPressEvent(int key, bool ctrlModifier)
std::unique_ptr< ImageTaskSceneManagerImpl > d
Definition: imagetaskscenemanager.h:119
The ImageTaskGraphicsView class models a graphics view for viewing the images and shapes used and/or ...
Definition: imagetaskgraphicsview.h:21
void fitPixmapSceneInView(ImageTaskGraphicsView &pixmapView)
fitPixmapSceneInView Fits the pixmap scene into the given view.
Definition: imagetaskscenemanager.cpp:178
void signal_onTargetImageMouseReleaseEvent(double x, double y, bool ctrlModifier)
void fitScenesInViews(ImageTaskGraphicsView &pixmapView, ImageTaskGraphicsView &svgView)
fitScenesInViews Fits the scenes into their respective views.
Definition: imagetaskscenemanager.cpp:188
void signal_onTargetImageWheelEvent(double x, double y, int amount, bool ctrlModifier)
void reset()
reset Resets the state of the scenes, removing shapes etc.
Definition: imagetaskscenemanager.cpp:173
void signal_onTargetImageKeyReleaseEvent(int key, bool ctrlModifier)
void signal_onTargetImageKeyPressEvent(int key, bool ctrlModifier)
void setViews(ImageTaskGraphicsView &pixmapView, ImageTaskGraphicsView &svgView)
setViews Associates the given views with the scenes managed by this class.
Definition: imagetaskscenemanager.cpp:153
ImageTaskSceneManager()
Definition: imagetaskscenemanager.cpp:145
void signal_onTargetImageTabletEvent(const geometrize::scene::CustomTabletEvent &event)