Part: Rename AttachExtension::Support property to AttachmentSupport, to avoid name conflict with base features. Fixes #7052
This commit is contained in:
committed by
Adrián Insaurralde Avalos
parent
2643902b6b
commit
fbd8767242
@@ -62,7 +62,7 @@ Line::Line()
|
||||
myShape.Infinite(Standard_True);
|
||||
Shape.setValue(myShape);
|
||||
|
||||
Support.touch();
|
||||
AttachmentSupport.touch();
|
||||
}
|
||||
|
||||
Line::~Line() = default;
|
||||
|
||||
@@ -147,11 +147,6 @@ void FeaturePrimitive::onChanged(const App::Property* prop)
|
||||
FeatureAddSub::onChanged(prop);
|
||||
}
|
||||
|
||||
void FeaturePrimitive::handleChangedPropertyName(Base::XMLReader &reader, const char* TypeName, const char* PropName)
|
||||
{
|
||||
extHandleChangedPropertyName(reader, TypeName, PropName); // AttachExtension
|
||||
}
|
||||
|
||||
// suppress warning about tp_print for Py3.8
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
|
||||
@@ -61,7 +61,6 @@ public:
|
||||
return PartDesign::FeatureAddSub::execute();
|
||||
}
|
||||
protected:
|
||||
void handleChangedPropertyName(Base::XMLReader &reader, const char* TypeName, const char* PropName) override;
|
||||
//make the boolean ops with the primitives provided by the derived features
|
||||
App::DocumentObjectExecReturn* execute(const TopoDS_Shape& primitiveShape);
|
||||
Type primitiveType = Box;
|
||||
|
||||
@@ -99,7 +99,7 @@ void ProfileBased::positionByPrevious()
|
||||
else {
|
||||
//no base. Use either Sketch support's placement, or sketch's placement itself.
|
||||
Part::Part2DObject* sketch = getVerifiedSketch();
|
||||
App::DocumentObject* support = sketch->Support.getValue();
|
||||
App::DocumentObject* support = sketch->AttachmentSupport.getValue();
|
||||
if (support && support->isDerivedFrom(App::GeoFeature::getClassTypeId())) {
|
||||
this->Placement.setValue(static_cast<App::GeoFeature*>(support)->Placement.getValue());
|
||||
}
|
||||
@@ -307,13 +307,13 @@ const TopoDS_Face ProfileBased::getSupportFace() const
|
||||
|
||||
TopoDS_Face ProfileBased::getSupportFace(const Part::Part2DObject* sketch) const
|
||||
{
|
||||
if (sketch && sketch->MapMode.getValue() == Attacher::mmFlatFace && sketch->Support.getValue()) {
|
||||
const auto& Support = sketch->Support;
|
||||
App::DocumentObject* ref = Support.getValue();
|
||||
if (sketch && sketch->MapMode.getValue() == Attacher::mmFlatFace && sketch->AttachmentSupport.getValue()) {
|
||||
const auto& AttachmentSupport = sketch->AttachmentSupport;
|
||||
App::DocumentObject* ref = AttachmentSupport.getValue();
|
||||
|
||||
Part::Feature* part = dynamic_cast<Part::Feature*>(ref);
|
||||
if (part) {
|
||||
const std::vector<std::string>& sub = Support.getSubValues();
|
||||
const std::vector<std::string>& sub = AttachmentSupport.getSubValues();
|
||||
assert(sub.size() == 1);
|
||||
|
||||
if (sub.at(0).empty()) {
|
||||
@@ -385,7 +385,7 @@ Part::Feature* ProfileBased::getBaseObject(bool silent) const
|
||||
Part::Part2DObject* sketch = getVerifiedSketch(silent);
|
||||
const char* err = nullptr;
|
||||
|
||||
App::DocumentObject* spt = sketch->Support.getValue();
|
||||
App::DocumentObject* spt = sketch->AttachmentSupport.getValue();
|
||||
if (spt) {
|
||||
if (spt->isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||
rv = static_cast<Part::Feature*>(spt);
|
||||
|
||||
@@ -133,8 +133,8 @@ void UnifiedDatumCommand(Gui::Command &cmd, Base::Type type, std::string name)
|
||||
SuggestResult sugr;
|
||||
pcDatum->attacher().suggestMapModes(sugr);
|
||||
if (sugr.message == Attacher::SuggestResult::srOK) {
|
||||
//fits some mode. Populate support property.
|
||||
FCMD_OBJ_CMD(Feat,"Support = " << support.getPyReprString());
|
||||
//fits some mode. Populate AttachmentSupport property.
|
||||
FCMD_OBJ_CMD(Feat,"AttachmentSupport = " << support.getPyReprString());
|
||||
FCMD_OBJ_CMD(Feat,"MapMode = '" << AttachEngine::getModeName(sugr.bestFitMode) << "'");
|
||||
} else {
|
||||
QMessageBox::information(Gui::getMainWindow(),QObject::tr("Invalid selection"), QObject::tr("There are no attachment modes that fit selected objects. Select something else."));
|
||||
|
||||
@@ -271,7 +271,7 @@ void CmdPartDesignBody::activated(int iMsg)
|
||||
App::Plane* plane = static_cast<App::Plane*>(features.front());
|
||||
std::string supportString = Gui::Command::getObjectCmd(plane,"(",", [''])");
|
||||
|
||||
FCMD_OBJ_CMD(baseFeature,"Support = " << supportString);
|
||||
FCMD_OBJ_CMD(baseFeature,"AttachmentSupport = " << supportString);
|
||||
FCMD_OBJ_CMD(baseFeature,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace) << "'");
|
||||
Gui::Command::updateActive();
|
||||
};
|
||||
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
guidocument->openCommand(QT_TRANSLATE_NOOP("Command", "Create a Sketch on Face"));
|
||||
FCMD_OBJ_CMD(activeBody, "newObject('Sketcher::SketchObject','" << FeatName << "')");
|
||||
auto Feat = appdocument->getObject(FeatName.c_str());
|
||||
FCMD_OBJ_CMD(Feat, "Support = " << supportString);
|
||||
FCMD_OBJ_CMD(Feat, "AttachmentSupport = " << supportString);
|
||||
FCMD_OBJ_CMD(Feat, "MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
|
||||
Gui::Command::updateActive();
|
||||
PartDesignGui::setEdit(Feat, activeBody);
|
||||
@@ -619,9 +619,9 @@ private:
|
||||
|
||||
FCMD_OBJ_CMD(partDesignBody,"newObject('Sketcher::SketchObject','" << FeatName << "')");
|
||||
auto Feat = partDesignBody->getDocument()->getObject(FeatName.c_str());
|
||||
FCMD_OBJ_CMD(Feat,"Support = " << supportString);
|
||||
FCMD_OBJ_CMD(Feat,"AttachmentSupport = " << supportString);
|
||||
FCMD_OBJ_CMD(Feat,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
|
||||
Gui::Command::updateActive(); // Make sure the Support's Placement property is updated
|
||||
Gui::Command::updateActive(); // Make sure the AttachmentSupport's Placement property is updated
|
||||
PartDesignGui::setEdit(Feat, partDesignBody);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ bool TaskDlgDatumParameters::accept() {
|
||||
//check the prerequisites for the selected objects
|
||||
//the user has to decide which option we should take if external references are used
|
||||
bool extReference = false;
|
||||
for (App::DocumentObject* obj : pcDatum->Support.getValues()) {
|
||||
for (App::DocumentObject* obj : pcDatum->AttachmentSupport.getValues()) {
|
||||
if (pcActiveBody && !pcActiveBody->hasObject(obj) && !pcActiveBody->getOrigin()->hasObject(obj))
|
||||
extReference = true;
|
||||
}
|
||||
@@ -133,9 +133,9 @@ bool TaskDlgDatumParameters::accept() {
|
||||
else if (!dlg.radioXRef->isChecked()) {
|
||||
std::vector<App::DocumentObject*> copyObjects;
|
||||
std::vector<std::string> copySubValues;
|
||||
std::vector<std::string> subs = pcDatum->Support.getSubValues();
|
||||
std::vector<std::string> subs = pcDatum->AttachmentSupport.getSubValues();
|
||||
int index = 0;
|
||||
for (App::DocumentObject* obj : pcDatum->Support.getValues()) {
|
||||
for (App::DocumentObject* obj : pcDatum->AttachmentSupport.getValues()) {
|
||||
if (pcActiveBody && !pcActiveBody->hasObject(obj) && !pcActiveBody->getOrigin()->hasObject(obj)) {
|
||||
auto* copy = PartDesignGui::TaskFeaturePick::makeCopy(obj, subs[index], dlg.radioIndependent->isChecked());
|
||||
if (copy) {
|
||||
@@ -152,7 +152,7 @@ bool TaskDlgDatumParameters::accept() {
|
||||
index++;
|
||||
}
|
||||
|
||||
pcDatum->Support.setValues(copyObjects, copySubValues);
|
||||
pcDatum->AttachmentSupport.setValues(copyObjects, copySubValues);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st
|
||||
|
||||
// TODO Recheck this. This looks strange in case of independent copy (2015-10-31, Fat-Zer)
|
||||
if(!independent) {
|
||||
datumCopy->Support.setValue(obj, entity.c_str());
|
||||
datumCopy->AttachmentSupport.setValue(obj, entity.c_str());
|
||||
datumCopy->MapMode.setValue(mode);
|
||||
}
|
||||
else if(!entity.empty()) {
|
||||
|
||||
@@ -273,7 +273,7 @@ App::Part* getPartFor(const App::DocumentObject* obj, bool messageIfNot) {
|
||||
|
||||
void fixSketchSupport (Sketcher::SketchObject* sketch)
|
||||
{
|
||||
App::DocumentObject* support = sketch->Support.getValue();
|
||||
App::DocumentObject* support = sketch->AttachmentSupport.getValue();
|
||||
|
||||
if (support)
|
||||
return; // Sketch is on a face of a solid, do nothing
|
||||
@@ -317,7 +317,7 @@ void fixSketchSupport (Sketcher::SketchObject* sketch)
|
||||
|
||||
if (fabs(offset) < Precision::Confusion()) {
|
||||
// One of the base planes
|
||||
FCMD_OBJ_CMD(sketch,"Support = (" << Gui::Command::getObjectCmd(plane) << ",[''])");
|
||||
FCMD_OBJ_CMD(sketch,"AttachmentSupport = (" << Gui::Command::getObjectCmd(plane) << ",[''])");
|
||||
FCMD_OBJ_CMD(sketch,"MapReversed = " << (reverseSketch ? "True" : "False"));
|
||||
FCMD_OBJ_CMD(sketch,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace) << "'");
|
||||
|
||||
@@ -331,12 +331,12 @@ void fixSketchSupport (Sketcher::SketchObject* sketch)
|
||||
std::string Datum = doc->getUniqueObjectName("DatumPlane");
|
||||
FCMD_DOC_CMD(doc,"addObject('PartDesign::Plane','"<<Datum<<"')");
|
||||
auto obj = doc->getObject(Datum.c_str());
|
||||
FCMD_OBJ_CMD(obj,"Support = [(" << Gui::Command::getObjectCmd(plane) << ",'')]");
|
||||
FCMD_OBJ_CMD(obj,"AttachmentSupport = [(" << Gui::Command::getObjectCmd(plane) << ",'')]");
|
||||
FCMD_OBJ_CMD(obj,"MapMode = '" << AttachEngine::getModeName(Attacher::mmFlatFace) << "'");
|
||||
FCMD_OBJ_CMD(obj,"AttachmentOffset.Base.z = " << offset);
|
||||
FCMD_OBJ_CMD(body,"insertObject("<<Gui::Command::getObjectCmd(obj)<<','<<
|
||||
Gui::Command::getObjectCmd(sketch)<<")");
|
||||
FCMD_OBJ_CMD(sketch,"Support = (" << Gui::Command::getObjectCmd(obj) << ",[''])");
|
||||
FCMD_OBJ_CMD(sketch,"AttachmentSupport = (" << Gui::Command::getObjectCmd(obj) << ",[''])");
|
||||
FCMD_OBJ_CMD(sketch,"MapReversed = " << (reverseSketch ? "True" : "False"));
|
||||
FCMD_OBJ_CMD(sketch,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace) << "'");
|
||||
}
|
||||
@@ -500,7 +500,7 @@ bool isFeatureMovable(App::DocumentObject* const feat)
|
||||
|
||||
if (feat->hasExtension(Part::AttachExtension::getExtensionClassTypeId())) {
|
||||
auto attachable = feat->getExtensionByType<Part::AttachExtension>();
|
||||
App::DocumentObject* support = attachable->Support.getValue();
|
||||
App::DocumentObject* support = attachable->AttachmentSupport.getValue();
|
||||
if (support && !support->isDerivedFrom<App::OriginFeature>())
|
||||
return false;
|
||||
}
|
||||
@@ -559,12 +559,12 @@ void relinkToOrigin(App::DocumentObject* feat, PartDesign::Body* targetbody)
|
||||
{
|
||||
if (feat->hasExtension(Part::AttachExtension::getExtensionClassTypeId())) {
|
||||
auto attachable = feat->getExtensionByType<Part::AttachExtension>();
|
||||
App::DocumentObject* support = attachable->Support.getValue();
|
||||
App::DocumentObject* support = attachable->AttachmentSupport.getValue();
|
||||
if (support && support->isDerivedFrom<App::OriginFeature>()) {
|
||||
auto originfeat = static_cast<App::OriginFeature*>(support);
|
||||
App::OriginFeature* targetOriginFeature = targetbody->getOrigin()->getOriginFeature(originfeat->Role.getValue());
|
||||
if (targetOriginFeature) {
|
||||
attachable->Support.setValue(static_cast<App::DocumentObject*>(targetOriginFeature), "");
|
||||
attachable->AttachmentSupport.setValue(static_cast<App::DocumentObject*>(targetOriginFeature), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class TestDatumPoint(unittest.TestCase):
|
||||
def testOriginDatumPoint(self):
|
||||
self.Body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
self.DatumPoint = self.Doc.addObject('PartDesign::Point','DatumPoint')
|
||||
self.DatumPoint.Support = [(self.Doc.XY_Plane,'')]
|
||||
self.DatumPoint.AttachmentSupport = [(self.Doc.XY_Plane,'')]
|
||||
self.DatumPoint.MapMode = 'ObjectOrigin'
|
||||
self.Body.addObject(self.DatumPoint)
|
||||
self.Doc.recompute()
|
||||
@@ -50,7 +50,7 @@ class TestDatumLine(unittest.TestCase):
|
||||
def testXAxisDatumLine(self):
|
||||
self.Body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
self.DatumLine = self.Doc.addObject('PartDesign::Line','DatumLine')
|
||||
self.DatumLine.Support = [(self.Doc.XY_Plane,'')]
|
||||
self.DatumLine.AttachmentSupport = [(self.Doc.XY_Plane,'')]
|
||||
self.DatumLine.MapMode = 'ObjectX'
|
||||
self.Body.addObject(self.DatumLine)
|
||||
self.Doc.recompute()
|
||||
@@ -68,7 +68,7 @@ class TestDatumPlane(unittest.TestCase):
|
||||
def testXYDatumPlane(self):
|
||||
self.Body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
self.DatumPlane = self.Doc.addObject('PartDesign::Plane','DatumPlane')
|
||||
self.DatumPlane.Support = [(self.Doc.XY_Plane,'')]
|
||||
self.DatumPlane.AttachmentSupport = [(self.Doc.XY_Plane,'')]
|
||||
self.DatumPlane.MapMode = 'FlatFace'
|
||||
self.Body.addObject(self.DatumPlane)
|
||||
self.Doc.recompute()
|
||||
|
||||
@@ -41,12 +41,12 @@ class TestDraft(unittest.TestCase):
|
||||
self.Box.Height=10.00
|
||||
self.Doc.recompute()
|
||||
self.DatumPlane = self.Doc.addObject('PartDesign::Plane','DatumPlane')
|
||||
self.DatumPlane.Support = [(self.Doc.YZ_Plane,'')]
|
||||
self.DatumPlane.AttachmentSupport = [(self.Doc.YZ_Plane,'')]
|
||||
self.DatumPlane.MapMode = 'FlatFace'
|
||||
self.Body.addObject(self.DatumPlane)
|
||||
self.Doc.recompute()
|
||||
self.DatumLine = self.Doc.addObject('PartDesign::Line','DatumLine')
|
||||
self.DatumLine.Support = [(self.Doc.X_Axis,'')]
|
||||
self.DatumLine.AttachmentSupport = [(self.Doc.X_Axis,'')]
|
||||
self.DatumLine.MapMode = 'TwoPointLine'
|
||||
self.Body.addObject(self.DatumLine)
|
||||
self.Doc.recompute()
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestHelix(unittest.TestCase):
|
||||
def testHelicalTubeCase(self):
|
||||
body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
sketch = body.newObject('Sketcher::SketchObject','Sketch')
|
||||
sketch.Support = (self.Doc.getObject('XY_Plane'),[''])
|
||||
sketch.AttachmentSupport = (self.Doc.getObject('XY_Plane'),[''])
|
||||
sketch.MapMode = 'FlatFace'
|
||||
|
||||
geoList = []
|
||||
@@ -107,7 +107,7 @@ class TestHelix(unittest.TestCase):
|
||||
self.Doc.recompute()
|
||||
|
||||
# xz_plane = body.Origin.OriginFeatures[4]
|
||||
# coneSketch.Support = xz_plane
|
||||
# coneSketch.AttachmentSupport = xz_plane
|
||||
# coneSketch.MapMode = 'FlatFace'
|
||||
helix = self.Doc.addObject("PartDesign::AdditiveHelix","AdditiveHelix")
|
||||
body.addObject(helix)
|
||||
@@ -159,7 +159,7 @@ class TestHelix(unittest.TestCase):
|
||||
coneSketch.addConstraint(conList)
|
||||
|
||||
xz_plane = body.Origin.OriginFeatures[4]
|
||||
coneSketch.Support = xz_plane
|
||||
coneSketch.AttachmentSupport = xz_plane
|
||||
coneSketch.MapMode = 'FlatFace'
|
||||
helix = self.Doc.addObject("PartDesign::AdditiveHelix","AdditiveHelix")
|
||||
body.addObject(helix)
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestHole(unittest.TestCase):
|
||||
self.Body.addObject(self.Box)
|
||||
self.Doc.recompute()
|
||||
self.HoleSketch = self.Doc.addObject('Sketcher::SketchObject', 'SketchHole')
|
||||
self.HoleSketch.Support = (self.Doc.XY_Plane, [''])
|
||||
self.HoleSketch.AttachmentSupport = (self.Doc.XY_Plane, [''])
|
||||
self.HoleSketch.MapMode = 'FlatFace'
|
||||
self.HoleSketch.MapReversed = True
|
||||
self.Body.addObject(self.HoleSketch)
|
||||
|
||||
@@ -41,7 +41,7 @@ class TestLoft(unittest.TestCase):
|
||||
self.LoftSketch = self.Doc.addObject('Sketcher::SketchObject', 'LoftSketch')
|
||||
self.Body.addObject(self.LoftSketch)
|
||||
self.LoftSketch.MapMode = 'FlatFace'
|
||||
self.LoftSketch.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.LoftSketch.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.LoftSketch, (0, 1), (1, 1))
|
||||
self.Doc.recompute()
|
||||
@@ -70,7 +70,7 @@ class TestLoft(unittest.TestCase):
|
||||
self.LoftSketch = self.Doc.addObject('Sketcher::SketchObject', 'LoftSketch')
|
||||
self.Body.addObject(self.LoftSketch)
|
||||
self.LoftSketch.MapMode = 'FlatFace'
|
||||
self.LoftSketch.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.LoftSketch.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.LoftSketch, (0, 1), (1, 1))
|
||||
self.Doc.recompute()
|
||||
@@ -86,7 +86,7 @@ class TestLoft(unittest.TestCase):
|
||||
body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
|
||||
sketch1 = body.newObject('Sketcher::SketchObject','Sketch')
|
||||
sketch1.Support = (self.Doc.XZ_Plane,[''])
|
||||
sketch1.AttachmentSupport = (self.Doc.XZ_Plane,[''])
|
||||
sketch1.MapMode = 'FlatFace'
|
||||
sketch1.addGeometry(Part.Circle(Base.Vector(-40.0,0.0,0.0),Base.Vector(0,0,1),10.0), False)
|
||||
sketch1.addConstraint(Sketcher.Constraint('PointOnObject',0,3,-1))
|
||||
@@ -96,7 +96,7 @@ class TestLoft(unittest.TestCase):
|
||||
sketch1.setDatum(2,Units.Quantity('40.000000 mm'))
|
||||
|
||||
sketch2 = body.newObject('Sketcher::SketchObject','Sketch001')
|
||||
sketch2.Support = (self.Doc.YZ_Plane,'')
|
||||
sketch2.AttachmentSupport = (self.Doc.YZ_Plane,'')
|
||||
sketch2.MapMode = 'FlatFace'
|
||||
sketch2.addGeometry(Part.Circle(Base.Vector(-10.0,0.0,0.0),Base.Vector(0,0,1),10.0),False)
|
||||
sketch2.addConstraint(Sketcher.Constraint('PointOnObject',0,3,-1))
|
||||
@@ -106,7 +106,7 @@ class TestLoft(unittest.TestCase):
|
||||
sketch2.setDatum(2,Units.Quantity('40.000000 mm'))
|
||||
|
||||
sketch3 = body.newObject('Sketcher::SketchObject','Sketch002')
|
||||
sketch3.Support = (self.Doc.getObject('YZ_Plane'),'')
|
||||
sketch3.AttachmentSupport = (self.Doc.getObject('YZ_Plane'),'')
|
||||
sketch3.MapMode = 'FlatFace'
|
||||
sketch3.addGeometry(Part.Circle(Base.Vector(40.0,0.0,0.0),Base.Vector(0,0,1),10.0),False)
|
||||
sketch3.addConstraint(Sketcher.Constraint('PointOnObject',0,3,-1))
|
||||
@@ -116,7 +116,7 @@ class TestLoft(unittest.TestCase):
|
||||
sketch3.setDatum(2,Units.Quantity('20.000000 mm'))
|
||||
|
||||
sketch4 = body.newObject('Sketcher::SketchObject','Sketch003')
|
||||
sketch4.Support = (self.Doc.XZ_Plane,'')
|
||||
sketch4.AttachmentSupport = (self.Doc.XZ_Plane,'')
|
||||
sketch4.MapMode = 'FlatFace'
|
||||
sketch4.addGeometry(Part.Circle(Base.Vector(40.0,0.0,0.0),Base.Vector(0,0,1),10.0),False)
|
||||
sketch4.addConstraint(Sketcher.Constraint('PointOnObject',0,3,-1))
|
||||
|
||||
@@ -40,7 +40,7 @@ class TestPad(unittest.TestCase):
|
||||
def testSketchOnPlane(self):
|
||||
self.Body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
self.PadSketch = self.Doc.addObject('Sketcher::SketchObject','SketchPad')
|
||||
self.PadSketch.Support = (self.Doc.XY_Plane, [''])
|
||||
self.PadSketch.AttachmentSupport = (self.Doc.XY_Plane, [''])
|
||||
self.PadSketch.MapMode = 'FlatFace'
|
||||
self.Body.addObject(self.PadSketch)
|
||||
TestSketcherApp.CreateSlotPlateSet(self.PadSketch)
|
||||
@@ -67,7 +67,7 @@ class TestPad(unittest.TestCase):
|
||||
self.PadSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'SketchPad1')
|
||||
self.Body.addObject(self.PadSketch1)
|
||||
self.PadSketch1.MapMode = 'FlatFace'
|
||||
self.PadSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PadSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PadSketch1, (0, 0), (1, 1))
|
||||
self.Doc.recompute()
|
||||
@@ -95,7 +95,7 @@ class TestPad(unittest.TestCase):
|
||||
self.PadSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'SketchPad1')
|
||||
self.Body.addObject(self.PadSketch1)
|
||||
self.PadSketch1.MapMode = 'FlatFace'
|
||||
self.PadSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PadSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PadSketch1, (0, 0), (1, 1))
|
||||
self.Doc.recompute()
|
||||
@@ -123,7 +123,7 @@ class TestPad(unittest.TestCase):
|
||||
self.PadSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'SketchPad1')
|
||||
self.Body.addObject(self.PadSketch1)
|
||||
self.PadSketch1.MapMode = 'FlatFace'
|
||||
self.PadSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PadSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PadSketch1, (0, 0), (1, 1))
|
||||
self.Doc.recompute()
|
||||
@@ -152,7 +152,7 @@ class TestPad(unittest.TestCase):
|
||||
self.PadSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'SketchPad1')
|
||||
self.Body.addObject(self.PadSketch1)
|
||||
self.PadSketch1.MapMode = 'FlatFace'
|
||||
self.PadSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PadSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PadSketch1, (0, 0), (1, 1))
|
||||
self.Doc.recompute()
|
||||
|
||||
@@ -41,7 +41,7 @@ class TestPipe(unittest.TestCase):
|
||||
self.SpineSketch = self.Doc.addObject('Sketcher::SketchObject', 'SpineSketch')
|
||||
self.Body.addObject(self.SpineSketch)
|
||||
self.SpineSketch.MapMode = 'FlatFace'
|
||||
self.SpineSketch.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.SpineSketch.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
self.SpineSketch.addGeometry(Part.LineSegment(App.Vector(0.0,0.0,0),App.Vector(0,1,0)),False)
|
||||
self.SpineSketch.addConstraint(Sketcher.Constraint('Coincident',0,1,-1,1))
|
||||
@@ -64,7 +64,7 @@ class TestPipe(unittest.TestCase):
|
||||
self.SpineSketch = self.Doc.addObject('Sketcher::SketchObject', 'SpineSketch')
|
||||
self.Body.addObject(self.SpineSketch)
|
||||
self.SpineSketch.MapMode = 'FlatFace'
|
||||
self.SpineSketch.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.SpineSketch.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
self.SpineSketch.addGeometry(Part.LineSegment(App.Vector(0.0,0.0,0),App.Vector(0,1,0)),False)
|
||||
self.SpineSketch.addConstraint(Sketcher.Constraint('Coincident',0,1,-1,1))
|
||||
|
||||
@@ -75,7 +75,7 @@ class TestPocket(unittest.TestCase):
|
||||
self.PocketSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'PocketSketch')
|
||||
self.Body.addObject(self.PocketSketch1)
|
||||
self.PocketSketch1.MapMode = 'FlatFace'
|
||||
self.PocketSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PocketSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PocketSketch1, (2.5, -0.75), (5, 0.50))
|
||||
self.Doc.recompute()
|
||||
@@ -110,7 +110,7 @@ class TestPocket(unittest.TestCase):
|
||||
self.PocketSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'PocketSketch')
|
||||
self.Body.addObject(self.PocketSketch1)
|
||||
self.PocketSketch1.MapMode = 'FlatFace'
|
||||
self.PocketSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PocketSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PocketSketch1, (2.5, -1), (5, 1))
|
||||
self.Doc.recompute()
|
||||
@@ -145,7 +145,7 @@ class TestPocket(unittest.TestCase):
|
||||
self.PocketSketch1 = self.Doc.addObject('Sketcher::SketchObject', 'PocketSketch')
|
||||
self.Body.addObject(self.PocketSketch1)
|
||||
self.PocketSketch1.MapMode = 'FlatFace'
|
||||
self.PocketSketch1.Support = (self.Doc.XZ_Plane, [''])
|
||||
self.PocketSketch1.AttachmentSupport = (self.Doc.XZ_Plane, [''])
|
||||
self.Doc.recompute()
|
||||
TestSketcherApp.CreateRectangleSketch(self.PocketSketch1, (0, -1), (10, 1))
|
||||
self.Doc.recompute()
|
||||
|
||||
@@ -85,7 +85,7 @@ class TestSubShapeBinder(unittest.TestCase):
|
||||
""" Test case for PR #8763 """
|
||||
body = self.Doc.addObject('PartDesign::Body','Body')
|
||||
sketch = body.newObject('Sketcher::SketchObject','Sketch')
|
||||
sketch.Support = (self.Doc.XZ_Plane,[''])
|
||||
sketch.AttachmentSupport = (self.Doc.XZ_Plane,[''])
|
||||
sketch.MapMode = 'FlatFace'
|
||||
self.Doc.recompute()
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class PartDesignGuiTestCases(unittest.TestCase):
|
||||
App.ActiveDocument.recompute()
|
||||
|
||||
self.Sketch = self.Doc.addObject('Sketcher::SketchObject','Sketch')
|
||||
self.Sketch.Support = (self.BoxObj, ('Face3',))
|
||||
self.Sketch.AttachmentSupport = (self.BoxObj, ('Face3',))
|
||||
self.Sketch.MapMode = 'FlatFace'
|
||||
self.BodySource.addObject(self.Sketch)
|
||||
|
||||
@@ -154,7 +154,7 @@ class PartDesignGuiTestCases(unittest.TestCase):
|
||||
|
||||
self.Sketch = self.Doc.addObject('Sketcher::SketchObject','Sketch')
|
||||
self.BodySource.addObject(self.Sketch)
|
||||
self.Sketch.Support = (self.BodySource.Origin.OriginFeatures[3], [''])
|
||||
self.Sketch.AttachmentSupport = (self.BodySource.Origin.OriginFeatures[3], [''])
|
||||
self.Sketch.MapMode = 'FlatFace'
|
||||
|
||||
|
||||
@@ -198,8 +198,8 @@ class PartDesignGuiTestCases(unittest.TestCase):
|
||||
#assert dependencies of the Sketch
|
||||
self.Doc.recompute()
|
||||
|
||||
self.assertFalse(self.Sketch.Support[0][0] in self.BodySource.Origin.OriginFeatures)
|
||||
self.assertTrue(self.Sketch.Support[0][0] in self.BodyTarget.Origin.OriginFeatures)
|
||||
self.assertFalse(self.Sketch.AttachmentSupport[0][0] in self.BodySource.Origin.OriginFeatures)
|
||||
self.assertTrue(self.Sketch.AttachmentSupport[0][0] in self.BodyTarget.Origin.OriginFeatures)
|
||||
self.assertEqual(len(self.BodySource.Group), 0, "Source body feature count is wrong")
|
||||
self.assertEqual(len(self.BodyTarget.Group), 2, "Target body feature count is wrong")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user