X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FDBRep%2FDBRep.cxx;h=214ba8bf3e879e0fd5c4201810fc26bcb3785423;hp=f5d8ad9b15813d29101b7961392bb68ca73c057a;hb=09543c2d99f53edff60fd66a0f9725f68b16b686;hpb=a7400019ce5fc3d26328a95c7286fa4133e371c4 diff --git a/src/DBRep/DBRep.cxx b/src/DBRep/DBRep.cxx index f5d8ad9..214ba8b 100644 --- a/src/DBRep/DBRep.cxx +++ b/src/DBRep/DBRep.cxx @@ -1417,6 +1417,39 @@ static Standard_Integer binrestore(Draw_Interpretor& di, Standard_Integer n, con } //======================================================================= +// removeinternals +//======================================================================= +static Standard_Integer removeInternals (Draw_Interpretor& di, + Standard_Integer n, + const char** a) +{ + if (n < 2) + { + di.PrintHelp (a[0]); + return 1; + } + + TopoDS_Shape aShape = DBRep::Get (a[1]); + if (aShape.IsNull()) + { + di << a[1] << "is a null shape\n"; + return 1; + } + + Standard_Boolean isForce = Standard_False; + if (n > 2) + { + isForce = (Draw::Atoi (a[2]) != 0); + } + + BRepTools::RemoveInternals (aShape, isForce); + + DBRep::Set (a[1], aShape); + + return 0; +} + +//======================================================================= //function : BasicCommands //purpose : //======================================================================= @@ -1487,6 +1520,12 @@ void DBRep::BasicCommands(Draw_Interpretor& theCommands) theCommands.Add("binrestore", "binrestore filename shape\n" "\t\trestore the shape from the binary format file", __FILE__, binrestore, g); + + theCommands.Add ("removeinternals", "removeinternals shape [force flag {0/1}]" + "\n\t\t Removes sub-shapes with internal orientation from the shape.\n" + "\n\t\t Force flag disables the check on topological connectivity and" + "removes all internal sub-shapes\n", + __FILE__, removeInternals, g); } //=======================================================================