fix build failure on Windows due to conflicting define of GDI API

This commit is contained in:
wmayer
2019-10-08 14:49:56 +02:00
parent 3006466a39
commit 07975595ba
4 changed files with 16 additions and 15 deletions

View File

@@ -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<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;
@@ -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<SoFCSelectionRoot*>(path->getNode(i));
if(node->selectionStyle.getValue()==SoFCSelectionRoot::BOX) {
if(node->selectionStyle.getValue()==SoFCSelectionRoot::Box) {
bbox = true;
break;
}

View File

@@ -318,7 +318,7 @@ public:
}
enum SelectStyles {
FULL, BOX, PASSTHROUGH
Full, Box, PassThrough
};
SoSFEnum selectionStyle;

View File

@@ -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();

View File

@@ -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;
}
}