Fix Error when OCC projection returns nothing
This commit is contained in:
@@ -159,6 +159,8 @@ DrawViewPart::~DrawViewPart()
|
||||
|
||||
TopoDS_Shape DrawViewPart::getSourceShape(void) const
|
||||
{
|
||||
// Base::Console().Message("DVP::getSourceShape() - %s\n", getNameInDocument());
|
||||
|
||||
TopoDS_Shape result;
|
||||
const std::vector<App::DocumentObject*>& links = Source.getValues();
|
||||
if (links.empty()) {
|
||||
@@ -203,6 +205,7 @@ TopoDS_Shape DrawViewPart::getSourceShape(void) const
|
||||
|
||||
std::vector<TopoDS_Shape> DrawViewPart::getShapesFromObject(App::DocumentObject* docObj) const
|
||||
{
|
||||
// Base::Console().Message("DVP::getShapesFromObject() - %s\n", getNameInDocument());
|
||||
std::vector<TopoDS_Shape> result;
|
||||
App::GroupExtension* gex = dynamic_cast<App::GroupExtension*>(docObj);
|
||||
App::Property* gProp = docObj->getPropertyByName("Group");
|
||||
@@ -250,6 +253,7 @@ std::vector<TopoDS_Shape> DrawViewPart::getShapesFromObject(App::DocumentObject*
|
||||
|
||||
TopoDS_Shape DrawViewPart::getSourceShapeFused(void) const
|
||||
{
|
||||
// Base::Console().Message("DVP::getSourceShapeFused() - %s\n", getNameInDocument());
|
||||
TopoDS_Shape baseShape = getSourceShape();
|
||||
if (!baseShape.IsNull()) {
|
||||
TopoDS_Iterator it(baseShape);
|
||||
@@ -272,6 +276,7 @@ TopoDS_Shape DrawViewPart::getSourceShapeFused(void) const
|
||||
|
||||
App::DocumentObjectExecReturn *DrawViewPart::execute(void)
|
||||
{
|
||||
// Base::Console().Message("DVP::execute() - %s\n", getNameInDocument());
|
||||
if (!keepUpdated()) {
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
@@ -382,6 +387,7 @@ void DrawViewPart::onChanged(const App::Property* prop)
|
||||
//note: slightly different than routine with same name in DrawProjectSplit
|
||||
TechDrawGeometry::GeometryObject* DrawViewPart::buildGeometryObject(TopoDS_Shape shape, gp_Ax2 viewAxis)
|
||||
{
|
||||
// Base::Console().Message("DVP::buildGO() - %s\n", getNameInDocument());
|
||||
TechDrawGeometry::GeometryObject* go = new TechDrawGeometry::GeometryObject(getNameInDocument(), this);
|
||||
go->setIsoCount(IsoCount.getValue());
|
||||
go->isPerspective(Perspective.getValue());
|
||||
@@ -436,11 +442,15 @@ TechDrawGeometry::GeometryObject* DrawViewPart::buildGeometryObject(TopoDS_Shape
|
||||
go->extractGeometry(TechDrawGeometry::ecUVISO,
|
||||
false);
|
||||
}
|
||||
|
||||
auto end = chrono::high_resolution_clock::now();
|
||||
auto diff = end - start;
|
||||
double diffOut = chrono::duration <double, milli> (diff).count();
|
||||
Base::Console().Log("TIMING - %s DVP spent: %.3f millisecs in GO::extractGeometry\n",getNameInDocument(),diffOut);
|
||||
|
||||
const std::vector<TechDrawGeometry::BaseGeom *> & edges = go->getEdgeGeometry();
|
||||
if (edges.empty()) {
|
||||
Base::Console().Log("DVP::buildGO - NO extracted edges!\n");
|
||||
}
|
||||
bbox = go->calcBoundingBox();
|
||||
return go;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user