Skip to content

Commit

Permalink
fix build failure on Windows due to conflicting define of GDI API
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 8, 2019
1 parent 3006466 commit 0797559
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
23 changes: 12 additions & 11 deletions src/Gui/SoFCUnifiedSelection.cpp
Expand Up @@ -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);
}

Expand Down Expand Up @@ -1286,11 +1286,12 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) {
auto state = action->getState();
SelContextPtr ctx = getRenderContext<SelContext>(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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -1748,7 +1749,7 @@ void SoFCPathAnnotation::GLRenderBelowPath(SoGLRenderAction * action)
if(!path->getNode(i)->isOfType(SoFCSelectionRoot::getClassTypeId()))
continue;
auto node = static_cast<SoFCSelectionRoot*>(path->getNode(i));
if(node->selectionStyle.getValue()==SoFCSelectionRoot::BOX) {
if(node->selectionStyle.getValue()==SoFCSelectionRoot::Box) {
bbox = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/SoFCUnifiedSelection.h
Expand Up @@ -318,7 +318,7 @@ class GuiExport SoFCSelectionRoot : public SoFCSeparator {
}

enum SelectStyles {
FULL, BOX, PASSTHROUGH
Full, Box, PassThrough
};
SoSFEnum selectionStyle;

Expand Down
4 changes: 2 additions & 2 deletions src/Gui/View3DInventorViewer.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/ViewProviderDocumentObject.cpp
Expand Up @@ -189,7 +189,7 @@ void ViewProviderDocumentObject::onChanged(const App::Property* prop)
else if (prop == &SelectionStyle) {
if(getRoot()->isOfType(SoFCSelectionRoot::getClassTypeId())) {
static_cast<SoFCSelectionRoot*>(getRoot())->selectionStyle = SelectionStyle.getValue()
?SoFCSelectionRoot::BOX:SoFCSelectionRoot::FULL;
? SoFCSelectionRoot::Box : SoFCSelectionRoot::Full;
}
}

Expand Down

0 comments on commit 0797559

Please sign in to comment.