handle possible crashes with FaceMaker and fix a few coding flaws
This commit is contained in:
@@ -170,8 +170,13 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
|
||||
Standard_Boolean makeSolid = Solid.getValue() ? Standard_True : Standard_False;
|
||||
if (makeSolid && strlen(this->FaceMakerClass.getValue())>0){
|
||||
//new facemaking behavior: use facemaker class
|
||||
std::unique_ptr<FaceMaker> fm_instance = FaceMaker::ConstructFromType(this->FaceMakerClass.getValue());
|
||||
FaceMaker* mkFace = &(*(fm_instance));
|
||||
std::unique_ptr<FaceMaker> mkFace = FaceMaker::ConstructFromType(this->FaceMakerClass.getValue());
|
||||
if (!mkFace) {
|
||||
std::stringstream out;
|
||||
out << "Cannot create FaceMaker from abstract type " << this->FaceMakerClass.getValue();
|
||||
throw Base::TypeError(out.str());
|
||||
}
|
||||
|
||||
TopoDS_Shape myShape = sourceShape.getShape();
|
||||
if(myShape.ShapeType() == TopAbs_COMPOUND)
|
||||
mkFace->useCompound(TopoDS::Compound(myShape));
|
||||
|
||||
Reference in New Issue
Block a user