Element editor: add polygon is managed by an esevent

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3466 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-11-08 11:14:56 +00:00
parent f3e86766c1
commit 217cb4939c
9 changed files with 249 additions and 56 deletions

View File

@@ -173,6 +173,45 @@ QET::ScalingMethod PartPolygon::preferredScalingMethod() const {
return(QET::RoundScaleRatios);
}
/**
* @brief PartPolygon::addPoint
* Add new point to polygon
* @param point
*/
void PartPolygon::addPoint(const QPointF &point) {
QPolygonF poly = polygon();
poly << point;
setPolygon(poly);
}
/**
* @brief PartPolygon::setLastPoint
* Set the last point of polygon to @point
* @param point
*/
void PartPolygon::setLastPoint(const QPointF &point) {
QPolygonF poly = polygon();
if (poly.size())
poly.pop_back();
poly << point;
setPolygon(poly);
}
/**
* @brief PartPolygon::removeLastPoint
* Remove the last point of polygon
*/
void PartPolygon::removeLastPoint() {
QPolygonF poly = polygon();
if (poly.size())
poly.pop_back();
setPolygon(poly);
}
/**
@return le rectangle delimitant cette partie.
*/