Remove all TopLoc_Location after IGES/STEP import

Hi everybody,
I have a problem after importing IGES/STEP file. I want to remove all TopLoc_Location associated to each TopoDS_Shape in order to have real objects (Geom_Surface, Geom_Curve) inside the real coordinate system.
I want to do this because we transform after that the geom objects into our own object and we cannot manage TopLoc_Location.
Is there is simple way to do this? Because i try to apply TopLoc_Location on each geom obj but some TopoDS_Shape share same TopLoc_Location....and i don't understand correclty the mechanism.

Thanks a lot by advance.

Francesco's picture

Hi,
you can try with ShapeUpgrade_RemoveLocations.
if you have a TopoDS_Solid mySol:
ShapeUpgrade_RemoveLocations sh_rem;
Standard_Boolean ret = sh_rem.Remove (mySol);
// then check ret :-)
TopoDS_Solid retSol = TopoDS::Solid(sh_rem.GetResult ()) ;

Then for every old face you can also get the new one
const TopoDS_Shape & newF = sh_rem.ModifiedShape(oldF);

f.viallet's picture

Hi,
Thanks for your reply,
I try this function but i think this method just remove location of TopoDS_Shape, but doesn't modify the real Geom_Surface and Geom_Curve.
For example, if there is a transformation location inside a TopoDS_Face, the geom_surface is not translated.
I may made a mistake.....

Thanks for your help.

Francesco's picture

in my code it works...