Part: fix typos in make* functions
This commit is contained in:
@@ -449,9 +449,9 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
|
||||
continue;
|
||||
}else{
|
||||
if(link && !link->getShowElementValue())
|
||||
shape = baseShape.makETransform(mat,(TopoShape::indexPostfix()+childName).c_str());
|
||||
shape = baseShape.makeTransform(mat,(TopoShape::indexPostfix()+childName).c_str());
|
||||
else {
|
||||
shape = baseShape.makETransform(mat);
|
||||
shape = baseShape.makeTransform(mat);
|
||||
// shape.reTagElementMap(subObj->getID(),subObj->getDocument()->getStringHasher());
|
||||
}
|
||||
}
|
||||
@@ -466,7 +466,7 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
|
||||
|
||||
// shape.Tag = tag;
|
||||
// shape.Hasher = hasher;
|
||||
shape.makECompound(shapes);
|
||||
shape.makeCompound(shapes);
|
||||
}
|
||||
|
||||
_ShapeCache.setShape(owner,shape);
|
||||
|
||||
@@ -3162,7 +3162,7 @@ void TopoShape::transformGeometry(const Base::Matrix4D &rclMat)
|
||||
if (this->_Shape.IsNull())
|
||||
Standard_Failure::Raise("Cannot transform null shape");
|
||||
|
||||
*this = makEGTransform(rclMat);
|
||||
*this = makeGTransform(rclMat);
|
||||
}
|
||||
|
||||
TopoDS_Shape TopoShape::transformGShape(const Base::Matrix4D& rclTrf) const
|
||||
@@ -3194,7 +3194,7 @@ bool TopoShape::transformShape(const Base::Matrix4D& rclTrf, bool copy, bool che
|
||||
if (this->_Shape.IsNull())
|
||||
Standard_Failure::Raise("Cannot transform null shape");
|
||||
|
||||
return _makETransform(TopoShape(*this),rclTrf,0,checkScale,copy);
|
||||
return _makeTransform(TopoShape(*this),rclTrf,0,checkScale,copy);
|
||||
}
|
||||
|
||||
TopoDS_Shape TopoShape::mirror(const gp_Ax2& ax2) const
|
||||
@@ -4056,7 +4056,7 @@ TopoDS_Shape TopoShape::makeShell(const TopoDS_Shape& input) const
|
||||
#define HANDLE_NULL_INPUT _HANDLE_NULL_SHAPE("Null input shape",true)
|
||||
#define WARN_NULL_INPUT _HANDLE_NULL_SHAPE("Null input shape",false)
|
||||
|
||||
TopoShape &TopoShape::makEWires(const TopoShape &shape, const char *op, bool fix, double tol)
|
||||
TopoShape &TopoShape::makeWires(const TopoShape &shape, const char *op, bool fix, double tol)
|
||||
{
|
||||
_Shape.Nullify();
|
||||
|
||||
@@ -4124,10 +4124,10 @@ TopoShape &TopoShape::makEWires(const TopoShape &shape, const char *op, bool fix
|
||||
// Now retrieve the shape and set it without touching element map
|
||||
wires.back().setShape(aFix.Wire());
|
||||
}
|
||||
return makECompound(wires,0,false);
|
||||
return makeCompound(wires,0,false);
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makECompound(const std::vector<TopoShape> &shapes, const char *op, bool force)
|
||||
TopoShape &TopoShape::makeCompound(const std::vector<TopoShape> &shapes, const char *op, bool force)
|
||||
{
|
||||
(void)op;
|
||||
_Shape.Nullify();
|
||||
@@ -4158,7 +4158,7 @@ TopoShape &TopoShape::makECompound(const std::vector<TopoShape> &shapes, const c
|
||||
return *this;
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makEFace(const TopoShape &shape, const char *op, const char *maker)
|
||||
TopoShape &TopoShape::makeFace(const TopoShape &shape, const char *op, const char *maker)
|
||||
{
|
||||
std::vector<TopoShape> shapes;
|
||||
if(shape.shapeType() == TopAbs_COMPOUND) {
|
||||
@@ -4166,15 +4166,17 @@ TopoShape &TopoShape::makEFace(const TopoShape &shape, const char *op, const cha
|
||||
shapes.push_back(it.Value());
|
||||
} else
|
||||
shapes.push_back(shape);
|
||||
return makEFace(shapes,op,maker);
|
||||
return makeFace(shapes,op,maker);
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makEFace(const std::vector<TopoShape> &shapes, const char *op, const char *maker)
|
||||
TopoShape &TopoShape::makeFace(const std::vector<TopoShape> &shapes, const char *op, const char *maker)
|
||||
{
|
||||
(void)op;
|
||||
_Shape.Nullify();
|
||||
|
||||
if(!maker || !maker[0]) maker = "Part::FaceMakerBullseye";
|
||||
if(!maker || !maker[0])
|
||||
maker = "Part::FaceMakerBullseye";
|
||||
|
||||
std::unique_ptr<FaceMaker> mkFace = FaceMaker::ConstructFromType(maker);
|
||||
for(auto &s : shapes) {
|
||||
if (s.getShape().ShapeType() == TopAbs_COMPOUND)
|
||||
@@ -4187,7 +4189,7 @@ TopoShape &TopoShape::makEFace(const std::vector<TopoShape> &shapes, const char
|
||||
return *this;
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makERefine(const TopoShape &shape, const char *op, bool no_fail) {
|
||||
TopoShape &TopoShape::makeRefine(const TopoShape &shape, const char *op, bool no_fail) {
|
||||
(void)op;
|
||||
_Shape.Nullify();
|
||||
if(shape.isNull()) {
|
||||
@@ -4293,21 +4295,21 @@ bool TopoShape::isCoplanar(const TopoShape &other, double tol) const {
|
||||
return pln1.Position().IsCoplanar(pln2.Position(),tol,tol);
|
||||
}
|
||||
|
||||
bool TopoShape::_makETransform(const TopoShape &shape,
|
||||
bool TopoShape::_makeTransform(const TopoShape &shape,
|
||||
const Base::Matrix4D &rclTrf, const char *op, bool checkScale, bool copy)
|
||||
{
|
||||
if(checkScale) {
|
||||
auto type = rclTrf.hasScale();
|
||||
if (type != Base::ScaleType::Uniform && type != Base::ScaleType::NoScaling) {
|
||||
makEGTransform(shape,rclTrf,op,copy);
|
||||
makeGTransform(shape,rclTrf,op,copy);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
makETransform(shape,convert(rclTrf),op,copy);
|
||||
makeTransform(shape,convert(rclTrf),op,copy);
|
||||
return false;
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makETransform(const TopoShape &shape, const gp_Trsf &trsf, const char *op, bool copy) {
|
||||
TopoShape &TopoShape::makeTransform(const TopoShape &shape, const gp_Trsf &trsf, const char *op, bool copy) {
|
||||
// resetElementMap();
|
||||
|
||||
if(!copy) {
|
||||
@@ -4336,7 +4338,7 @@ TopoShape &TopoShape::makETransform(const TopoShape &shape, const gp_Trsf &trsf,
|
||||
return *this;
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makEGTransform(const TopoShape &shape,
|
||||
TopoShape &TopoShape::makeGTransform(const TopoShape &shape,
|
||||
const Base::Matrix4D &rclTrf, const char *op, bool copy)
|
||||
{
|
||||
(void)op;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <App/ComplexGeoData.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <Mod/Part/PartGlobal.h>
|
||||
|
||||
class gp_Ax1;
|
||||
class gp_Ax2;
|
||||
@@ -311,34 +312,34 @@ public:
|
||||
* To be complete in next batch of patches
|
||||
*/
|
||||
//@{
|
||||
TopoShape &makECompound(const std::vector<TopoShape> &shapes, const char *op=0, bool force=true);
|
||||
TopoShape &makeCompound(const std::vector<TopoShape> &shapes, const char *op=0, bool force=true);
|
||||
|
||||
TopoShape &makEWires(const TopoShape &shape, const char *op=0, bool fix=false, double tol=0.0);
|
||||
TopoShape makEWires(const char *op=0, bool fix=false, double tol=0.0) const {
|
||||
return TopoShape().makEWires(*this,op,fix,tol);
|
||||
TopoShape &makeWires(const TopoShape &shape, const char *op=0, bool fix=false, double tol=0.0);
|
||||
TopoShape makeWires(const char *op=0, bool fix=false, double tol=0.0) const {
|
||||
return TopoShape().makeWires(*this,op,fix,tol);
|
||||
}
|
||||
TopoShape &makEFace(const std::vector<TopoShape> &shapes, const char *op=0, const char *maker=0);
|
||||
TopoShape &makEFace(const TopoShape &shape, const char *op=0, const char *maker=0);
|
||||
TopoShape makEFace(const char *op=0, const char *maker=0) const {
|
||||
return TopoShape().makEFace(*this,op,maker);
|
||||
TopoShape &makeFace(const std::vector<TopoShape> &shapes, const char *op=0, const char *maker=0);
|
||||
TopoShape &makeFace(const TopoShape &shape, const char *op=0, const char *maker=0);
|
||||
TopoShape makeFace(const char *op=0, const char *maker=0) const {
|
||||
return TopoShape().makeFace(*this,op,maker);
|
||||
}
|
||||
bool _makETransform(const TopoShape &shape, const Base::Matrix4D &mat,
|
||||
bool _makeTransform(const TopoShape &shape, const Base::Matrix4D &mat,
|
||||
const char *op=0, bool checkScale=false, bool copy=false);
|
||||
|
||||
TopoShape &makETransform(const TopoShape &shape, const Base::Matrix4D &mat,
|
||||
TopoShape &makeTransform(const TopoShape &shape, const Base::Matrix4D &mat,
|
||||
const char *op=0, bool checkScale=false, bool copy=false) {
|
||||
_makETransform(shape,mat,op,checkScale,copy);
|
||||
_makeTransform(shape,mat,op,checkScale,copy);
|
||||
return *this;
|
||||
}
|
||||
TopoShape makETransform(const Base::Matrix4D &mat, const char *op=0,
|
||||
TopoShape makeTransform(const Base::Matrix4D &mat, const char *op=0,
|
||||
bool checkScale=false, bool copy=false) const {
|
||||
return TopoShape().makETransform(*this,mat,op,checkScale,copy);
|
||||
return TopoShape().makeTransform(*this,mat,op,checkScale,copy);
|
||||
}
|
||||
|
||||
TopoShape &makETransform(const TopoShape &shape, const gp_Trsf &trsf,
|
||||
TopoShape &makeTransform(const TopoShape &shape, const gp_Trsf &trsf,
|
||||
const char *op=0, bool copy=false);
|
||||
TopoShape makETransform(const gp_Trsf &trsf, const char *op=0, bool copy=false) const {
|
||||
return TopoShape().makETransform(*this,trsf,op,copy);
|
||||
TopoShape makeTransform(const gp_Trsf &trsf, const char *op=0, bool copy=false) const {
|
||||
return TopoShape().makeTransform(*this,trsf,op,copy);
|
||||
}
|
||||
|
||||
void move(const TopLoc_Location &loc) {
|
||||
@@ -350,15 +351,15 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
TopoShape &makEGTransform(const TopoShape &shape, const Base::Matrix4D &mat,
|
||||
TopoShape &makeGTransform(const TopoShape &shape, const Base::Matrix4D &mat,
|
||||
const char *op=0, bool copy=false);
|
||||
TopoShape makEGTransform(const Base::Matrix4D &mat, const char *op=0, bool copy=false) const {
|
||||
return TopoShape().makEGTransform(*this,mat,op,copy);
|
||||
TopoShape makeGTransform(const Base::Matrix4D &mat, const char *op=0, bool copy=false) const {
|
||||
return TopoShape().makeGTransform(*this,mat,op,copy);
|
||||
}
|
||||
|
||||
TopoShape &makERefine(const TopoShape &shape, const char *op=0, bool no_fail=true);
|
||||
TopoShape makERefine(const char *op=0, bool no_fail=true) const {
|
||||
return TopoShape().makERefine(*this,op,no_fail);
|
||||
TopoShape &makeRefine(const TopoShape &shape, const char *op=0, bool no_fail=true);
|
||||
TopoShape makeRefine(const char *op=0, bool no_fail=true) const {
|
||||
return TopoShape().makeRefine(*this,op,no_fail);
|
||||
}
|
||||
//@}
|
||||
|
||||
|
||||
@@ -2171,7 +2171,7 @@ PyObject* TopoShapePy::makeWires(PyObject *args) {
|
||||
if (!PyArg_ParseTuple(args, "s", &op))
|
||||
return NULL;
|
||||
PY_TRY {
|
||||
return Py::new_reference_to(shape2pyshape(getTopoShapePtr()->makEWires(op)));
|
||||
return Py::new_reference_to(shape2pyshape(getTopoShapePtr()->makeWires(op)));
|
||||
}PY_CATCH_OCC
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ void DressUp::getAddSubShape(Part::TopoShape &addShape, Part::TopoShape &subShap
|
||||
// Make a compound to contain both additive and subtractive shape,
|
||||
// bceause a dressing (e.g. a fillet) can either be additive or
|
||||
// subtractive. And the dressup feature can contain mixture of both.
|
||||
AddSubShape.setValue(Part::TopoShape().makECompound(shapes));
|
||||
AddSubShape.setValue(Part::TopoShape().makeCompound(shapes));
|
||||
|
||||
} catch (Standard_Failure &e) {
|
||||
FC_THROWM(Base::CADKernelError, "Failed to calculate AddSub shape: "
|
||||
|
||||
@@ -193,7 +193,7 @@ Part::TopoShape ProfileBased::getProfileShape() const
|
||||
std::vector<Part::TopoShape> shapes;
|
||||
for (auto& sub : Profile.getSubValues(true))
|
||||
shapes.emplace_back(shape.getSubShape(sub.c_str()));
|
||||
shape = Part::TopoShape().makECompound(shapes);
|
||||
shape = Part::TopoShape().makeCompound(shapes);
|
||||
}
|
||||
return shape;
|
||||
}
|
||||
@@ -216,16 +216,16 @@ TopoDS_Shape ProfileBased::getVerifiedFace(bool silent) const {
|
||||
auto faces = shape.getSubTopoShapes(TopAbs_FACE);
|
||||
if (faces.empty()) {
|
||||
if (!shape.hasSubShape(TopAbs_WIRE))
|
||||
shape = shape.makEWires();
|
||||
shape = shape.makeWires();
|
||||
if (shape.hasSubShape(TopAbs_WIRE))
|
||||
shape = shape.makEFace(0, "Part::FaceMakerBullseye");
|
||||
shape = shape.makeFace(0, "Part::FaceMakerBullseye");
|
||||
else
|
||||
err = "Cannot make face from profile";
|
||||
}
|
||||
else if (faces.size() == 1)
|
||||
shape = faces.front();
|
||||
else
|
||||
shape = TopoShape().makECompound(faces);
|
||||
shape = TopoShape().makeCompound(faces);
|
||||
}
|
||||
if (!err)
|
||||
return shape.getShape();
|
||||
|
||||
@@ -239,9 +239,9 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Shape of addsub feature is empty");
|
||||
gp_Trsf trsf = feature->getLocation().Transformation().Multiplied(trsfInv);
|
||||
if (!fuseShape.isNull())
|
||||
fuseShape = fuseShape.makETransform(trsf);
|
||||
fuseShape = fuseShape.makeTransform(trsf);
|
||||
if (!cutShape.isNull())
|
||||
cutShape = cutShape.makETransform(trsf);
|
||||
cutShape = cutShape.makeTransform(trsf);
|
||||
}
|
||||
else {
|
||||
return new App::DocumentObjectExecReturn("Only additive and subtractive features can be transformed");
|
||||
|
||||
@@ -660,7 +660,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
else {
|
||||
for(size_t i=0;i<shapes.size();++i) {
|
||||
auto &shape = shapes[i];
|
||||
shape = shape.makETransform(*shapeMats[i]);
|
||||
shape = shape.makeTransform(*shapeMats[i]);
|
||||
// if(shape.Hasher
|
||||
// && shape.getElementMapSize()
|
||||
// && shape.Hasher != getDocument()->getStringHasher())
|
||||
@@ -676,7 +676,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
return;
|
||||
}
|
||||
|
||||
result.makECompound(shapes);
|
||||
result.makeCompound(shapes);
|
||||
|
||||
bool fused = false;
|
||||
if(Fuse.getValue()) {
|
||||
@@ -692,11 +692,11 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
}
|
||||
if(solids.size()) {
|
||||
solid.fuse(solids);
|
||||
result = solid.makERefine();
|
||||
result = solid.makeRefine();
|
||||
fused = true;
|
||||
} else if (!solid.isNull()) {
|
||||
// wrap the single solid in compound to keep its placement
|
||||
result.makECompound({solid});
|
||||
result.makeCompound({solid});
|
||||
fused = true;
|
||||
}
|
||||
}
|
||||
@@ -705,9 +705,9 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
&& !result.hasSubShape(TopAbs_FACE)
|
||||
&& result.hasSubShape(TopAbs_EDGE))
|
||||
{
|
||||
result = result.makEWires();
|
||||
result = result.makeWires();
|
||||
try {
|
||||
result = result.makEFace(0);
|
||||
result = result.makeFace(0);
|
||||
}catch(...){}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user