improve whitespaces

This commit is contained in:
wmayer 2017-01-21 19:12:56 +01:00
parent 69857f37f7
commit f3f7b01202
5 changed files with 139 additions and 135 deletions

View File

@ -1967,7 +1967,8 @@ int Document::recompute()
std::vector<App::DocumentObject*> Document::topologicalSort() const std::vector<App::DocumentObject*> Document::topologicalSort() const
{ {
// topological sort algorithm described here: https://de.wikipedia.org/wiki/Topologische_Sortierung#Algorithmus_f.C3.BCr_das_Topologische_Sortieren // topological sort algorithm described here:
// https://de.wikipedia.org/wiki/Topologische_Sortierung#Algorithmus_f.C3.BCr_das_Topologische_Sortieren
vector < App::DocumentObject* > ret; vector < App::DocumentObject* > ret;
ret.reserve(d->objectArray.size()); ret.reserve(d->objectArray.size());
map < App::DocumentObject*,int > countMap; map < App::DocumentObject*,int > countMap;
@ -2004,7 +2005,7 @@ int Document::recompute()
{ {
int objectCount = 0; int objectCount = 0;
// delete recompute log // delete recompute log
for( auto LogEntry: _RecomputeLog) for (auto LogEntry: _RecomputeLog)
delete LogEntry; delete LogEntry;
_RecomputeLog.clear(); _RecomputeLog.clear();
@ -2035,9 +2036,10 @@ int Document::recompute()
} }
#ifdef FC_DEBUG #ifdef FC_DEBUG
// check if all objects are recalculated which were thouched // check if all objects are recalculated which were thouched
for (auto objectIt : d->objectArray) for (auto objectIt : d->objectArray) {
if (objectIt->isTouched()) if (objectIt->isTouched())
cerr << "Document::recompute(): " << objectIt->getNameInDocument() << " still touched after recompute" << endl; cerr << "Document::recompute(): " << objectIt->getNameInDocument() << " still touched after recompute" << endl;
}
#endif #endif
return objectCount; return objectCount;
@ -2692,11 +2694,12 @@ PyObject * Document::getPyObject(void)
std::vector<App::DocumentObject*> Document::getRootObjects() const std::vector<App::DocumentObject*> Document::getRootObjects() const
{ {
std::vector < App::DocumentObject* > ret; std::vector < App::DocumentObject* > ret;
for (auto objectIt : d->objectArray) for (auto objectIt : d->objectArray) {
if (objectIt->getInList().size() == 0) if (objectIt->getInList().empty())
ret.push_back(objectIt); ret.push_back(objectIt);
}
return ret; return ret;
} }

View File

@ -341,7 +341,9 @@ bool DocumentObject::isInInList(DocumentObject *linkTo) const
#endif #endif
} }
bool DocumentObject::_isInOutListRecursive(const DocumentObject *act, const DocumentObject* test, const DocumentObject* checkObj, int depth) const bool DocumentObject::_isInOutListRecursive(const DocumentObject *act,
const DocumentObject* test,
const DocumentObject* checkObj, int depth) const
{ {
#ifndef USE_OLD_DAG #ifndef USE_OLD_DAG
std::vector <DocumentObject*> outList = act->getOutList(); std::vector <DocumentObject*> outList = act->getOutList();

View File

@ -210,14 +210,14 @@ Py::List DocumentObjectPy::getInList(void) const
Py::List DocumentObjectPy::getInListRecursive(void) const Py::List DocumentObjectPy::getInListRecursive(void) const
{ {
Py::List ret; Py::List ret;
try{ try {
std::vector<DocumentObject*> list = getDocumentObjectPtr()->getInListRecursive(); std::vector<DocumentObject*> list = getDocumentObjectPtr()->getInListRecursive();
for (std::vector<DocumentObject*>::iterator It = list.begin(); It != list.end(); ++It) for (std::vector<DocumentObject*>::iterator It = list.begin(); It != list.end(); ++It)
ret.append(Py::Object((*It)->getPyObject(), true)); ret.append(Py::Object((*It)->getPyObject(), true));
}catch (const Base::Exception& e) { }
catch (const Base::Exception& e) {
throw Py::IndexError(e.what()); throw Py::IndexError(e.what());
} }
return ret; return ret;
@ -238,7 +238,6 @@ Py::List DocumentObjectPy::getOutListRecursive(void) const
{ {
Py::List ret; Py::List ret;
try { try {
std::vector<DocumentObject*> list = getDocumentObjectPtr()->getOutListRecursive(); std::vector<DocumentObject*> list = getDocumentObjectPtr()->getOutListRecursive();
// creat the python list for the output // creat the python list for the output

View File

@ -373,12 +373,12 @@ PropertyLinkSub::~PropertyLinkSub()
// Base class implementer // Base class implementer
void PropertyLinkSub::setValue(App::DocumentObject * lValue, const std::vector<std::string> &SubList) void PropertyLinkSub::setValue(App::DocumentObject * lValue, const std::vector<std::string> &SubList)
{ {
aboutToSetValue(); aboutToSetValue();
#ifndef USE_OLD_DAG #ifndef USE_OLD_DAG
if(_pcLinkSub) if (_pcLinkSub)
_pcLinkSub->_removeBackLink(static_cast<App::DocumentObject*>(getContainer())); _pcLinkSub->_removeBackLink(static_cast<App::DocumentObject*>(getContainer()));
if(lValue) if (lValue)
lValue->_addBackLink(static_cast<App::DocumentObject*>(getContainer())); lValue->_addBackLink(static_cast<App::DocumentObject*>(getContainer()));
#endif #endif
_pcLinkSub=lValue; _pcLinkSub=lValue;
@ -574,7 +574,7 @@ void PropertyLinkSubList::setValue(DocumentObject* lValue,const char* SubName)
//maintain backlinks //maintain backlinks
for(auto *obj : _lValueList) for(auto *obj : _lValueList)
obj->_removeBackLink(static_cast<DocumentObject*>(getContainer())); obj->_removeBackLink(static_cast<DocumentObject*>(getContainer()));
if(lValue) if (lValue)
lValue->_addBackLink(static_cast<DocumentObject*>(getContainer())); lValue->_addBackLink(static_cast<DocumentObject*>(getContainer()));
#endif #endif

View File

@ -37,90 +37,90 @@
// First check for *WIN64* since the *WIN32* are also set on 64-bit platforms // First check for *WIN64* since the *WIN32* are also set on 64-bit platforms
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) #if defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
# ifndef FC_OS_WIN32 # ifndef FC_OS_WIN32
# define FC_OS_WIN32 # define FC_OS_WIN32
# endif # endif
# ifndef FC_OS_WIN64 # ifndef FC_OS_WIN64
# define FC_OS_WIN64 # define FC_OS_WIN64
# endif # endif
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
# ifndef FC_OS_WIN32 # ifndef FC_OS_WIN32
# define FC_OS_WIN32 # define FC_OS_WIN32
# endif # endif
# if defined(__MINGW32__) # if defined(__MINGW32__)
# if HAVE_CONFIG_H # if HAVE_CONFIG_H
# include <config.h> # include <config.h>
# endif // HAVE_CONFIG_H # endif // HAVE_CONFIG_H
//# define HAVE_INT8_T //# define HAVE_INT8_T
//# define HAVE_UINT8_T //# define HAVE_UINT8_T
//# define HAVE_INT16_T //# define HAVE_INT16_T
//# define HAVE_UINT16_T //# define HAVE_UINT16_T
//# define HAVE_INT32_T //# define HAVE_INT32_T
//# define HAVE_UINT32_T //# define HAVE_UINT32_T
//# define HAVE_INT64_T //# define HAVE_INT64_T
//# define HAVE_UINT64_T //# define HAVE_UINT64_T
//# define HAVE_INTPTR_T //# define HAVE_INTPTR_T
//# define HAVE_UINTPTR_T //# define HAVE_UINTPTR_T
# endif # endif
#elif defined(__MWERKS__) && defined(__INTEL__) #elif defined(__MWERKS__) && defined(__INTEL__)
# ifndef FC_OS_WIN32 # ifndef FC_OS_WIN32
# define FC_OS_WIN32 # define FC_OS_WIN32
# endif # endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
# ifndef FC_OS_MACOSX # ifndef FC_OS_MACOSX
# define FC_OS_MACOSX # define FC_OS_MACOSX
# endif # endif
#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__) #elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__)
# ifndef FC_OS_LINUX # ifndef FC_OS_LINUX
# define FC_OS_LINUX # define FC_OS_LINUX
# endif # endif
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
# ifndef FC_OS_BSD # ifndef FC_OS_BSD
# define FC_OS_BSD # define FC_OS_BSD
# endif # endif
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
# ifndef FC_OS_CYGWIN # ifndef FC_OS_CYGWIN
# define FC_OS_CYGWIN # define FC_OS_CYGWIN
// Avoid conflicts with Inventor // Avoid conflicts with Inventor
# define HAVE_INT8_T # define HAVE_INT8_T
# define HAVE_UINT8_T # define HAVE_UINT8_T
# define HAVE_INT16_T # define HAVE_INT16_T
# define HAVE_UINT16_T # define HAVE_UINT16_T
# define HAVE_INT32_T # define HAVE_INT32_T
# define HAVE_UINT32_T # define HAVE_UINT32_T
# define HAVE_INT64_T # define HAVE_INT64_T
# define HAVE_UINT64_T # define HAVE_UINT64_T
# define HAVE_INTPTR_T # define HAVE_INTPTR_T
# define HAVE_UINTPTR_T # define HAVE_UINTPTR_T
#endif #endif
//#elif defined(sun) || defined(__sun) || defined(__sun__) //#elif defined(sun) || defined(__sun) || defined(__sun__)
//# if defined(__SVR4) //# if defined(__SVR4)
//# define _FC_OS_SOLARIS //# define _FC_OS_SOLARIS
//# else //# else
//# define _FC_OS_SUN_ //# define _FC_OS_SUN_
//# endif //# endif
//#elif defined(hpux) || defined(__hpux) || defined(__hpux__) //#elif defined(hpux) || defined(__hpux) || defined(__hpux__)
//# define FC_OS_HPUX_ //# define FC_OS_HPUX_
//#elif defined(__FreeBSD__) //#elif defined(__FreeBSD__)
//# define FC_OS_FREEBSD //# define FC_OS_FREEBSD
//#elif defined(__NetBSD__) //#elif defined(__NetBSD__)
//# define FC_OS_NETBSD //# define FC_OS_NETBSD
//#elif defined(__OpenBSD__) //#elif defined(__OpenBSD__)
//# define FC_OS_OPENBSD //# define FC_OS_OPENBSD
//#elif defined(sgi) || defined(__sgi) //#elif defined(sgi) || defined(__sgi)
//# define FC_OS_IRIX //# define FC_OS_IRIX
//#elif defined(_AIX) //#elif defined(_AIX)
//# define FC_OS_AIX //# define FC_OS_AIX
//#elif defined(__GNU__) //#elif defined(__GNU__)
//# define FC_OS_GNU //# define FC_OS_GNU
#else #else
# error "FreeCAD is not ported to this OS yet. For help see www.freecadweb.org" # error "FreeCAD is not ported to this OS yet. For help see www.freecadweb.org"
#endif #endif
#ifdef FC_OS_WIN32 #ifdef FC_OS_WIN32
# define PATHSEP '\\' # define PATHSEP '\\'
#else #else
# define PATHSEP '/' # define PATHSEP '/'
#endif #endif
//************************************************************************** //**************************************************************************
@ -132,7 +132,7 @@
#ifndef HAVE_INT8_T #ifndef HAVE_INT8_T
#define HAVE_INT8_T #define HAVE_INT8_T
typedef signed char int8_t; typedef signed char int8_t;
#endif #endif
#ifndef HAVE_UINT8_T #ifndef HAVE_UINT8_T
@ -178,20 +178,20 @@ typedef unsigned __int64 uint64_t;
// Open CasCade // Open CasCade
#ifdef _MSC_VER #ifdef _MSC_VER
# ifndef WNT # ifndef WNT
# define WNT # define WNT
# endif # endif
# ifndef WIN32 # ifndef WIN32
# define WIN32 # define WIN32
# endif # endif
# ifndef _WINDOWS # ifndef _WINDOWS
# define _WINDOWS # define _WINDOWS
# endif # endif
#endif #endif
#ifdef FC_OS_LINUX #ifdef FC_OS_LINUX
# define LIN # define LIN
# define LININTEL # define LININTEL
//# define NO_CXX_EXCEPTION //# define NO_CXX_EXCEPTION
#endif #endif
@ -199,19 +199,19 @@ typedef unsigned __int64 uint64_t;
/// enables the use of the OCC DocumentBrowser /// enables the use of the OCC DocumentBrowser
#ifndef FC_OS_LINUX #ifndef FC_OS_LINUX
# define FC_USE_OCAFBROWSER # define FC_USE_OCAFBROWSER
#endif #endif
#ifdef FC_OCC_DEBUG #ifdef FC_OCC_DEBUG
# ifdef FC_DEBUG # ifdef FC_DEBUG
# define DEBUG 1 # define DEBUG 1
# else # else
# undef DEBUG # undef DEBUG
# ifndef NDEBUG # ifndef NDEBUG
# define NDEBUG # define NDEBUG
# endif # endif
# endif # endif
#endif #endif
@ -281,49 +281,49 @@ typedef unsigned __int64 uint64_t;
// Don't catch C++ exceptions in DEBUG! // Don't catch C++ exceptions in DEBUG!
#ifdef FC_DEBUG #ifdef FC_DEBUG
# define DONT_CATCH_CXX_EXCEPTIONS 1 # define DONT_CATCH_CXX_EXCEPTIONS 1
# define DBG_TRY # define DBG_TRY
# define DBG_CATCH(X) # define DBG_CATCH(X)
#else #else
/// used to switch a catch with the debug state /// used to switch a catch with the debug state
# define DBG_TRY try { # define DBG_TRY try {
/// see docu DBGTRY /// see docu DBGTRY
# define DBG_CATCH(X) }catch(...) { X } # define DBG_CATCH(X) } catch (...) { X }
#endif #endif
//************************************************************************** //**************************************************************************
// Windows import export DLL defines // Windows import export DLL defines
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN) #if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
# ifdef FCApp # ifdef FCApp
# define AppExport __declspec(dllexport) # define AppExport __declspec(dllexport)
# define DataExport __declspec(dllexport) # define DataExport __declspec(dllexport)
# else # else
# define AppExport __declspec(dllimport) # define AppExport __declspec(dllimport)
# define DataExport __declspec(dllimport) # define DataExport __declspec(dllimport)
# endif # endif
# ifdef FCBase # ifdef FCBase
# define BaseExport __declspec(dllexport) # define BaseExport __declspec(dllexport)
# else # else
# define BaseExport __declspec(dllimport) # define BaseExport __declspec(dllimport)
# endif # endif
# ifdef FCGui # ifdef FCGui
# define GuiExport __declspec(dllexport) # define GuiExport __declspec(dllexport)
# else # else
# define GuiExport __declspec(dllimport) # define GuiExport __declspec(dllimport)
# endif # endif
#else #else
# ifndef BaseExport # ifndef BaseExport
# define BaseExport # define BaseExport
# endif # endif
# ifndef GuiExport # ifndef GuiExport
# define GuiExport # define GuiExport
# endif # endif
# ifndef AppExport # ifndef AppExport
# define AppExport # define AppExport
# endif # endif
# ifndef DataExport # ifndef DataExport
# define DataExport # define DataExport
# endif # endif
#endif #endif