allow non-sketch based additive and subtractive features
This commit is contained in:
@@ -39,11 +39,11 @@
|
||||
|
||||
#include "FeatureTransformed.h"
|
||||
#include "FeatureMultiTransform.h"
|
||||
#include "FeatureAdditive.h"
|
||||
#include "FeatureSubtractive.h"
|
||||
#include "FeatureAddSub.h"
|
||||
#include "FeatureMirrored.h"
|
||||
#include "FeatureLinearPattern.h"
|
||||
#include "FeaturePolarPattern.h"
|
||||
#include "FeatureSketchBased.h"
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
@@ -219,19 +219,15 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
TopoDS_Shape shape;
|
||||
bool fuse;
|
||||
|
||||
if ((*o)->getTypeId().isDerivedFrom(PartDesign::Additive::getClassTypeId())) {
|
||||
PartDesign::Additive* addFeature = static_cast<PartDesign::Additive*>(*o);
|
||||
shape = addFeature->AddShape.getShape()._Shape;
|
||||
if ((*o)->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
|
||||
PartDesign::FeatureAddSub* feature = static_cast<PartDesign::FeatureAddSub*>(*o);
|
||||
shape = feature->AddSubShape.getShape()._Shape;
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Shape of additive feature is empty");
|
||||
fuse = true;
|
||||
} else if ((*o)->getTypeId().isDerivedFrom(PartDesign::Subtractive::getClassTypeId())) {
|
||||
PartDesign::Subtractive* subFeature = static_cast<PartDesign::Subtractive*>(*o);
|
||||
shape = subFeature->SubShape.getShape()._Shape;
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Shape of subtractive feature is empty");
|
||||
fuse = false;
|
||||
} else {
|
||||
|
||||
fuse = (feature->getAddSubType() == FeatureAddSub::Additive) ? true : false;
|
||||
}
|
||||
else {
|
||||
return new App::DocumentObjectExecReturn("Only additive and subtractive features can be transformed");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user