mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user