+ Prefer prefix ++/-- operators for non-primitive types
This commit is contained in:
@@ -55,7 +55,7 @@ void MultiTransform::positionBySupport(void)
|
||||
PartDesign::Transformed::positionBySupport();
|
||||
std::vector<App::DocumentObject*> transFeatures = Transformations.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator f = transFeatures.begin();
|
||||
f != transFeatures.end(); f++) {
|
||||
f != transFeatures.end(); ++f) {
|
||||
if (!((*f)->getTypeId().isDerivedFrom(PartDesign::Transformed::getClassTypeId())))
|
||||
throw Base::Exception("Transformation features must be subclasses of Transformed");
|
||||
PartDesign::Transformed* transFeature = static_cast<PartDesign::Transformed*>(*f);
|
||||
@@ -95,7 +95,7 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
|
||||
std::list<gp_Pnt> cogs;
|
||||
std::vector<App::DocumentObject*>::const_iterator f;
|
||||
|
||||
for (f = transFeatures.begin(); f != transFeatures.end(); f++) {
|
||||
for (f = transFeatures.begin(); f != transFeatures.end(); ++f) {
|
||||
if (!((*f)->getTypeId().isDerivedFrom(PartDesign::Transformed::getClassTypeId())))
|
||||
throw Base::Exception("Transformation features must be subclasses of Transformed");
|
||||
PartDesign::Transformed* transFeature = static_cast<PartDesign::Transformed*>(*f);
|
||||
@@ -104,7 +104,7 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
|
||||
if (result.empty()) {
|
||||
// First transformation Feature
|
||||
result = newTransformations;
|
||||
for (std::list<gp_Trsf>::const_iterator nt = newTransformations.begin(); nt != newTransformations.end(); nt++) {
|
||||
for (std::list<gp_Trsf>::const_iterator nt = newTransformations.begin(); nt != newTransformations.end(); ++nt) {
|
||||
cogs.push_back(cog.Transformed(*nt));
|
||||
}
|
||||
} else {
|
||||
@@ -132,7 +132,7 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
|
||||
std::list<gp_Trsf>::const_iterator ot = oldTransformations.begin();
|
||||
std::list<gp_Pnt>::const_iterator oc = oldCogs.begin();
|
||||
|
||||
for (std::list<gp_Trsf>::const_iterator nt = newTransformations.begin(); nt != newTransformations.end(); nt++) {
|
||||
for (std::list<gp_Trsf>::const_iterator nt = newTransformations.begin(); nt != newTransformations.end(); ++nt) {
|
||||
for (unsigned s = 0; s < sliceLength; s++) {
|
||||
gp_Trsf trans;
|
||||
double factor = nt->ScaleFactor(); // extract scale factor
|
||||
@@ -146,8 +146,8 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
|
||||
cogs.push_back(oc->Transformed(*nt));
|
||||
}
|
||||
result.push_back(trans);
|
||||
ot++;
|
||||
oc++;
|
||||
++ot;
|
||||
++oc;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -157,13 +157,13 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
|
||||
// a11 a12 b1 a11*b1 a12*b1 a11*b2 a12*b2 a11*b3 a12*b3
|
||||
// a21 a22 mul b2 = a21*b1 a22*b1 a21*b2 a22*b2 a21*b3 a22*b3
|
||||
// b3
|
||||
for (std::list<gp_Trsf>::const_iterator nt = newTransformations.begin(); nt != newTransformations.end(); nt++) {
|
||||
for (std::list<gp_Trsf>::const_iterator nt = newTransformations.begin(); nt != newTransformations.end(); ++nt) {
|
||||
std::list<gp_Pnt>::const_iterator oc = oldCogs.begin();
|
||||
|
||||
for (std::list<gp_Trsf>::const_iterator ot = oldTransformations.begin(); ot != oldTransformations.end(); ot++) {
|
||||
for (std::list<gp_Trsf>::const_iterator ot = oldTransformations.begin(); ot != oldTransformations.end(); ++ot) {
|
||||
result.push_back((*nt) * (*ot));
|
||||
cogs.push_back(oc->Transformed(*nt));
|
||||
oc++;
|
||||
++oc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
// Original separately. This way it is easier to discover what feature causes a fuse/cut
|
||||
// to fail. The downside is that performance suffers when there are many originals. But it seems
|
||||
// safe to assume that in most cases there are few originals and many transformations
|
||||
for (std::vector<App::DocumentObject*>::const_iterator o = originals.begin(); o != originals.end(); o++)
|
||||
for (std::vector<App::DocumentObject*>::const_iterator o = originals.begin(); o != originals.end(); ++o)
|
||||
{
|
||||
// Extract the original shape and determine whether to cut or to fuse
|
||||
TopoDS_Shape shape;
|
||||
@@ -234,8 +234,8 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
std::vector<TopoDS_Shape> v_transformedShapes;
|
||||
|
||||
std::vector<gp_Trsf>::const_iterator t = transformations.begin();
|
||||
t++; // Skip first transformation, which is always the identity transformation
|
||||
for (; t != transformations.end(); t++) {
|
||||
++t; // Skip first transformation, which is always the identity transformation
|
||||
for (; t != transformations.end(); ++t) {
|
||||
// Make an explicit copy of the shape because the "true" parameter to BRepBuilderAPI_Transform
|
||||
// seems to be pretty broken
|
||||
BRepBuilderAPI_Copy copy(shape);
|
||||
@@ -281,10 +281,10 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
|
||||
std::vector<TopoDS_Shape>::iterator s1 = v_transformedShapes.begin();
|
||||
std::vector<TopoDS_Shape>::iterator s2 = s1;
|
||||
s2++;
|
||||
++s2;
|
||||
std::vector<std::vector<gp_Trsf>::const_iterator>::const_iterator t1 = v_transformations.begin();
|
||||
std::vector<std::vector<gp_Trsf>::const_iterator>::const_iterator t2 = t1;
|
||||
t2++;
|
||||
++t2;
|
||||
for (; s2 != v_transformedShapes.end();) {
|
||||
// Check intersection with the original
|
||||
if (Part::checkIntersection(shape, *s1, false, false)) {
|
||||
@@ -292,19 +292,19 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
overlapping_trsfms.insert(*t1);
|
||||
}
|
||||
// Check intersection with other transformations
|
||||
for (; s2 != v_transformedShapes.end(); s2++, t2++)
|
||||
for (; s2 != v_transformedShapes.end(); ++s2, ++t2)
|
||||
if (Part::checkIntersection(*s1, *s2, false, false)) {
|
||||
rejected_iterators.insert(s1);
|
||||
rejected_iterators.insert(s2);
|
||||
overlapping_trsfms.insert(*t1);
|
||||
overlapping_trsfms.insert(*t2);
|
||||
}
|
||||
s1++;
|
||||
++s1;
|
||||
s2 = s1;
|
||||
s2++;
|
||||
t1++;
|
||||
++s2;
|
||||
++t1;
|
||||
t2 = t1;
|
||||
t2++;
|
||||
++t2;
|
||||
}
|
||||
// Check intersection of last transformation with the original
|
||||
if (Part::checkIntersection(shape, *s1, false, false)) {
|
||||
@@ -313,7 +313,7 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
}
|
||||
|
||||
for (std::set<std::vector<TopoDS_Shape>::iterator>::reverse_iterator it = rejected_iterators.rbegin();
|
||||
it != rejected_iterators.rend(); it++)
|
||||
it != rejected_iterators.rend(); ++it)
|
||||
v_transformedShapes.erase(*it);
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
BRep_Builder builder;
|
||||
TopoDS_Compound transformedShapes;
|
||||
builder.MakeCompound(transformedShapes);
|
||||
for (std::vector<TopoDS_Shape>::const_iterator s = v_transformedShapes.begin(); s != v_transformedShapes.end(); s++)
|
||||
for (std::vector<TopoDS_Shape>::const_iterator s = v_transformedShapes.begin(); s != v_transformedShapes.end(); ++s)
|
||||
builder.Add(transformedShapes, *s);
|
||||
|
||||
// Fuse/Cut the compounded transformed shapes with the support
|
||||
@@ -354,11 +354,11 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
if (!overlapping_trsfms.empty())
|
||||
// Concentrate on overlapping shapes since they are more serious
|
||||
for (std::set<std::vector<gp_Trsf>::const_iterator>::const_iterator it = overlapping_trsfms.begin();
|
||||
it != overlapping_trsfms.end(); it++)
|
||||
it != overlapping_trsfms.end(); ++it)
|
||||
rejected.push_back(**it);
|
||||
else
|
||||
for (std::set<std::vector<gp_Trsf>::const_iterator>::const_iterator it = nointersect_trsfms.begin();
|
||||
it != nointersect_trsfms.end(); it++)
|
||||
it != nointersect_trsfms.end(); ++it)
|
||||
rejected.push_back(**it);
|
||||
|
||||
this->Shape.setValue(support);
|
||||
|
||||
Reference in New Issue
Block a user