mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0028471: ShapeUpgrade_RemoveLocations breaks sharing of sub-shapes
- Add option 'remove_level' to the command 'removeloc'. - Add test case. Minor correction of test case
This commit is contained in:
parent
0da0275c18
commit
15b2583e69
@ -1259,7 +1259,7 @@ static Standard_Integer removeloc (Draw_Interpretor& di,
|
|||||||
const char** argv)
|
const char** argv)
|
||||||
{
|
{
|
||||||
if (argc<3) {
|
if (argc<3) {
|
||||||
di << "bad number of arguments. Should be: removeloc res shape\n";
|
di << "bad number of arguments. Should be: removeloc res shape [remove_level(see ShapeEnum)]\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1267,6 +1267,8 @@ static Standard_Integer removeloc (Draw_Interpretor& di,
|
|||||||
if(aShape.IsNull())
|
if(aShape.IsNull())
|
||||||
return 1;
|
return 1;
|
||||||
ShapeUpgrade_RemoveLocations aRemLoc;
|
ShapeUpgrade_RemoveLocations aRemLoc;
|
||||||
|
if (argc > 3)
|
||||||
|
aRemLoc.SetRemoveLevel((TopAbs_ShapeEnum)Draw::Atoi(argv[3]));
|
||||||
aRemLoc.Remove(aShape);
|
aRemLoc.Remove(aShape);
|
||||||
TopoDS_Shape aNewShape = aRemLoc.GetResult();
|
TopoDS_Shape aNewShape = aRemLoc.GetResult();
|
||||||
|
|
||||||
@ -1376,7 +1378,7 @@ static Standard_Integer copytranslate(Draw_Interpretor& di,
|
|||||||
const char** argv)
|
const char** argv)
|
||||||
{
|
{
|
||||||
if (argc<6) {
|
if (argc<6) {
|
||||||
di << "bad number of arguments. Should be: removeloc res shape dx dyy dz\n";
|
di << "bad number of arguments. Should be: copytranslate res shape dx dy dz\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
TopoDS_Shape aShape = DBRep::Get(argv[2]);
|
TopoDS_Shape aShape = DBRep::Get(argv[2]);
|
||||||
@ -1571,7 +1573,7 @@ Standard_Integer reshape(Draw_Interpretor& di,
|
|||||||
theCommands.Add ("RemoveIntWires","result minarea wholeshape [faces or wires] [moderemoveface ]",
|
theCommands.Add ("RemoveIntWires","result minarea wholeshape [faces or wires] [moderemoveface ]",
|
||||||
__FILE__,removeinternalwires,g);
|
__FILE__,removeinternalwires,g);
|
||||||
|
|
||||||
theCommands.Add ("removeloc","result shape",__FILE__,removeloc,g);
|
theCommands.Add ("removeloc","result shape [remove_level(see ShapeEnum)]",__FILE__,removeloc,g);
|
||||||
|
|
||||||
theCommands.Add ("unifysamedom",
|
theCommands.Add ("unifysamedom",
|
||||||
"unifysamedom result shape [-f] [-e] [+b] [-i] [-t val] [-a val]", __FILE__,unifysamedom,g);
|
"unifysamedom result shape [-f] [-e] [+b] [-i] [-t val] [-a val]", __FILE__,unifysamedom,g);
|
||||||
|
14
tests/bugs/heal/bug28471
Normal file
14
tests/bugs/heal/bug28471
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "OCC28471"
|
||||||
|
puts "======="
|
||||||
|
puts ""
|
||||||
|
##################################################
|
||||||
|
# ShapeUpgrade_RemoveLocations breaks sharing of sub-shapes
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28471_faces_share_vertex.brep] a
|
||||||
|
|
||||||
|
set remove_level 0 ;# allow compound
|
||||||
|
removeloc r a $remove_level
|
||||||
|
|
||||||
|
checknbshapes r -ref [nbshapes a]
|
Loading…
x
Reference in New Issue
Block a user