improve whitespaces

This commit is contained in:
wmayer
2018-01-22 20:06:12 +01:00
parent 90cd417fe4
commit b863d1df75
3 changed files with 57 additions and 66 deletions

View File

@@ -330,7 +330,6 @@ void Body::insertObject(App::DocumentObject* feature, App::DocumentObject* targe
// Set the BaseFeature property
setBaseProperty(feature);
}
void Body::setBaseProperty(App::DocumentObject* feature)
@@ -340,7 +339,7 @@ void Body::setBaseProperty(App::DocumentObject* feature)
App::DocumentObject* prevSolidFeature = getPrevSolidFeature(feature);
// NULL is ok here, it just means we made the current one fiature the base solid
static_cast<PartDesign::Feature*>(feature)->BaseFeature.setValue(prevSolidFeature);
// Reroute the next solid feature's BaseFeature property to this feature
App::DocumentObject* nextSolidFeature = getNextSolidFeature(feature);
if (nextSolidFeature) {

View File

@@ -85,7 +85,7 @@ public:
void insertObject(App::DocumentObject* feature, App::DocumentObject* target, bool after=false);
void setBaseProperty(App::DocumentObject* feature);
/// Remove the feature from the body
virtual std::vector<DocumentObject*> removeObject(DocumentObject* obj) override;
@@ -110,7 +110,7 @@ public:
* all features derived from PartDesign::Feature and Part::Datum and sketches
*/
static bool isAllowed(const App::DocumentObject* f);
virtual bool allowObject(DocumentObject* f) override {return isAllowed(f);};
virtual bool allowObject(DocumentObject* f) override {return isAllowed(f);}
/**
* Return the body which this feature belongs too, or NULL

View File

@@ -201,16 +201,13 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
rejected.clear();
std::vector<App::DocumentObject*> originals = Originals.getValues();
if (originals.empty()) {// typically InsideMultiTransform
if (originals.empty()) // typically InsideMultiTransform
return App::DocumentObject::StdReturn;
}
else {
if(!this->BaseFeature.getValue()) {
auto body = getFeatureBody();
if(body) {
body->setBaseProperty(this);
}
if(!this->BaseFeature.getValue()) {
auto body = getFeatureBody();
if(body) {
body->setBaseProperty(this);
}
}
@@ -409,61 +406,56 @@ TopoDS_Shape Transformed::refineShapeIfActive(const TopoDS_Shape& oldShape) cons
void Transformed::divideTools(const std::vector<TopoDS_Shape> &toolsIn, std::vector<TopoDS_Shape> &individualsOut,
TopoDS_Compound &compoundOut) const
{
typedef std::pair<TopoDS_Shape, Bnd_Box> ShapeBoundPair;
typedef std::list<ShapeBoundPair> PairList;
typedef std::vector<ShapeBoundPair> PairVector;
PairList pairList;
std::vector<TopoDS_Shape>::const_iterator it;
for (it = toolsIn.begin(); it != toolsIn.end(); ++it)
{
Bnd_Box bound;
BRepBndLib::Add(*it, bound);
bound.SetGap(0.0);
ShapeBoundPair temp = std::make_pair(*it, bound);
pairList.push_back(temp);
}
BRep_Builder builder;
builder.MakeCompound(compoundOut);
while(!pairList.empty())
{
PairVector currentGroup;
currentGroup.push_back(pairList.front());
pairList.pop_front();
PairList::iterator it = pairList.begin();
while(it != pairList.end())
{
PairVector::const_iterator groupIt;
bool found(false);
for (groupIt = currentGroup.begin(); groupIt != currentGroup.end(); ++groupIt)
{
if (!(*it).second.IsOut((*groupIt).second))//touching means is out.
{
found = true;
break;
}
}
if (found)
{
currentGroup.push_back(*it);
pairList.erase(it);
it=pairList.begin();
continue;
}
it++;
typedef std::pair<TopoDS_Shape, Bnd_Box> ShapeBoundPair;
typedef std::list<ShapeBoundPair> PairList;
typedef std::vector<ShapeBoundPair> PairVector;
PairList pairList;
std::vector<TopoDS_Shape>::const_iterator it;
for (it = toolsIn.begin(); it != toolsIn.end(); ++it) {
Bnd_Box bound;
BRepBndLib::Add(*it, bound);
bound.SetGap(0.0);
ShapeBoundPair temp = std::make_pair(*it, bound);
pairList.push_back(temp);
}
if (currentGroup.size() == 1)
builder.Add(compoundOut, currentGroup.front().first);
else
{
PairVector::const_iterator groupIt;
for (groupIt = currentGroup.begin(); groupIt != currentGroup.end(); ++groupIt)
individualsOut.push_back((*groupIt).first);
BRep_Builder builder;
builder.MakeCompound(compoundOut);
while(!pairList.empty()) {
PairVector currentGroup;
currentGroup.push_back(pairList.front());
pairList.pop_front();
PairList::iterator it = pairList.begin();
while(it != pairList.end()) {
PairVector::const_iterator groupIt;
bool found(false);
for (groupIt = currentGroup.begin(); groupIt != currentGroup.end(); ++groupIt) {
if (!(*it).second.IsOut((*groupIt).second)) {//touching means is out.
found = true;
break;
}
}
if (found) {
currentGroup.push_back(*it);
pairList.erase(it);
it=pairList.begin();
continue;
}
++it;
}
if (currentGroup.size() == 1) {
builder.Add(compoundOut, currentGroup.front().first);
}
else {
PairVector::const_iterator groupIt;
for (groupIt = currentGroup.begin(); groupIt != currentGroup.end(); ++groupIt)
individualsOut.push_back((*groupIt).first);
}
}
}
}
}