HLR looses Shape for some ProjGroupItems

This commit is contained in:
WandererFan
2016-03-06 19:54:50 -05:00
committed by wmayer
parent 683b44e1ff
commit 8de536c0e1
2 changed files with 5 additions and 8 deletions

View File

@@ -176,9 +176,9 @@ void GeometryObject::initHLR(const TopoDS_Shape &input,
//TODO: hate losing references on recompute! if Shape has changed, aren't reference potentially invalid anyway?
clear();
if (brep_hlr) {
brep_hlr->Remove(1); //remove the old shape from brep (use NbShapes() first? would we ever have > 1 shape?)
//delete brep_hlr; //release old hlralgo
//brep_hlr = NULL;
if (brep_hlr->NbShapes()) { //TODO: hack. in ProjGroupItems sometimes brep_hlr has no shapes when we get here. why??
brep_hlr->Remove(1); //remove the old shape from brep (would we ever have > 1 shape?)
}
}
///TODO: Consider whether it would be possible/beneficial to cache some of this effort (eg don't do scale in OpenCASCADE land) IR
@@ -204,7 +204,7 @@ void GeometryObject::initHLR(const TopoDS_Shape &input,
BRepBuilderAPI_Transform mkTrf(input, tempTransform);
transShape = mkTrf.Shape();
brep_hlr = new HLRBRep_Algo(); //leak? when does this get freed?
brep_hlr = new HLRBRep_Algo(); //leak? when does this get freed? handle/smart pointer
brep_hlr->Add(transShape);
// Project the shape into view space with the object's centroid