replace boolean to check for inside/outside cutting with enum values
This commit is contained in:
@@ -51,7 +51,7 @@ AbstractMouseSelection::AbstractMouseSelection() : _pcView3D(0)
|
||||
m_iYold = 0;
|
||||
m_iXnew = 0;
|
||||
m_iYnew = 0;
|
||||
m_bInner = true;
|
||||
m_selectedRole = SelectionRole::None;
|
||||
}
|
||||
|
||||
void AbstractMouseSelection::grabMouseModel(Gui::View3DInventorViewer* viewer)
|
||||
@@ -434,6 +434,8 @@ int PolyPickerSelection::keyboardEvent(const SoKeyboardEvent* const)
|
||||
|
||||
PolyClipSelection::PolyClipSelection()
|
||||
{
|
||||
selectionBits.set(1);
|
||||
selectionBits.set(2);
|
||||
}
|
||||
|
||||
PolyClipSelection::~PolyClipSelection()
|
||||
@@ -445,8 +447,13 @@ int PolyClipSelection::popupMenu()
|
||||
QMenu menu;
|
||||
QAction* ci = menu.addAction(QObject::tr("Inner"));
|
||||
QAction* co = menu.addAction(QObject::tr("Outer"));
|
||||
QAction* cs = menu.addAction(QObject::tr("Split"));
|
||||
QAction* ca = menu.addAction(QObject::tr("Cancel"));
|
||||
|
||||
ci->setVisible(testRole(SelectionRole::Inner));
|
||||
co->setVisible(testRole(SelectionRole::Outer));
|
||||
cs->setVisible(testRole(SelectionRole::Split));
|
||||
|
||||
if (getPositions().size() < 3) {
|
||||
ci->setEnabled(false);
|
||||
co->setEnabled(false);
|
||||
@@ -455,17 +462,25 @@ int PolyClipSelection::popupMenu()
|
||||
QAction* id = menu.exec(QCursor::pos());
|
||||
|
||||
if (id == ci) {
|
||||
m_bInner = true;
|
||||
m_selectedRole = SelectionRole::Inner;
|
||||
return Finish;
|
||||
}
|
||||
else if (id == co) {
|
||||
m_bInner = false;
|
||||
m_selectedRole = SelectionRole::Outer;
|
||||
return Finish;
|
||||
}
|
||||
else if (id == ca)
|
||||
else if (id == cs) {
|
||||
m_selectedRole = SelectionRole::Split;
|
||||
return Finish;
|
||||
}
|
||||
else if (id == ca) {
|
||||
m_selectedRole = SelectionRole::None;
|
||||
return Cancel;
|
||||
else
|
||||
}
|
||||
else {
|
||||
m_selectedRole = SelectionRole::None;
|
||||
return Restart;
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user