PartDesign: Enable manual alignment tool for PartDesign features

This commit is contained in:
logari81
2012-12-09 12:04:10 +01:00
committed by wmayer
parent 74d1cc0f3d
commit 7755a00d5d
5 changed files with 27 additions and 3 deletions

View File

@@ -116,6 +116,19 @@ void SketchBased::positionBySketch(void)
}
}
void SketchBased::transformPlacement(const Base::Placement &transform)
{
Part::Part2DObject *sketch = static_cast<Part::Part2DObject*>(Sketch.getValue());
if (sketch && sketch->getTypeId().isDerivedFrom(Part::Part2DObject::getClassTypeId())) {
Part::Feature *part = static_cast<Part::Feature*>(sketch->Support.getValue());
if (part && part->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
part->transformPlacement(transform);
else
sketch->transformPlacement(transform);
positionBySketch();
}
}
Part::Part2DObject* SketchBased::getVerifiedSketch() const {
App::DocumentObject* result = Sketch.getValue();
if (!result)

View File

@@ -57,6 +57,10 @@ public:
* or its support if it has one
*/
void positionBySketch(void);
/** applies a transform on the Placement of the Sketch or its
* support if it has one
*/
virtual void transformPlacement(const Base::Placement &transform);
/// Verifies the linked Sketch object
Part::Part2DObject* getVerifiedSketch() const;