From 07975595ba07bbdeda49e5e095a2e28273dac5ed Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 8 Oct 2019 14:49:56 +0200 Subject: [PATCH] fix build failure on Windows due to conflicting define of GDI API --- src/Gui/SoFCUnifiedSelection.cpp | 23 ++++++++++++----------- src/Gui/SoFCUnifiedSelection.h | 2 +- src/Gui/View3DInventorViewer.cpp | 4 ++-- src/Gui/ViewProviderDocumentObject.cpp | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index 12f2750849..3ad2a6e556 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -1081,10 +1081,10 @@ SoFCSelectionRoot::SoFCSelectionRoot(bool trackCacheMode) :SoFCSeparator(trackCacheMode) { SO_NODE_CONSTRUCTOR(SoFCSelectionRoot); - SO_NODE_ADD_FIELD(selectionStyle,(FULL)); - SO_NODE_DEFINE_ENUM_VALUE(SelectStyles, FULL); - SO_NODE_DEFINE_ENUM_VALUE(SelectStyles, BOX); - SO_NODE_DEFINE_ENUM_VALUE(SelectStyles, PASSTHROUGH); + SO_NODE_ADD_FIELD(selectionStyle,(Full)); + SO_NODE_DEFINE_ENUM_VALUE(SelectStyles, Full); + SO_NODE_DEFINE_ENUM_VALUE(SelectStyles, Box); + SO_NODE_DEFINE_ENUM_VALUE(SelectStyles, PassThrough); SO_NODE_SET_SF_ENUM_TYPE(selectionStyle, SelectStyles); } @@ -1286,11 +1286,12 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { auto state = action->getState(); SelContextPtr ctx = getRenderContext(this); int style = selectionStyle.getValue(); - if((style==SoFCSelectionRoot::BOX || ViewParams::instance()->getShowSelectionBoundingBox()) + if((style==SoFCSelectionRoot::Box || ViewParams::instance()->getShowSelectionBoundingBox()) && ctx && !ctx->hideAll && (ctx->selAll || ctx->hlAll)) { - if(style==SoFCSelectionRoot::PASSTHROUGH) - style = SoFCSelectionRoot::BOX; + if (style==SoFCSelectionRoot::PassThrough) { + style = SoFCSelectionRoot::Box; + } else { renderBBox(action,this,ctx->hlAll?ctx->hlColor:ctx->selColor); return true; @@ -1308,7 +1309,7 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { bool colorPushed = false; if(!ShapeColorNode && overrideColor && !SoOverrideElement::getDiffuseColorOverride(state) && - (style==SoFCSelectionRoot::BOX || !ctx || (!ctx->selAll && !ctx->hideAll))) + (style==SoFCSelectionRoot::Box || !ctx || (!ctx->selAll && !ctx->hideAll))) { ShapeColorNode = this; colorPushed = true; @@ -1339,7 +1340,7 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { if((selPushed = ctx->selAll)) { SelColorStack.push_back(ctx->selColor); - if(style != SoFCSelectionRoot::BOX) { + if(style != SoFCSelectionRoot::Box) { state->push(); auto &color = SelColorStack.back(); SoLazyElement::setEmissive(state, &color); @@ -1365,7 +1366,7 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { if(selPushed) { SelColorStack.pop_back(); - if(style != SoFCSelectionRoot::BOX) + if(style != SoFCSelectionRoot::Box) state->pop(); } if(hlPushed) @@ -1748,7 +1749,7 @@ void SoFCPathAnnotation::GLRenderBelowPath(SoGLRenderAction * action) if(!path->getNode(i)->isOfType(SoFCSelectionRoot::getClassTypeId())) continue; auto node = static_cast(path->getNode(i)); - if(node->selectionStyle.getValue()==SoFCSelectionRoot::BOX) { + if(node->selectionStyle.getValue()==SoFCSelectionRoot::Box) { bbox = true; break; } diff --git a/src/Gui/SoFCUnifiedSelection.h b/src/Gui/SoFCUnifiedSelection.h index 53bcb21194..e07005c62c 100644 --- a/src/Gui/SoFCUnifiedSelection.h +++ b/src/Gui/SoFCUnifiedSelection.h @@ -318,7 +318,7 @@ public: } enum SelectStyles { - FULL, BOX, PASSTHROUGH + Full, Box, PassThrough }; SoSFEnum selectionStyle; diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 82fccfdbf3..6c06d97ce9 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -507,13 +507,13 @@ void View3DInventorViewer::init() pcGroupOnTop->addChild(pcOnTopMaterial); auto selRoot = new SoFCSelectionRoot; - selRoot->selectionStyle = SoFCSelectionRoot::PASSTHROUGH; + selRoot->selectionStyle = SoFCSelectionRoot::PassThrough; pcGroupOnTopSel = selRoot; pcGroupOnTopSel->setName("GroupOnTopSel"); pcGroupOnTopSel->ref(); pcGroupOnTop->addChild(pcGroupOnTopSel); selRoot = new SoFCSelectionRoot; - selRoot->selectionStyle = SoFCSelectionRoot::PASSTHROUGH; + selRoot->selectionStyle = SoFCSelectionRoot::PassThrough; pcGroupOnTopPreSel = selRoot; pcGroupOnTopPreSel->setName("GroupOnTopPreSel"); pcGroupOnTopPreSel->ref(); diff --git a/src/Gui/ViewProviderDocumentObject.cpp b/src/Gui/ViewProviderDocumentObject.cpp index 1e622fce35..921f09ff6f 100644 --- a/src/Gui/ViewProviderDocumentObject.cpp +++ b/src/Gui/ViewProviderDocumentObject.cpp @@ -189,7 +189,7 @@ void ViewProviderDocumentObject::onChanged(const App::Property* prop) else if (prop == &SelectionStyle) { if(getRoot()->isOfType(SoFCSelectionRoot::getClassTypeId())) { static_cast(getRoot())->selectionStyle = SelectionStyle.getValue() - ?SoFCSelectionRoot::BOX:SoFCSelectionRoot::FULL; + ? SoFCSelectionRoot::Box : SoFCSelectionRoot::Full; } }