Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
restore old DAG implementation and fix some build failures
  • Loading branch information
wwmayer committed Jan 22, 2017
1 parent f21fa3e commit 172206f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/App/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ ENDIF(DOCDIR)
add_definitions(-DBOOST_${Boost_VERSION})

#if you want to use the old DAG structure uncomment this line
#add_definitions(-DUSE_OLD_DAG)
add_definitions(-DUSE_OLD_DAG)

#write relevant cmake variables to a file for later access with python. Exportet are all variables
#starting with BUILD. As the variable only exists if the user set it to ON a dict is useless, we
Expand Down
23 changes: 15 additions & 8 deletions src/App/DocumentObject.cpp
Expand Up @@ -321,16 +321,18 @@ bool DocumentObject::_isInInListRecursive(const DocumentObject* /*act*/,
if (_isInInListRecursive(obj, test, checkObj, depth - 1))
return true;
}
#else
(void)test;
(void)checkObj;
(void)depth;
#endif

return false;
#endif
}

bool DocumentObject::isInInListRecursive(DocumentObject *linkTo) const
{
#ifndef USE_OLD_DAG
return _isInInListRecursive(this, linkTo, this, getDocument()->countObjects());
#endif
}

bool DocumentObject::isInInList(DocumentObject *linkTo) const
Expand All @@ -340,10 +342,13 @@ bool DocumentObject::isInInList(DocumentObject *linkTo) const
return true;
else
return false;
#else
(void)linkTo;
return false;
#endif
}

bool DocumentObject::_isInOutListRecursive(const DocumentObject *act,
bool DocumentObject::_isInOutListRecursive(const DocumentObject* act,
const DocumentObject* test,
const DocumentObject* checkObj, int depth) const
{
Expand All @@ -363,16 +368,19 @@ bool DocumentObject::_isInOutListRecursive(const DocumentObject *act,
if (_isInOutListRecursive(obj, test, checkObj, depth - 1))
return true;
}
#else
(void)act;
(void)test;
(void)checkObj;
(void)depth;
#endif

return false;
#endif
}

bool DocumentObject::isInOutListRecursive(DocumentObject *linkTo) const
{
#ifndef USE_OLD_DAG
return _isInOutListRecursive(this, linkTo, this, getDocument()->countObjects());
#endif
}

void DocumentObject::onLostLinkToObject(DocumentObject*)
Expand All @@ -393,7 +401,6 @@ void DocumentObject::setDocument(App::Document* doc)

void DocumentObject::onBeforeChange(const Property* prop)
{

// Store current name in oldLabel, to be able to easily retrieve old name of document object later
// when renaming expressions.
if (prop == &Label)
Expand Down

0 comments on commit 172206f

Please sign in to comment.