+ fix possible crashes in mirror and polar pattern feature
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "FeatureSubtractive.h"
|
||||
#include "FeatureMirrored.h"
|
||||
#include "FeatureLinearPattern.h"
|
||||
#include "FeaturePolarPattern.h"
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
@@ -87,6 +88,16 @@ App::DocumentObject* Transformed::getSketchObject() const
|
||||
const LinearPattern* pattern = static_cast<const LinearPattern*>(this);
|
||||
return pattern->Direction.getValue();
|
||||
}
|
||||
else if (this->getTypeId().isDerivedFrom(PolarPattern::getClassTypeId())) {
|
||||
// if Originals is empty then try the polar pattern's Axis property
|
||||
const PolarPattern* pattern = static_cast<const PolarPattern*>(this);
|
||||
return pattern->Axis.getValue();
|
||||
}
|
||||
else if (this->getTypeId().isDerivedFrom(Mirrored::getClassTypeId())) {
|
||||
// if Originals is empty then try the mirror pattern's MirrorPlane property
|
||||
const Mirrored* pattern = static_cast<const Mirrored*>(this);
|
||||
return pattern->MirrorPlane.getValue();
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user