Commit e040e48d authored by Jascha Wedowski's avatar Jascha Wedowski

draw mode for objects can now be combined freely even with draw mode set to global, fixing #91

parent 3f6a0d62
......@@ -721,6 +721,13 @@ void ViewControlPlugin::slotDrawModeSelected( QAction * _action) {
bool useGlobalDrawMode = false;
bool contextMenuStaysOpen = false;
if ( _action->text() != USEGLOBALDRAWMODE ) {
// extract global draw mode in case we want to combine it with another draw mode
if(activeDrawModes_ == ACG::SceneGraph::DrawModes::DEFAULT) {
ACG::SceneGraph::DrawModes::DrawMode widgetDrawMode = PluginFunctions::drawMode();
activeDrawModes_.combine(widgetDrawMode);
}
// As this is not the global draw mode, filter out default as draw mode or it will interfere with the other modes!
activeDrawModes_.filter(ACG::SceneGraph::DrawModes::DEFAULT);
......@@ -728,7 +735,7 @@ void ViewControlPlugin::slotDrawModeSelected( QAction * _action) {
// Otherwise we directly take the new mode
if ( qApp->keyboardModifiers() & Qt::ShiftModifier ) {
if (activateDrawMode) {
activeDrawModes_ |= mode;
activeDrawModes_.combine(mode); // explicit call to combine() states intent more clearly
} else {
if (activeDrawModes_ == mode) {
activeDrawModes_ = ACG::SceneGraph::DrawModes::DEFAULT;
......@@ -1275,7 +1282,7 @@ ViewControlPlugin::setDrawMode(QString _mode, int _viewer)
for ( int i = 0 ; i < list.size() ; ++i )
drawModeList.push_back(list[i]);
ACG::SceneGraph::DrawModes::DrawMode mode = listToDrawMode(drawModeList);
ACG::SceneGraph::DrawModes::DrawMode mode = listToDrawMode(drawModeList);
PluginFunctions::setDrawMode( mode , _viewer );
emit updateView();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment