mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 12:50:33 +02:00
Documentation
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
#include "IntelliToolPolygon.h"
|
#include "IntelliToolPolygon.h"
|
||||||
#include "Layer/PaintingArea.h"
|
#include "Layer/PaintingArea.h"
|
||||||
#include "IntelliHelper/IntelliHelper.h"
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
|
|
||||||
@@ -11,6 +10,8 @@ IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* c
|
|||||||
PointIsNearStart = false;
|
PointIsNearStart = false;
|
||||||
drawingPoint.setX(0);
|
drawingPoint.setX(0);
|
||||||
drawingPoint.setY(0);
|
drawingPoint.setY(0);
|
||||||
|
Point.setX(0);
|
||||||
|
Point.setY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
||||||
@@ -54,8 +55,7 @@ void IntelliToolPolygon::onMouseLeftReleased(int x, int y){
|
|||||||
this->Canvas->image->calculateVisiblity();
|
this->Canvas->image->calculateVisiblity();
|
||||||
PointIsNearStart = false;
|
PointIsNearStart = false;
|
||||||
isDrawing = false;
|
isDrawing = false;
|
||||||
std::vector<Triangle> Triangles = IntelliHelper::calculateTriangles(QPointList);
|
Triangles = IntelliHelper::calculateTriangles(QPointList);
|
||||||
QPoint Point(0,0);
|
|
||||||
for(int i = 0; i < width; i++){
|
for(int i = 0; i < width; i++){
|
||||||
for(int j = 0; j < height; j++){
|
for(int j = 0; j < height; j++){
|
||||||
Point.setX(i);
|
Point.setX(i);
|
||||||
|
|||||||
@@ -2,12 +2,20 @@
|
|||||||
#define INTELLITOOLPOLYGON_H
|
#define INTELLITOOLPOLYGON_H
|
||||||
|
|
||||||
#include "IntelliTool.h"
|
#include "IntelliTool.h"
|
||||||
|
#include "IntelliHelper/IntelliHelper.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
/*!
|
||||||
|
* \brief The IntelliToolPolygon managed the Drawing of Polygonforms
|
||||||
|
*/
|
||||||
class IntelliToolPolygon : public IntelliTool
|
class IntelliToolPolygon : public IntelliTool
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/*!
|
||||||
|
* \brief IntelliToolPolygon Constructor Define the Tool-intern Parameters
|
||||||
|
* \param Area
|
||||||
|
* \param colorPicker
|
||||||
|
*/
|
||||||
IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||||
|
|
||||||
virtual void onMouseLeftPressed(int x, int y) override;
|
virtual void onMouseLeftPressed(int x, int y) override;
|
||||||
@@ -20,15 +28,51 @@ public:
|
|||||||
virtual void onMouseMoved(int x, int y) override;
|
virtual void onMouseMoved(int x, int y) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/*!
|
||||||
|
* \brief isNearStart
|
||||||
|
* \param x
|
||||||
|
* \param y
|
||||||
|
* \param Startpoint
|
||||||
|
* \return true : Near Startpoint, else false
|
||||||
|
*/
|
||||||
bool isNearStart(int x, int y, QPoint Startpoint);
|
bool isNearStart(int x, int y, QPoint Startpoint);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief lineWidth of the Drawing Polygon
|
||||||
|
*/
|
||||||
int lineWidth;
|
int lineWidth;
|
||||||
|
/*!
|
||||||
|
* \brief width of the active Layer
|
||||||
|
*/
|
||||||
int width;
|
int width;
|
||||||
|
/*!
|
||||||
|
* \brief height of the active Layer
|
||||||
|
*/
|
||||||
int height;
|
int height;
|
||||||
|
/*!
|
||||||
|
* \brief isDrawing true while drawing, else false
|
||||||
|
*/
|
||||||
bool isDrawing;
|
bool isDrawing;
|
||||||
|
/*!
|
||||||
|
* \brief PointIsNearStart true, when last click near Startpoint, else false
|
||||||
|
*/
|
||||||
bool PointIsNearStart;
|
bool PointIsNearStart;
|
||||||
|
/*!
|
||||||
|
* \brief drawingPoint Current Point after Left-Click
|
||||||
|
*/
|
||||||
QPoint drawingPoint;
|
QPoint drawingPoint;
|
||||||
|
/*!
|
||||||
|
* \brief Point Needed to look, if Point is in Polygon
|
||||||
|
*/
|
||||||
|
QPoint Point;
|
||||||
|
/*!
|
||||||
|
* \brief QPointList List of all Points of the Polygon
|
||||||
|
*/
|
||||||
std::vector<QPoint> QPointList;
|
std::vector<QPoint> QPointList;
|
||||||
|
/*!
|
||||||
|
* \brief Triangles Transformed QPointList into triangulated Form of the Polygon
|
||||||
|
*/
|
||||||
|
std::vector<Triangle> Triangles;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user