Break up try/catch blocks for easier debugging
This commit is contained in:
parent
cebe2faee1
commit
5fd19bb5f4
|
@ -155,27 +155,54 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
|
||||||
Base::Console().Log("INFO - DVP::execute - Scale: %.3f\n",s);
|
Base::Console().Log("INFO - DVP::execute - Scale: %.3f\n",s);
|
||||||
return DrawView::execute();
|
return DrawView::execute();
|
||||||
}
|
}
|
||||||
|
geometryObject->setScale(s);
|
||||||
|
|
||||||
geometryObject->setScale(Scale.getValue());
|
//TODO: remove these try/catch block when code is stable
|
||||||
|
gp_Pnt inputCenter;
|
||||||
try {
|
try {
|
||||||
gp_Pnt inputCenter = TechDrawGeometry::findCentroid(shape,
|
inputCenter = TechDrawGeometry::findCentroid(shape,
|
||||||
Direction.getValue(),
|
Direction.getValue(),
|
||||||
getValidXDir());
|
getValidXDir());
|
||||||
shapeCentroid = Base::Vector3d(inputCenter.X(),inputCenter.Y(),inputCenter.Z());
|
shapeCentroid = Base::Vector3d(inputCenter.X(),inputCenter.Y(),inputCenter.Z());
|
||||||
TopoDS_Shape mirroredShape = TechDrawGeometry::mirrorShape(shape,
|
|
||||||
inputCenter,
|
|
||||||
Scale.getValue());
|
|
||||||
buildGeometryObject(mirroredShape,inputCenter);
|
|
||||||
#if MOD_TECHDRAW_HANDLE_FACES
|
|
||||||
extractFaces();
|
|
||||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure) {
|
||||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
Handle_Standard_Failure e1 = Standard_Failure::Caught();
|
||||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
Base::Console().Log("LOG - DVP::execute - findCentroid failed for %s - %s **\n",getNameInDocument(),e1->GetMessageString());
|
||||||
|
return new App::DocumentObjectExecReturn(e1->GetMessageString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape mirroredShape;
|
||||||
|
try {
|
||||||
|
mirroredShape = TechDrawGeometry::mirrorShape(shape,
|
||||||
|
inputCenter,
|
||||||
|
Scale.getValue());
|
||||||
|
}
|
||||||
|
catch (Standard_Failure) {
|
||||||
|
Handle_Standard_Failure e2 = Standard_Failure::Caught();
|
||||||
|
Base::Console().Log("LOG - DVP::execute - mirrorShape failed for %s - %s **\n",getNameInDocument(),e2->GetMessageString());
|
||||||
|
return new App::DocumentObjectExecReturn(e2->GetMessageString());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
buildGeometryObject(mirroredShape,inputCenter);
|
||||||
|
}
|
||||||
|
catch (Standard_Failure) {
|
||||||
|
Handle_Standard_Failure e3 = Standard_Failure::Caught();
|
||||||
|
Base::Console().Log("LOG - DVP::execute - buildGeometryObject failed for %s - %s **\n",getNameInDocument(),e3->GetMessageString());
|
||||||
|
return new App::DocumentObjectExecReturn(e3->GetMessageString());
|
||||||
|
}
|
||||||
|
|
||||||
|
#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
|
try {
|
||||||
|
extractFaces();
|
||||||
|
}
|
||||||
|
catch (Standard_Failure) {
|
||||||
|
Handle_Standard_Failure e4 = Standard_Failure::Caught();
|
||||||
|
Base::Console().Log("LOG - DVP::execute - buildGeometryObject failed for %s - %s **\n",getNameInDocument(),e4->GetMessageString());
|
||||||
|
return new App::DocumentObjectExecReturn(e4->GetMessageString());
|
||||||
|
}
|
||||||
|
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
|
|
||||||
//TODO: not sure about this
|
//TODO: not sure about this
|
||||||
// There is a guaranteed change so check any references linked to this and touch
|
// There is a guaranteed change so check any references linked to this and touch
|
||||||
// We need to update all views pointing at this (ProjectionGroup, ClipGroup, Section, etc)
|
// We need to update all views pointing at this (ProjectionGroup, ClipGroup, Section, etc)
|
||||||
|
|
|
@ -200,8 +200,10 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||||
geometryObject->setTolerance(Tolerance.getValue());
|
geometryObject->setTolerance(Tolerance.getValue());
|
||||||
geometryObject->setScale(Scale.getValue());
|
geometryObject->setScale(Scale.getValue());
|
||||||
Base::Vector3d validXDir = getValidXDir();
|
Base::Vector3d validXDir = getValidXDir();
|
||||||
|
|
||||||
|
gp_Pnt inputCenter;
|
||||||
try {
|
try {
|
||||||
gp_Pnt inputCenter = TechDrawGeometry::findCentroid(rawShape,
|
inputCenter = TechDrawGeometry::findCentroid(rawShape,
|
||||||
Direction.getValue(),
|
Direction.getValue(),
|
||||||
validXDir);
|
validXDir);
|
||||||
TopoDS_Shape mirroredShape = TechDrawGeometry::mirrorShape(rawShape,
|
TopoDS_Shape mirroredShape = TechDrawGeometry::mirrorShape(rawShape,
|
||||||
|
@ -212,7 +214,14 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||||
#if MOD_TECHDRAW_HANDLE_FACES
|
#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
extractFaces();
|
extractFaces();
|
||||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
|
}
|
||||||
|
catch (Standard_Failure) {
|
||||||
|
Handle_Standard_Failure e1 = Standard_Failure::Caught();
|
||||||
|
Base::Console().Log("LOG - DVS::execute - base shape failed for %s - %s **\n",getNameInDocument(),e1->GetMessageString());
|
||||||
|
return new App::DocumentObjectExecReturn(e1->GetMessageString());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
TopoDS_Compound sectionCompound = findSectionPlaneIntersections(rawShape);
|
TopoDS_Compound sectionCompound = findSectionPlaneIntersections(rawShape);
|
||||||
TopoDS_Shape mirroredSection = TechDrawGeometry::mirrorShape(sectionCompound,
|
TopoDS_Shape mirroredSection = TechDrawGeometry::mirrorShape(sectionCompound,
|
||||||
inputCenter,
|
inputCenter,
|
||||||
|
@ -234,9 +243,9 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||||
sectionFaces = newFaces;
|
sectionFaces = newFaces;
|
||||||
}
|
}
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure) {
|
||||||
Handle_Standard_Failure e1 = Standard_Failure::Caught();
|
Handle_Standard_Failure e2 = Standard_Failure::Caught();
|
||||||
return new App::DocumentObjectExecReturn(std::string("DVS building Section shape failed: ") +
|
Base::Console().Log("LOG - DVS::execute - failed building section faces for %s - %s **\n",getNameInDocument(),e2->GetMessageString());
|
||||||
std::string(e1->GetMessageString()));
|
return new App::DocumentObjectExecReturn(e2->GetMessageString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return DrawView::execute();
|
return DrawView::execute();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user