From e260f9dabd42b282a8e6950004a01983aeadef5f Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 9 Sep 2017 18:07:46 +0200 Subject: [PATCH] improve whitespaces --- src/App/Document.cpp | 18 ++--- src/App/GeoFeatureGroupExtension.cpp | 77 +++++++++---------- src/App/GroupExtension.cpp | 34 ++++---- src/App/GroupExtensionPyImp.cpp | 13 ++-- src/App/OriginGroupExtension.cpp | 16 ++-- src/App/PropertyLinks.cpp | 18 ++--- src/App/PropertyLinks.h | 2 +- src/App/Transactions.cpp | 7 +- src/Gui/MainWindow.cpp | 3 +- src/Gui/Tree.cpp | 8 +- src/Gui/ViewProviderDocumentObjectGroup.cpp | 2 +- .../ViewProviderGeoFeatureGroupExtension.cpp | 10 +-- src/Gui/ViewProviderPart.cpp | 2 +- src/Mod/Part/App/BodyBase.cpp | 4 +- src/Mod/PartDesign/App/FeatureBoolean.cpp | 8 +- 15 files changed, 107 insertions(+), 115 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index f19b1c1039..128896c70a 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -664,7 +664,6 @@ void Document::exportGraphviz(std::ostream& out) const edgeAttrMap[edge]["ltail"] = getClusterName(docObj); if (GraphList[*It2]) edgeAttrMap[edge]["lhead"] = getClusterName(*It2); - } } @@ -771,11 +770,10 @@ void Document::exportGraphviz(std::ostream& out) const } void markOutOfScopeLinks() { - const boost::property_map::type& edgeAttrMap = boost::get(boost::edge_attribute, DepList); - for( auto obj : objects) { - + for( auto obj : objects) { + std::vector invalids; GeoFeatureGroupExtension::getInvalidLinkObjects(obj, invalids); //isLinkValid returns true for non-link properties @@ -785,7 +783,7 @@ void Document::exportGraphviz(std::ostream& out) const if(res.second) edgeAttrMap[res.first]["color"] = "red"; } - } + } } const struct DocumentP* d; @@ -2176,7 +2174,7 @@ int Document::recompute() //do we have anything to do? if(d->objectMap.empty()) return 0; - + // get the sorted vector of all objects in the document and go though it from the end vector topoSortedObjects = topologicalSort(); @@ -2209,7 +2207,7 @@ int Document::recompute() } #endif - return objectCount; + return objectCount; } #endif // USE_OLD_DAG @@ -2227,7 +2225,7 @@ std::vector Document::topologicalSort() const auto in = objectIt.second->getInList(); std::sort(in.begin(), in.end()); in.erase(std::unique(in.begin(), in.end()), in.end()); - + countMap[objectIt.second] = in.size(); } @@ -2242,7 +2240,7 @@ std::vector Document::topologicalSort() const while (rootObjeIt != countMap.end()){ rootObjeIt->second = rootObjeIt->second - 1; - + //we need outlist with unique entries auto out = rootObjeIt->first->getOutList(); std::sort(out.begin(), out.end()); @@ -2650,7 +2648,7 @@ void Document::remObject(const char* sName) // remove from adjancy list //remove_vertex(_DepConMap[pos->second],_DepList); //_DepConMap.erase(pos->second); - + pos->second->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side d->objectMap.erase(pos); } diff --git a/src/App/GeoFeatureGroupExtension.cpp b/src/App/GeoFeatureGroupExtension.cpp index 667a910e72..ec8a0590ea 100644 --- a/src/App/GeoFeatureGroupExtension.cpp +++ b/src/App/GeoFeatureGroupExtension.cpp @@ -186,14 +186,14 @@ std::vector GeoFeatureGroupExtension::removeObjects(std::vector } void GeoFeatureGroupExtension::extensionOnChanged(const Property* p) { - + //objects are only allowed in a single GeoFeatureGroup if((strcmp(p->getName(), "Group")==0)) { - + bool error = false; auto corrected = Group.getValues(); for(auto obj : Group.getValues()) { - + //we have already set the obj into the group, so in a case of multiple groups getGroupOfObject //would return anyone of it and hence it is possible that we miss an error. We need a custom check auto list = obj->getInList(); @@ -205,14 +205,14 @@ void GeoFeatureGroupExtension::extensionOnChanged(const Property* p) { } } } - + //if an error was found we need to correct the values and inform the user if(error) { Group.setValues(corrected); throw Base::Exception("Object can only be in a single GeoFeatureGroup"); } } - + App::GroupExtension::extensionOnChanged(p); } @@ -221,13 +221,12 @@ std::vector< DocumentObject* > GeoFeatureGroupExtension::getScopedObjectsFromLin if(!obj) std::vector< DocumentObject* >(); - + //we get all linked objects. We can't use outList() as this includes the links from expressions std::vector< App::DocumentObject* > result; std::vector list; obj->getPropertyList(list); for(App::Property* prop : list) { - auto vec = getScopedObjectsFromLink(prop, scope); result.insert(result.end(), vec.begin(), vec.end()); } @@ -235,7 +234,7 @@ std::vector< DocumentObject* > GeoFeatureGroupExtension::getScopedObjectsFromLin //clear all null objects and douplicates std::sort(result.begin(), result.end()); result.erase(std::unique(result.begin(), result.end()), result.end()); - + return result; } @@ -243,35 +242,35 @@ std::vector< DocumentObject* > GeoFeatureGroupExtension::getScopedObjectsFromLin if(!prop) return std::vector< DocumentObject* >(); - + std::vector< App::DocumentObject* > result; - + if(prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId()) && static_cast(prop)->getScope() == scope) { result.push_back(static_cast(prop)->getValue()); } - + if(prop->getTypeId().isDerivedFrom(App::PropertyLinkList::getClassTypeId()) && static_cast(prop)->getScope() == scope) { - + auto vec = static_cast(prop)->getValues(); result.insert(result.end(), vec.begin(), vec.end()); } - + if(prop->getTypeId().isDerivedFrom(App::PropertyLinkSub::getClassTypeId()) && static_cast(prop)->getScope() == scope) { - + result.push_back(static_cast(prop)->getValue()); } - + if(prop->getTypeId().isDerivedFrom(App::PropertyLinkSubList::getClassTypeId()) && static_cast(prop)->getScope() == scope) { - + auto vec = static_cast(prop)->getValues(); result.insert(result.end(), vec.begin(), vec.end()); } - + //it is important to remove all nullptrs result.erase(std::remove(result.begin(), result.end(), nullptr), result.end()); return result; @@ -284,7 +283,7 @@ void GeoFeatureGroupExtension::getCSOutList(const App::DocumentObject* obj, if(!obj) return; - + //we get all relevant linked objects. We can't use outList() as this includes the links from expressions, //also we only want links with scope Local auto result = getScopedObjectsFromLinks(obj, LinkScope::Local); @@ -294,9 +293,9 @@ void GeoFeatureGroupExtension::getCSOutList(const App::DocumentObject* obj, return (obj->isDerivedFrom(App::OriginFeature::getClassTypeId()) || obj->isDerivedFrom(App::Origin::getClassTypeId())); }), result.end()); - + vec.insert(vec.end(), result.begin(), result.end()); - + //post process the vector std::sort(vec.begin(), vec.end()); vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); @@ -307,21 +306,21 @@ void GeoFeatureGroupExtension::getCSInList(const DocumentObject* obj, if(!obj) return; - + //search the inlist for objects that have non-expression links to us for(App::DocumentObject* parent : obj->getInList()) { - + //not interested in other groups (and here we mean all groups, normal ones and geofeaturegroup) if(parent->hasExtension(App::GroupExtension::getExtensionClassTypeId())) continue; - + //check if the link is real Local scope one or if it is a expression one (could also be both, so it is not //enough to check the expressions) auto res = getScopedObjectsFromLinks(parent, LinkScope::Local); if(std::find(res.begin(), res.end(), obj) != res.end()) vec.push_back(parent); } - + //clear all duplicates std::sort(vec.begin(), vec.end()); vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); @@ -331,12 +330,12 @@ std::vector< DocumentObject* > GeoFeatureGroupExtension::getCSRelevantLinks(cons if(!obj) return std::vector< DocumentObject* >(); - + //get all out links std::vector vec; - + recursiveCSRelevantLinks(obj, vec); - + //post process the list after we added many things std::sort(vec.begin(), vec.end()); vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); @@ -350,7 +349,7 @@ void GeoFeatureGroupExtension::recursiveCSRelevantLinks(const DocumentObject* ob if(!obj) return; - + std::vector< DocumentObject* > links; getCSOutList(obj, links); getCSInList(obj, links); @@ -359,7 +358,7 @@ void GeoFeatureGroupExtension::recursiveCSRelevantLinks(const DocumentObject* ob for(auto o : links) { if(!o || o == obj || std::find(vec.begin(), vec.end(), o) != vec.end()) continue; - + vec.push_back(o); recursiveCSRelevantLinks(o, vec); } @@ -367,10 +366,10 @@ void GeoFeatureGroupExtension::recursiveCSRelevantLinks(const DocumentObject* ob bool GeoFeatureGroupExtension::areLinksValid(const DocumentObject* obj) { - + if(!obj) return true; - + //no cross CS link for local links. //Base::Console().Message("Check object links: %s\n", obj->getNameInDocument()); std::vector list; @@ -381,20 +380,20 @@ bool GeoFeatureGroupExtension::areLinksValid(const DocumentObject* obj) { return false; } } - + return true; } bool GeoFeatureGroupExtension::isLinkValid(App::Property* prop) { - + if(!prop) return true; - + //get the object that holds the property if(!prop->getContainer()->isDerivedFrom(App::DocumentObject::getClassTypeId())) return true; //this link comes not from a document object, scopes are meaningless auto obj = static_cast(prop->getContainer()); - + //no cross CS link for local links. auto result = getScopedObjectsFromLink(prop, LinkScope::Local); auto group = getGroupOfObject(obj); @@ -402,7 +401,7 @@ bool GeoFeatureGroupExtension::isLinkValid(App::Property* prop) { if(getGroupOfObject(link) != group) return false; } - + //for links with scope SubGroup we need to check if all features are part of subgroups if(obj->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId())) { result = getScopedObjectsFromLink(prop, LinkScope::Child); @@ -412,7 +411,7 @@ bool GeoFeatureGroupExtension::isLinkValid(App::Property* prop) { return false; } } - + return true; } @@ -420,7 +419,7 @@ void GeoFeatureGroupExtension::getInvalidLinkObjects(const DocumentObject* obj, if(!obj) return; - + //no cross CS link for local links. auto result = getScopedObjectsFromLinks(obj, LinkScope::Local); auto group = obj->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId()) ? obj : getGroupOfObject(obj); @@ -428,7 +427,7 @@ void GeoFeatureGroupExtension::getInvalidLinkObjects(const DocumentObject* obj, if(getGroupOfObject(link) != group) vec.push_back(link); } - + //for links with scope SubGroup we need to check if all features are part of subgroups if(group) { result = getScopedObjectsFromLinks(obj, LinkScope::Child); diff --git a/src/App/GroupExtension.cpp b/src/App/GroupExtension.cpp index ce1d1083fa..9401320333 100644 --- a/src/App/GroupExtension.cpp +++ b/src/App/GroupExtension.cpp @@ -173,22 +173,22 @@ DocumentObject *GroupExtension::getObject(const char *Name) const bool GroupExtension::hasObject(const DocumentObject* obj, bool recursive) const { - + if(obj == getExtendedObject()) return false; - + const std::vector& grp = Group.getValues(); for (auto child : grp) { - + if(!child) continue; - + if (child == obj) { return true; } else if (child == getExtendedObject()) { Base::Exception("Cyclic dependencies detected: Search cannot be performed"); } else if ( recursive && child->hasExtension(GroupExtension::getExtensionClassTypeId()) ) { - + App::GroupExtension *subGroup = static_cast ( child->getExtension(GroupExtension::getExtensionClassTypeId())); std::vector history; @@ -210,25 +210,25 @@ bool GroupExtension::recursiveHasObject(const DocumentObject* obj, const GroupEx //we store every group we processed on the current leave of the tree, and if we reach an //already processed group we know that it not really is a tree but a cycle. history.push_back(this); - + //we use hasObject with out recursion to allow override in derived classes if(group->hasObject(obj, false)) return true; - + //we checked for the searched object already with hasObject and did not find it, now we need to //do the same for all subgroups for (auto child : group->Group.getValues()) { - + if(!child) continue; - + if ( child->hasExtension(GroupExtension::getExtensionClassTypeId()) ) { - + auto ext = child->getExtensionByType(); if(std::find(history.begin(), history.end(), ext) != history.end()) Base::Exception("Cyclic dependencies detected: Search cannot be performed"); - + if (recursiveHasObject(obj, ext, history)) { return true; } @@ -289,7 +289,7 @@ DocumentObject* GroupExtension::getGroupOfObject(const DocumentObject* obj) } PyObject* GroupExtension::getExtensionPyObject(void) { - + if (ExtensionPythonObject.is(Py::_None())){ // ref counter is set to 1 auto grp = new GroupExtensionPy(this); @@ -299,16 +299,16 @@ PyObject* GroupExtension::getExtensionPyObject(void) { } void GroupExtension::extensionOnChanged(const Property* p) { - + //objects are only allowed in a single group. Note that this check must only be done for normal //groups, not any derived classes if((this->getExtensionTypeId() == GroupExtension::getExtensionClassTypeId()) && (strcmp(p->getName(), "Group")==0)) { - + bool error = false; auto corrected = Group.getValues(); for(auto obj : Group.getValues()) { - + //we have already set the obj into the group, so in a case of multiple groups getGroupOfObject //would return anyone of it and hence it is possible that we miss an error. We need a custom check auto list = obj->getInList(); @@ -320,14 +320,14 @@ void GroupExtension::extensionOnChanged(const Property* p) { } } } - + //if an error was found we need to correct the values and inform the user if(error) { Group.setValues(corrected); throw Base::Exception("Object can only be in a single Group"); } } - + App::Extension::extensionOnChanged(p); } diff --git a/src/App/GroupExtensionPyImp.cpp b/src/App/GroupExtensionPyImp.cpp index dc04eb930f..09d73c4d63 100644 --- a/src/App/GroupExtensionPyImp.cpp +++ b/src/App/GroupExtensionPyImp.cpp @@ -133,11 +133,11 @@ PyObject* GroupExtensionPy::addObjects(PyObject *args) { PyObject* GroupExtensionPy::setObjects(PyObject *args) { - + PyObject *object; if (!PyArg_ParseTuple(args, "O", &object)) // convert args: Python->C return NULL; // NULL triggers exception - + if (PyTuple_Check(object) || PyList_Check(object)) { Py::Sequence list(object); Py::Sequence::size_type size = list.size(); @@ -167,7 +167,7 @@ PyObject* GroupExtensionPy::setObjects(PyObject *args) { std::string error = std::string("type must be list of 'DocumentObject', not "); error += object->ob_type->tp_name; throw Base::TypeError(error); -}; +} PyObject* GroupExtensionPy::removeObject(PyObject *args) { @@ -196,7 +196,7 @@ PyObject* GroupExtensionPy::removeObject(PyObject *args) } PyObject* GroupExtensionPy::removeObjects(PyObject *args) { - + PyObject *object; if (!PyArg_ParseTuple(args, "O", &object)) // convert args: Python->C return NULL; // NULL triggers exception @@ -226,11 +226,11 @@ PyObject* GroupExtensionPy::removeObjects(PyObject *args) { return Py::new_reference_to(result); } - + std::string error = std::string("type must be list of 'DocumentObject', not "); error += object->ob_type->tp_name; throw Base::TypeError(error); -}; +} PyObject* GroupExtensionPy::removeObjectsFromDocument(PyObject *args) { @@ -294,4 +294,3 @@ int GroupExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj* { return 0; } - diff --git a/src/App/OriginGroupExtension.cpp b/src/App/OriginGroupExtension.cpp index 80b1dbf665..4cf4d36533 100644 --- a/src/App/OriginGroupExtension.cpp +++ b/src/App/OriginGroupExtension.cpp @@ -35,12 +35,12 @@ using namespace App; -EXTENSION_PROPERTY_SOURCE(App::OriginGroupExtension, App::GeoFeatureGroupExtension); +EXTENSION_PROPERTY_SOURCE(App::OriginGroupExtension, App::GeoFeatureGroupExtension) OriginGroupExtension::OriginGroupExtension () { - + initExtensionType(OriginGroupExtension::getExtensionClassTypeId()); - + EXTENSION_ADD_PROPERTY_TYPE ( Origin, (0), 0, App::Prop_Hidden, "Origin linked to the group" ); Origin.setScope(LinkScope::Child); } @@ -67,7 +67,7 @@ App::Origin *OriginGroupExtension::getOrigin () const { } App::DocumentObject *OriginGroupExtension::getGroupOfObject (const DocumentObject* obj) { - + if(!obj) return nullptr; @@ -186,18 +186,18 @@ void OriginGroupExtension::relinkToOrigin(App::DocumentObject* obj) } std::vector< DocumentObject* > OriginGroupExtension::addObjects(std::vector objs) { - + for(auto obj : objs) relinkToOrigin(obj); - + return App::GeoFeatureGroupExtension::addObjects(objs); } bool OriginGroupExtension::hasObject(const DocumentObject* obj, bool recursive) const { - + if(Origin.getValue() && (obj == getOrigin() || getOrigin()->hasObject(obj))) return true; - + return App::GroupExtension::hasObject(obj, recursive); } diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 4e9a278e7e..ee520be8bd 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -635,19 +635,19 @@ void PropertyLinkSubList::setValues(const std::vector& lValue,c #ifndef USE_OLD_DAG //maintain backlinks. if(getContainer() && getContainer()->isDerivedFrom(App::DocumentObject::getClassTypeId())) { - + //_lValueList can contain items multiple times, but we trust the document //object to ensure that this works for(auto *obj : _lValueList) obj->_removeBackLink(static_cast(getContainer())); - + //maintain backlinks. lValue can contain items multiple times, but we trust the document //object to ensure that the backlink is only added once for(auto *obj : lValue) obj->_addBackLink(static_cast(getContainer())); } #endif - + aboutToSetValue(); _lValueList = lValue; _lSubList.resize(lSubNames.size()); @@ -665,19 +665,19 @@ void PropertyLinkSubList::setValues(const std::vector& lValue,c #ifndef USE_OLD_DAG //maintain backlinks. if(getContainer() && getContainer()->isDerivedFrom(App::DocumentObject::getClassTypeId())) { - + //_lValueList can contain items multiple times, but we trust the document //object to ensure that this works for(auto *obj : _lValueList) obj->_removeBackLink(static_cast(getContainer())); - + //maintain backlinks. lValue can contain items multiple times, but we trust the document //object to ensure that the backlink is only added once for(auto *obj : lValue) obj->_addBackLink(static_cast(getContainer())); } #endif - + aboutToSetValue(); _lValueList = lValue; _lSubList = lSubNames; @@ -689,19 +689,19 @@ void PropertyLinkSubList::setValue(DocumentObject* lValue, const std::vectorisDerivedFrom(App::DocumentObject::getClassTypeId())) { - + //_lValueList can contain items multiple times, but we trust the document //object to ensure that this works for(auto *obj : _lValueList) obj->_removeBackLink(static_cast(getContainer())); - + //maintain backlinks. lValue can contain items multiple times, but we trust the document //object to ensure that the backlink is only added once if(lValue) lValue->_addBackLink(static_cast(getContainer())); } #endif - + aboutToSetValue(); std::size_t size = SubList.size(); this->_lValueList.clear(); diff --git a/src/App/PropertyLinks.h b/src/App/PropertyLinks.h index efa11ed95d..37e2202f06 100644 --- a/src/App/PropertyLinks.h +++ b/src/App/PropertyLinks.h @@ -389,7 +389,7 @@ public: virtual void Paste(const Property &from); virtual unsigned int getMemSize (void) const; - + private: //FIXME: Do not make two independent lists because this will lead to some inconsistencies! std::vector _lValueList; diff --git a/src/App/Transactions.cpp b/src/App/Transactions.cpp index 6a1c6378cf..f25d517531 100644 --- a/src/App/Transactions.cpp +++ b/src/App/Transactions.cpp @@ -339,16 +339,15 @@ TransactionDocumentObject::~TransactionDocumentObject() void TransactionDocumentObject::applyDel(Document &Doc, TransactionalObject *pcObj) { if (status == Del) { - DocumentObject* obj = static_cast(pcObj); //Make sure the backlinks of all linked objects are updated. As the links of the removed //object are never set to [] they also do not remove the backlink. But as they are //not in the document anymore we need to remove them anyway to ensure a correct graph auto list = obj->getOutList(); - for(auto link : list) + for (auto link : list) link->_removeBackLink(obj); - + // simply filling in the saved object Doc._remObject(obj); } @@ -362,7 +361,7 @@ void TransactionDocumentObject::applyNew(Document &Doc, TransactionalObject *pcO //make sure the backlinks of all linked objects are updated auto list = obj->getOutList(); - for(auto link : list) + for (auto link : list) link->_addBackLink(obj); } } diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 52fefe2476..490c7deee0 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1296,9 +1296,8 @@ QMimeData * MainWindow::createMimeDataFromSelection () const sel.insert(sel.end(), it->second.begin(), it->second.end()); all.insert(all.end(), dep.begin(), dep.end()); } - + if (all.size() > sel.size()) { - //check if selection are only geofeaturegroup objects, for them it is intuitive and wanted to copy the //dependencies bool hasGroup = false, hasNormal = false; diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 0c7fe2c208..bd23e828e9 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -1164,7 +1164,7 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh) { // other parents not expanded yet. We don't want to traverse the // whole tree to confirm that. Just let it be. If the other // parent(s) later expanded, this child item will be moved from - // root to its parent. + // root to its parent. if(obj->myselves->size()==1) { // We only make a difference for geofeaturegroups, // as otherwise it comes to confusing behavior to the user when things @@ -1181,17 +1181,17 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh) { } void DocumentItem::slotChangeObject(const Gui::ViewProviderDocumentObject& view) -{ +{ QString displayName = QString::fromUtf8(view.getObject()->Label.getValue()); FOREACH_ITEM(item,view) item->setText(0, displayName); populateItem(item, true); END_FOREACH_ITEM - + //if the item is in a GeoFeatureGroup we may need to update that too, as the claim children //of the geofeaturegroup depends on what the childs claim auto grp = App::GeoFeatureGroupExtension::getGroupOfObject(view.getObject()); - if(grp) { + if (grp) { FOREACH_ITEM_NAME(item, grp->getNameInDocument()) populateItem(item, true); END_FOREACH_ITEM diff --git a/src/Gui/ViewProviderDocumentObjectGroup.cpp b/src/Gui/ViewProviderDocumentObjectGroup.cpp index a86f30104e..d94ca8cfb6 100644 --- a/src/Gui/ViewProviderDocumentObjectGroup.cpp +++ b/src/Gui/ViewProviderDocumentObjectGroup.cpp @@ -59,7 +59,7 @@ ViewProviderDocumentObjectGroup::ViewProviderDocumentObjectGroup() setDefaultMode(SO_SWITCH_ALL); #endif ViewProviderGroupExtension::initExtension(this); - + sPixmap = "Group.svg"; } diff --git a/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp b/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp index a5ed151dec..cbc19ff869 100644 --- a/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp +++ b/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp @@ -55,7 +55,7 @@ ViewProviderGeoFeatureGroupExtension::~ViewProviderGeoFeatureGroupExtension() std::vector ViewProviderGeoFeatureGroupExtension::extensionClaimChildren3D(void) const { - + //all object in the group must be claimed in 3D, as we are a coordinate system for all of them auto* ext = getExtendedViewProvider()->getObject()->getExtensionByType(); if(ext) { @@ -66,7 +66,7 @@ std::vector ViewProviderGeoFeatureGroupExtension::extensio } std::vector ViewProviderGeoFeatureGroupExtension::extensionClaimChildren(void) const { - + //we must be careful which objects to claim, as there might be stacked relations inside the coordinate system, //like pad/sketch auto* ext = getExtendedViewProvider()->getObject()->getExtensionByType(); @@ -75,11 +75,11 @@ std::vector ViewProviderGeoFeatureGroupExtension::extensio //object in the tree std::vector claim; auto objs = ext->Group.getValues(); - + for(auto obj : objs) { - + auto vin = obj->getInList(); - + //we don't want to count objects that are deleted or part of other geo feature groups. //Second criteria is actually not possible in normal operation, but only in some error //condition. But then it is needed to understand the problem for the user diff --git a/src/Gui/ViewProviderPart.cpp b/src/Gui/ViewProviderPart.cpp index 4171b78a51..9b75917b8e 100644 --- a/src/Gui/ViewProviderPart.cpp +++ b/src/Gui/ViewProviderPart.cpp @@ -52,7 +52,7 @@ PROPERTY_SOURCE_WITH_EXTENSIONS(Gui::ViewProviderPart, Gui::ViewProviderDocument ViewProviderPart::ViewProviderPart() { initExtension(this); - + sPixmap = "Geofeaturegroup.svg"; } diff --git a/src/Mod/Part/App/BodyBase.cpp b/src/Mod/Part/App/BodyBase.cpp index a04b82dbd5..3653b17f3d 100644 --- a/src/Mod/Part/App/BodyBase.cpp +++ b/src/Mod/Part/App/BodyBase.cpp @@ -42,9 +42,9 @@ BodyBase::BodyBase() { ADD_PROPERTY(Tip , (0) ); Tip.setScope(App::LinkScope::Child); - + ADD_PROPERTY(BaseFeature , (0) ); - + App::OriginGroupExtension::initExtension(this); } diff --git a/src/Mod/PartDesign/App/FeatureBoolean.cpp b/src/Mod/PartDesign/App/FeatureBoolean.cpp index 4ad361912b..bc0a6c68ee 100644 --- a/src/Mod/PartDesign/App/FeatureBoolean.cpp +++ b/src/Mod/PartDesign/App/FeatureBoolean.cpp @@ -54,7 +54,7 @@ Boolean::Boolean() { ADD_PROPERTY(Type,((long)0)); Type.setEnums(TypeEnums); - + initExtension(this); } @@ -82,7 +82,7 @@ App::DocumentObjectExecReturn *Boolean::execute(void) Part::TopoShape baseTopShape = baseFeature->Shape.getShape(); if (baseTopShape.getShape().IsNull()) return new App::DocumentObjectExecReturn("Cannot do boolean operation with invalid base shape"); - + //get the body this boolean feature belongs to Part::BodyBase* baseBody = Part::BodyBase::findBodyOf(this); @@ -145,10 +145,8 @@ void Boolean::onChanged(const App::Property* prop) { if(strcmp(prop->getName(), "Group") == 0) touch(); - + PartDesign::Feature::onChanged(prop); } - - }