+ 0000478: Segfault on insert part into 2D drawing (workaround)
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5144 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
a512879ba1
commit
e35a042c2d
|
@ -60,6 +60,12 @@ if(MSVC)
|
|||
ADD_MSVC_PRECOMPILED_HEADER("PreCompiled.h" "PreCompiled.cpp" Drawing_CPP_SRCS)
|
||||
endif(MSVC)
|
||||
|
||||
# Set special compiler flag to convert a SIGSEV into an exception
|
||||
# to handle issue #0000478.
|
||||
IF(MSVC)
|
||||
SET_SOURCE_FILES_PROPERTIES(ProjectionAlgos.cpp PROPERTIES COMPILE_FLAGS "/EHa")
|
||||
ENDIF(MSVC)
|
||||
|
||||
add_library(Drawing SHARED ${Drawing_SRCS} ${Features_SRCS} ${DrawingAlgos_SRCS})
|
||||
target_link_libraries(Drawing ${Drawing_LIBS})
|
||||
fc_copy_script("Mod/Drawing" "Drawing" Init.py)
|
||||
|
|
|
@ -77,6 +77,7 @@ App::DocumentObjectExecReturn *FeatureProjection::execute(void)
|
|||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Linked shape object is empty");
|
||||
|
||||
try {
|
||||
const Base::Vector3f& dir = Direction.getValue();
|
||||
Drawing::ProjectionAlgos alg(shape, dir);
|
||||
|
||||
|
@ -106,4 +107,9 @@ App::DocumentObjectExecReturn *FeatureProjection::execute(void)
|
|||
|
||||
Shape.setValue(comp);
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,11 +119,19 @@ void ProjectionAlgos::execute(void)
|
|||
Handle( HLRBRep_Algo ) brep_hlr = new HLRBRep_Algo;
|
||||
brep_hlr->Add(Input);
|
||||
|
||||
try {
|
||||
#if defined(__GNUC__) && defined (FC_OS_LINUX)
|
||||
Base::SignalException se;
|
||||
#endif
|
||||
gp_Ax2 transform(gp_Pnt(0,0,0),gp_Dir(Direction.x,Direction.y,Direction.z));
|
||||
HLRAlgo_Projector projector( transform );
|
||||
brep_hlr->Projector(projector);
|
||||
brep_hlr->Update();
|
||||
brep_hlr->Hide();
|
||||
}
|
||||
catch (...) {
|
||||
Standard_Failure::Raise("Fatal error occurred while projecting shape");
|
||||
}
|
||||
|
||||
// extracting the result sets:
|
||||
HLRBRep_HLRToShape shapes( brep_hlr );
|
||||
|
|
Loading…
Reference in New Issue
Block a user