Toponaming: Transfer in missing Code for BaseFeatures and Sketches
This commit is contained in:
@@ -52,6 +52,12 @@ BodyBase* BodyBase::findBodyOf(const App::DocumentObject* f)
|
|||||||
if (body->hasObject(f))
|
if (body->hasObject(f))
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
// for(;;) {
|
||||||
|
// auto group = App::GeoFeatureGroupExtension::getGroupOfObject(f);
|
||||||
|
// if(!group || group->isDerivedFrom(BodyBase::getClassTypeId()))
|
||||||
|
// return static_cast<BodyBase*>(group);
|
||||||
|
// f = group;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -387,10 +387,11 @@ App::DocumentObject* Feature::getSubObject(const char* subname,
|
|||||||
TopoShape ts(Shape.getShape());
|
TopoShape ts(Shape.getShape());
|
||||||
bool doTransform = mat != ts.getTransform();
|
bool doTransform = mat != ts.getTransform();
|
||||||
if (doTransform) {
|
if (doTransform) {
|
||||||
ts.setShape(ts.getShape().Located(TopLoc_Location()));
|
ts.setShape(ts.getShape().Located(TopLoc_Location()), false);
|
||||||
}
|
}
|
||||||
if (subname && *subname && !ts.isNull()) {
|
if (subname && *subname && !ts.isNull()) {
|
||||||
ts = ts.getSubShape(subname);
|
// ts = ts.getSubShape(subname); // TODO WAS THIS WRONG?
|
||||||
|
ts = ts.getSubTopoShape(subname,true);
|
||||||
}
|
}
|
||||||
if (doTransform && !ts.isNull()) {
|
if (doTransform && !ts.isNull()) {
|
||||||
static int sCopy = -1;
|
static int sCopy = -1;
|
||||||
@@ -483,13 +484,12 @@ static std::vector<std::pair<long, Data::MappedName>> getElementSource(App::Docu
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: 02/24 Toponaming project: It appears that getElementOwner is always nullptr.
|
if (owner->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
|
||||||
// if (owner->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
|
auto o =
|
||||||
// auto o =
|
static_cast<App::GeoFeature*>(owner)->getElementOwner(ret.back().second);
|
||||||
// static_cast<App::GeoFeature*>(owner)->getElementOwner(ret.back().second);
|
if (o)
|
||||||
// if (o)
|
doc = o->getDocument();
|
||||||
// doc = o->getDocument();
|
}
|
||||||
// }
|
|
||||||
obj = doc->getObjectByID(tag < 0 ? -tag : tag);
|
obj = doc->getObjectByID(tag < 0 ? -tag : tag);
|
||||||
if (type) {
|
if (type) {
|
||||||
for (auto& hist : history) {
|
for (auto& hist : history) {
|
||||||
@@ -586,13 +586,12 @@ std::list<Data::HistoryItem> Feature::getElementHistory(App::DocumentObject* fea
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: 02/24 Toponaming project: It appears that getElementOwner is always nullptr.
|
if(feature->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
|
||||||
// if(feature->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
|
auto owner =
|
||||||
// auto owner =
|
static_cast<App::GeoFeature*>(feature)->getElementOwner(element);
|
||||||
// static_cast<App::GeoFeature*>(feature)->getElementOwner(element);
|
if(owner)
|
||||||
// if(owner)
|
doc = owner->getDocument();
|
||||||
// doc = owner->getDocument();
|
}
|
||||||
// }
|
|
||||||
obj = doc->getObjectByID(std::abs(tag));
|
obj = doc->getObjectByID(std::abs(tag));
|
||||||
}
|
}
|
||||||
if (!recursive) {
|
if (!recursive) {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "BodyPy.h"
|
#include "BodyPy.h"
|
||||||
#include "FeatureBase.h"
|
#include "FeatureBase.h"
|
||||||
#include "FeatureSketchBased.h"
|
#include "FeatureSketchBased.h"
|
||||||
|
#include "FeatureSolid.h"
|
||||||
#include "FeatureTransformed.h"
|
#include "FeatureTransformed.h"
|
||||||
#include "ShapeBinder.h"
|
#include "ShapeBinder.h"
|
||||||
|
|
||||||
@@ -118,6 +119,22 @@ App::DocumentObject* Body::getPrevSolidFeature(App::DocumentObject *start)
|
|||||||
start = Tip.getValue();
|
start = Tip.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// #ifdef FC_USE_TNP_FIX
|
||||||
|
// int index;
|
||||||
|
// if (!start || !start->getNameInDocument()
|
||||||
|
// // || start->isDerivedFrom(PartDesign::Extrusion::getClassTypeId())
|
||||||
|
// || start->isDerivedFrom(PartDesign::Solid::getClassTypeId())
|
||||||
|
// || !this->Group.find(start->getNameInDocument(), &index)) { // No Tip
|
||||||
|
// return nullptr;
|
||||||
|
// }
|
||||||
|
// const auto & objs = this->Group.getValues();
|
||||||
|
// for (--index; index>=0; --index) {
|
||||||
|
// if (isSolidFeature(objs[index]))
|
||||||
|
// return objs[index];
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// #else
|
||||||
if (!start) { // No Tip
|
if (!start) { // No Tip
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -136,7 +153,7 @@ App::DocumentObject* Body::getPrevSolidFeature(App::DocumentObject *start)
|
|||||||
if (rvIt != features.rend()) { // the solid found in model list
|
if (rvIt != features.rend()) { // the solid found in model list
|
||||||
return *rvIt;
|
return *rvIt;
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,6 +163,20 @@ App::DocumentObject* Body::getNextSolidFeature(App::DocumentObject *start)
|
|||||||
start = Tip.getValue();
|
start = Tip.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #ifdef FC_USE_TNP_FIX
|
||||||
|
// int index;
|
||||||
|
// if (!start || !start->getNameInDocument()
|
||||||
|
// || !this->Group.find(start->getNameInDocument(), &index)) { // No Tip
|
||||||
|
// return nullptr;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// const auto & objs = this->Group.getValues();
|
||||||
|
// int count = this->Group.getSize();
|
||||||
|
// for (++index; index<count; ++index) {
|
||||||
|
// if (isSolidFeature(objs[index]))
|
||||||
|
// return objs[index];
|
||||||
|
// }
|
||||||
|
// #else
|
||||||
if (!start || !hasObject(start)) { // no or faulty tip
|
if (!start || !hasObject(start)) { // no or faulty tip
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -167,7 +198,7 @@ App::DocumentObject* Body::getNextSolidFeature(App::DocumentObject *start)
|
|||||||
if (rvIt != features.end()) { // the solid found in model list
|
if (rvIt != features.end()) { // the solid found in model list
|
||||||
return *rvIt;
|
return *rvIt;
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +221,9 @@ bool Body::isSolidFeature(const App::DocumentObject *obj)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (obj == BaseFeature.getValue())
|
||||||
|
// return true;
|
||||||
|
|
||||||
if (obj->isDerivedFrom<PartDesign::Feature>()) {
|
if (obj->isDerivedFrom<PartDesign::Feature>()) {
|
||||||
if (PartDesign::Feature::isDatum(obj)) {
|
if (PartDesign::Feature::isDatum(obj)) {
|
||||||
// Datum objects are not solid
|
// Datum objects are not solid
|
||||||
@@ -375,6 +409,7 @@ std::vector<App::DocumentObject*> Body::removeObject(App::DocumentObject* featur
|
|||||||
|
|
||||||
App::DocumentObjectExecReturn *Body::execute()
|
App::DocumentObjectExecReturn *Body::execute()
|
||||||
{
|
{
|
||||||
|
Part::BodyBase::execute();
|
||||||
/*
|
/*
|
||||||
Base::Console().Error("Body '%s':\n", getNameInDocument());
|
Base::Console().Error("Body '%s':\n", getNameInDocument());
|
||||||
App::DocumentObject* tip = Tip.getValue();
|
App::DocumentObject* tip = Tip.getValue();
|
||||||
@@ -502,6 +537,29 @@ std::vector<std::string> Body::getSubObjects(int reason) const {
|
|||||||
App::DocumentObject *Body::getSubObject(const char *subname,
|
App::DocumentObject *Body::getSubObject(const char *subname,
|
||||||
PyObject **pyObj, Base::Matrix4D *pmat, bool transform, int depth) const
|
PyObject **pyObj, Base::Matrix4D *pmat, bool transform, int depth) const
|
||||||
{
|
{
|
||||||
|
// while(subname && *subname=='.') ++subname; // skip leading .
|
||||||
|
//
|
||||||
|
// // PartDesign::Feature now support grouping sibling features, and the user
|
||||||
|
// // is free to expand/collapse at any time. To not disrupt subname path
|
||||||
|
// // because of this, the body will peek the next two sub-objects reference,
|
||||||
|
// // and skip the first sub-object if possible.
|
||||||
|
// if(subname) {
|
||||||
|
// const char * firstDot = strchr(subname,'.');
|
||||||
|
// if (firstDot) {
|
||||||
|
// const char * secondDot = strchr(firstDot+1, '.');
|
||||||
|
// if (secondDot) {
|
||||||
|
// auto firstObj = Group.find(std::string(subname, firstDot).c_str());
|
||||||
|
// if (!firstObj || firstObj->isDerivedFrom(PartDesign::Feature::getClassTypeId())) {
|
||||||
|
// auto secondObj = Group.find(std::string(firstDot+1, secondDot).c_str());
|
||||||
|
// if (secondObj) {
|
||||||
|
// // we support only one level of sibling grouping, so no
|
||||||
|
// // recursive call to our own getSubObject()
|
||||||
|
// return Part::BodyBase::getSubObject(firstDot+1,pyObj,pmat,transform,depth+1);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
#if 1
|
#if 1
|
||||||
return Part::BodyBase::getSubObject(subname,pyObj,pmat,transform,depth);
|
return Part::BodyBase::getSubObject(subname,pyObj,pmat,transform,depth);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -52,21 +52,31 @@ short int FeatureBase::mustExecute() const {
|
|||||||
if(BaseFeature.isTouched())
|
if(BaseFeature.isTouched())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return Part::Feature::mustExecute();
|
return PartDesign::Feature::mustExecute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
App::DocumentObjectExecReturn* FeatureBase::execute() {
|
App::DocumentObjectExecReturn* FeatureBase::execute()
|
||||||
|
{
|
||||||
|
|
||||||
if(!BaseFeature.getValue())
|
if (!BaseFeature.getValue()) {
|
||||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "BaseFeature link is not set"));
|
return new App::DocumentObjectExecReturn(
|
||||||
|
QT_TRANSLATE_NOOP("Exception", "BaseFeature link is not set"));
|
||||||
|
}
|
||||||
|
|
||||||
if(!BaseFeature.getValue()->isDerivedFrom(Part::Feature::getClassTypeId()))
|
if (!BaseFeature.getValue()->isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "BaseFeature must be a Part::Feature"));
|
return new App::DocumentObjectExecReturn(
|
||||||
|
QT_TRANSLATE_NOOP("Exception", "BaseFeature must be a Part::Feature"));
|
||||||
|
}
|
||||||
|
|
||||||
auto shape = static_cast<Part::Feature*>(BaseFeature.getValue())->Shape.getValue();
|
auto shape = Part::Feature::getTopoShape(BaseFeature.getValue());
|
||||||
if (shape.IsNull())
|
if (!shape.countSubShapes(TopAbs_SOLID)) {
|
||||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "BaseFeature has an empty shape"));
|
shape = shape.makeElementSolid();
|
||||||
|
}
|
||||||
|
if (shape.isNull()) {
|
||||||
|
return new App::DocumentObjectExecReturn(
|
||||||
|
QT_TRANSLATE_NOOP("Exception", "BaseFeature has an empty shape"));
|
||||||
|
}
|
||||||
|
|
||||||
Shape.setValue(shape);
|
Shape.setValue(shape);
|
||||||
|
|
||||||
@@ -91,7 +101,7 @@ void FeatureBase::onChanged(const App::Property* prop) {
|
|||||||
trySetBaseFeatureOfBody();
|
trySetBaseFeatureOfBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
Part::Feature::onChanged(prop);
|
PartDesign::Feature::onChanged(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeatureBase::onDocumentRestored()
|
void FeatureBase::onDocumentRestored()
|
||||||
@@ -100,6 +110,7 @@ void FeatureBase::onDocumentRestored()
|
|||||||
auto body = getFeatureBody();
|
auto body = getFeatureBody();
|
||||||
if (!body)
|
if (!body)
|
||||||
Placement.setStatus(App::Property::Hidden, false);
|
Placement.setStatus(App::Property::Hidden, false);
|
||||||
|
PartDesign::Feature::onDocumentRestored();
|
||||||
}
|
}
|
||||||
|
|
||||||
}//namespace PartDesign
|
}//namespace PartDesign
|
||||||
|
|||||||
@@ -85,6 +85,10 @@
|
|||||||
#include "SketchObjectPy.h"
|
#include "SketchObjectPy.h"
|
||||||
#include "SolverGeometryExtension.h"
|
#include "SolverGeometryExtension.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||||
|
#include <ExternalGeometryFacade.h>
|
||||||
|
#include <Mod/Part/App/PartPyCXX.h>
|
||||||
|
|
||||||
|
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
// #define DEBUG
|
// #define DEBUG
|
||||||
@@ -265,7 +269,8 @@ void SketchObject::buildShape()
|
|||||||
Part::TopoShape vertex(TopoDS::Vertex(geo->toShape()));
|
Part::TopoShape vertex(TopoDS::Vertex(geo->toShape()));
|
||||||
int idx = getVertexIndexGeoPos(i-1, Sketcher::PointPos::start);
|
int idx = getVertexIndexGeoPos(i-1, Sketcher::PointPos::start);
|
||||||
std::string name = convertSubName(Data::IndexedName::fromConst("Vertex", idx+1), false);
|
std::string name = convertSubName(Data::IndexedName::fromConst("Vertex", idx+1), false);
|
||||||
|
vertex.setElementName(Data::IndexedName::fromConst("Vertex", 1),
|
||||||
|
Data::MappedName::fromRawData(name.c_str()), 0L);
|
||||||
vertices.push_back(vertex);
|
vertices.push_back(vertex);
|
||||||
vertices.back().copyElementMap(vertex, Part::OpCodes::Sketch);
|
vertices.back().copyElementMap(vertex, Part::OpCodes::Sketch);
|
||||||
} else {
|
} else {
|
||||||
@@ -285,14 +290,14 @@ void SketchObject::buildShape()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Commented since ExternalGeometryFacade is not added
|
// FIXME: Commented since ExternalGeometryFacade is not added
|
||||||
// for(i=2;i<ExternalGeo.getSize();++i) {
|
for(i=2;i<ExternalGeo.size();++i) {
|
||||||
// auto geo = ExternalGeo[i];
|
auto geo = ExternalGeo[i];
|
||||||
// auto egf = ExternalGeometryFacade::getFacade(geo);
|
auto egf = ExternalGeometryFacade::getFacade(geo);
|
||||||
// if(!egf->testFlag(ExternalGeometryExtension::Defining))
|
if(!egf->testFlag(ExternalGeometryExtension::Defining))
|
||||||
// continue;
|
continue;
|
||||||
// shapes.push_back(getEdge(geo, convertSubName(
|
shapes.push_back(getEdge(geo, convertSubName(
|
||||||
// Data::IndexedName::fromConst("ExternalEdge", i-1), false).c_str()));
|
Data::IndexedName::fromConst("ExternalEdge", i-1), false).c_str()));
|
||||||
// }
|
}
|
||||||
if(shapes.empty() && vertices.empty()) {
|
if(shapes.empty() && vertices.empty()) {
|
||||||
Shape.setValue(Part::TopoShape());
|
Shape.setValue(Part::TopoShape());
|
||||||
return;
|
return;
|
||||||
@@ -9420,6 +9425,127 @@ bool SketchObject::AutoLockTangencyAndPerpty(Constraint* cstr, bool bForce, bool
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App::DocumentObject *SketchObject::getSubObject(
|
||||||
|
const char *subname, PyObject **pyObj,
|
||||||
|
Base::Matrix4D *pmat, bool transform, int depth) const
|
||||||
|
{
|
||||||
|
while(subname && *subname=='.') ++subname; // skip leading .
|
||||||
|
std::string sub;
|
||||||
|
const char *mapped = Data::isMappedElement(subname);
|
||||||
|
if(!subname || !subname[0])
|
||||||
|
return Part2DObject::getSubObject(subname,pyObj,pmat,transform,depth);
|
||||||
|
const char *element = Data::findElementName(subname);
|
||||||
|
// if(element != subname) {
|
||||||
|
// const char *dot = strchr(subname,'.');
|
||||||
|
// if(!dot)
|
||||||
|
// return 0;
|
||||||
|
// std::string name(subname,dot-subname);
|
||||||
|
// auto child = Exports.find(name.c_str());
|
||||||
|
// if(!child)
|
||||||
|
// return 0;
|
||||||
|
// return child->getSubObject(dot+1,pyObj,pmat,true,depth+1);
|
||||||
|
// }
|
||||||
|
|
||||||
|
Data::IndexedName indexedName = checkSubName(subname);
|
||||||
|
int index = indexedName.getIndex();
|
||||||
|
const char * shapetype = indexedName.getType();
|
||||||
|
const Part::Geometry *geo = 0;
|
||||||
|
Part::TopoShape subshape;
|
||||||
|
Base::Vector3d point;
|
||||||
|
|
||||||
|
if (auto realType = convertInternalName(indexedName.getType())) {
|
||||||
|
if (realType[0] == '\0')
|
||||||
|
// subshape = InternalShape.getShape();
|
||||||
|
subshape = Shape.getShape();
|
||||||
|
else {
|
||||||
|
auto shapeType = Part::TopoShape::shapeType(realType, true);
|
||||||
|
if (shapeType != TopAbs_SHAPE)
|
||||||
|
// subshape = InternalShape.getShape().getSubTopoShape(shapeType, indexedName.getIndex(), true);
|
||||||
|
subshape = Shape.getShape().getSubTopoShape(shapeType, indexedName.getIndex(), true);
|
||||||
|
}
|
||||||
|
if (subshape.isNull())
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
else if (!pyObj || !mapped) {
|
||||||
|
if (!pyObj
|
||||||
|
|| (index > 0
|
||||||
|
&& !boost::algorithm::contains(subname, "edge")
|
||||||
|
&& !boost::algorithm::contains(subname, "vertex")))
|
||||||
|
return Part2DObject::getSubObject(subname,pyObj,pmat,transform,depth);
|
||||||
|
} else {
|
||||||
|
subshape = Shape.getShape().getSubTopoShape(subname, true);
|
||||||
|
if (!subshape.isNull())
|
||||||
|
return Part2DObject::getSubObject(subname,pyObj,pmat,transform,depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subshape.isNull()) {
|
||||||
|
if (boost::equals(shapetype,"Edge") ||
|
||||||
|
boost::equals(shapetype,"edge")) {
|
||||||
|
geo = getGeometry(index - 1);
|
||||||
|
if (!geo)
|
||||||
|
return nullptr;
|
||||||
|
} else if (boost::equals(shapetype,"ExternalEdge")) {
|
||||||
|
int GeoId = index - 1;
|
||||||
|
GeoId = -GeoId - 3;
|
||||||
|
geo = getGeometry(GeoId);
|
||||||
|
if(!geo)
|
||||||
|
return nullptr;
|
||||||
|
} else if (boost::equals(shapetype,"Vertex") ||
|
||||||
|
boost::equals(shapetype,"vertex")) {
|
||||||
|
int VtId = index- 1;
|
||||||
|
int GeoId;
|
||||||
|
PointPos PosId;
|
||||||
|
getGeoVertexIndex(VtId,GeoId,PosId);
|
||||||
|
if (PosId==PointPos::none)
|
||||||
|
return nullptr;
|
||||||
|
point = getPoint(GeoId,PosId);
|
||||||
|
}
|
||||||
|
else if (boost::equals(shapetype,"RootPoint"))
|
||||||
|
point = getPoint(Sketcher::GeoEnum::RtPnt,PointPos::start);
|
||||||
|
else if (boost::equals(shapetype,"H_Axis"))
|
||||||
|
geo = getGeometry(Sketcher::GeoEnum::HAxis);
|
||||||
|
else if (boost::equals(shapetype,"V_Axis"))
|
||||||
|
geo = getGeometry(Sketcher::GeoEnum::VAxis);
|
||||||
|
else if (boost::equals(shapetype,"Constraint")) {
|
||||||
|
int ConstrId = PropertyConstraintList::getIndexFromConstraintName(shapetype);
|
||||||
|
const std::vector< Constraint * > &vals = this->Constraints.getValues();
|
||||||
|
if (ConstrId < 0 || ConstrId >= int(vals.size()))
|
||||||
|
return nullptr;
|
||||||
|
if(pyObj)
|
||||||
|
*pyObj = vals[ConstrId]->getPyObject();
|
||||||
|
return const_cast<SketchObject*>(this);
|
||||||
|
} else
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pmat && transform)
|
||||||
|
*pmat *= Placement.getValue().toMatrix();
|
||||||
|
|
||||||
|
if (pyObj) {
|
||||||
|
Part::TopoShape shape;
|
||||||
|
std::string name = convertSubName(indexedName,false);
|
||||||
|
if (geo) {
|
||||||
|
shape = getEdge(geo,name.c_str());
|
||||||
|
if(pmat && !shape.isNull())
|
||||||
|
shape.transformShape(*pmat,false,true);
|
||||||
|
} else if (!subshape.isNull()) {
|
||||||
|
shape = subshape;
|
||||||
|
if (pmat)
|
||||||
|
shape.transformShape(*pmat,false,true);
|
||||||
|
} else {
|
||||||
|
if(pmat)
|
||||||
|
point = (*pmat)*point;
|
||||||
|
shape = BRepBuilderAPI_MakeVertex(gp_Pnt(point.x,point.y,point.z)).Vertex();
|
||||||
|
shape.setElementName(Data::IndexedName::fromConst("Vertex", 1),
|
||||||
|
Data::MappedName::fromRawData(name.c_str()), 0);
|
||||||
|
}
|
||||||
|
shape.Tag = getID();
|
||||||
|
*pyObj = Py::new_reference_to(Part::shape2pyshape(shape));
|
||||||
|
}
|
||||||
|
|
||||||
|
return const_cast<SketchObject*>(this);
|
||||||
|
}
|
||||||
|
|
||||||
void SketchObject::setExpression(const App::ObjectIdentifier& path,
|
void SketchObject::setExpression(const App::ObjectIdentifier& path,
|
||||||
std::shared_ptr<App::Expression> expr)
|
std::shared_ptr<App::Expression> expr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -672,6 +672,9 @@ public:
|
|||||||
bool& yinv,
|
bool& yinv,
|
||||||
eReasonList* rsn = nullptr) const;
|
eReasonList* rsn = nullptr) const;
|
||||||
|
|
||||||
|
DocumentObject *getSubObject(const char *subname, PyObject **pyObj=0,
|
||||||
|
Base::Matrix4D *mat=0, bool transform=true, int depth=0) const override;
|
||||||
|
|
||||||
Part::TopoShape getEdge(const Part::Geometry* geo, const char* name) const;
|
Part::TopoShape getEdge(const Part::Geometry* geo, const char* name) const;
|
||||||
|
|
||||||
Data::IndexedName checkSubName(const char* sub) const;
|
Data::IndexedName checkSubName(const char* sub) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user