mirror of https://github.com/CGAL/cgal
Fix Delaunay point removal
This commit is contained in:
parent
e28a3ac2cc
commit
dd701e28fa
|
|
@ -37,6 +37,7 @@ protected:
|
||||||
Converter<K> convert;
|
Converter<K> convert;
|
||||||
QGraphicsScene *scene_;
|
QGraphicsScene *scene_;
|
||||||
Point p;
|
Point p;
|
||||||
|
bool do_insert;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -44,7 +45,7 @@ template <typename T>
|
||||||
TriangulationPointInputAndConflictZone<T>::TriangulationPointInputAndConflictZone(QGraphicsScene* s,
|
TriangulationPointInputAndConflictZone<T>::TriangulationPointInputAndConflictZone(QGraphicsScene* s,
|
||||||
T * dt_,
|
T * dt_,
|
||||||
QObject* parent)
|
QObject* parent)
|
||||||
: GraphicsViewInput(parent), dt(dt_), scene_(s)
|
: GraphicsViewInput(parent), dt(dt_), scene_(s), do_insert(true)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -54,6 +55,12 @@ template <typename T>
|
||||||
void
|
void
|
||||||
TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
if(event->modifiers() & ::Qt::ShiftModifier){
|
||||||
|
do_insert = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
do_insert = true;
|
||||||
p = convert(event->scenePos());
|
p = convert(event->scenePos());
|
||||||
if(dt->dimension() < 2 ||
|
if(dt->dimension() < 2 ||
|
||||||
event->modifiers() != 0 ||
|
event->modifiers() != 0 ||
|
||||||
|
|
@ -91,6 +98,7 @@ TriangulationPointInputAndConflictZone<T>::mouseReleaseEvent(QGraphicsSceneMouse
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
qfaces.clear();
|
qfaces.clear();
|
||||||
|
if(do_insert)
|
||||||
Q_EMIT( generate(CGAL::make_object(p)));
|
Q_EMIT( generate(CGAL::make_object(p)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue