Polygon Fixes

Polygon kann jetzt im Shaped-Image nicht außerhalb des Polygons gestartet werden
This commit is contained in:
AshBastian
2020-01-07 17:39:52 +01:00
parent 011026899c
commit e540bd64f2
11 changed files with 67 additions and 21 deletions

View File

@@ -5,6 +5,7 @@
IntelliImage::IntelliImage(int weight, int height)
: imageData(QSize(weight, height), QImage::Format_ARGB32){
imageData.fill(QColor(255,255,255,255));
}
IntelliImage::~IntelliImage(){

View File

@@ -8,13 +8,7 @@
#include <QWidget>
#include <vector>
/*!
* \brief The Types, which an Image can be.
*/
enum class ImageType {
Raster_Image,
Shaped_Image
};
#include "IntelliHelper/IntelliHelper.h"
class IntelliTool;
@@ -23,6 +17,16 @@ class IntelliTool;
*/
class IntelliImage {
friend IntelliTool;
public:
/*!
* \brief The Types, which an Image can be.
*/
enum class ImageType {
Raster_Image,
Shaped_Image
};
protected:
void resizeImage(QImage*image, const QSize &newSize);
@@ -30,6 +34,11 @@ void resizeImage(QImage*image, const QSize &newSize);
* \brief The underlying image data.
*/
QImage imageData;
/*!
* \brief The Type, an Image is.
*/
ImageType TypeOfImage;
public:
/*!
* \brief The Construcor of the IntelliImage. Given the Image dimensions.
@@ -114,6 +123,10 @@ virtual std::vector<QPoint> getPolygonData(){
return std::vector<QPoint>();
}
virtual ImageType getTypeOfImage(){
return TypeOfImage;
}
/*!
* \brief A function that loads and sclaes an image to the fitting dimensions.
* \param filePath - The path+name of the image which to loaded.

View File

@@ -5,7 +5,7 @@
IntelliRasterImage::IntelliRasterImage(int weight, int height)
: IntelliImage(weight, height){
TypeOfImage = IntelliImage::ImageType::Raster_Image;
}
IntelliRasterImage::~IntelliRasterImage(){
@@ -15,6 +15,7 @@ IntelliRasterImage::~IntelliRasterImage(){
IntelliImage* IntelliRasterImage::getDeepCopy(){
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height());
raster->imageData.fill(Qt::transparent);
raster->TypeOfImage = IntelliImage::ImageType::Raster_Image;
return raster;
}

View File

@@ -6,6 +6,7 @@
IntelliShapedImage::IntelliShapedImage(int weight, int height)
: IntelliRasterImage(weight, height){
TypeOfImage = IntelliImage::ImageType::Shaped_Image;
}
IntelliShapedImage::~IntelliShapedImage(){
@@ -20,6 +21,7 @@ IntelliImage* IntelliShapedImage::getDeepCopy(){
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height());
shaped->setPolygon(this->polygonData);
shaped->imageData.fill(Qt::transparent);
shaped->TypeOfImage = IntelliImage::ImageType::Shaped_Image;
return shaped;
}

View File

@@ -3,7 +3,6 @@
#include "Image/IntelliRasterImage.h"
#include <vector>
#include "IntelliHelper/IntelliHelper.h"
/*!
* \brief The IntelliShapedImage manages a Shapedimage.