mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0031469: BRepFeat_MakePrism failed
BRepFeat_Form.cxx: methods IsDeleted, Modified, Generated are corrected BRepTest_FeatureCommands.cxx: history treatment is added in methods DEFIN and PERF bugs/modalg_7/bug31469: test case added
This commit is contained in:
parent
9171cefaad
commit
f0ada3e8d4
@ -1015,7 +1015,11 @@ static void Descendants(const TopoDS_Shape&,
|
|||||||
|
|
||||||
Standard_Boolean BRepFeat_Form::IsDeleted(const TopoDS_Shape& F)
|
Standard_Boolean BRepFeat_Form::IsDeleted(const TopoDS_Shape& F)
|
||||||
{
|
{
|
||||||
|
if (myMap.IsBound(F))
|
||||||
|
{
|
||||||
return (myMap(F).IsEmpty());
|
return (myMap(F).IsEmpty());
|
||||||
|
}
|
||||||
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1026,16 +1030,23 @@ Standard_Boolean BRepFeat_Form::IsDeleted(const TopoDS_Shape& F)
|
|||||||
const TopTools_ListOfShape& BRepFeat_Form::Modified
|
const TopTools_ListOfShape& BRepFeat_Form::Modified
|
||||||
(const TopoDS_Shape& F)
|
(const TopoDS_Shape& F)
|
||||||
{
|
{
|
||||||
|
myGenerated.Clear();
|
||||||
|
if (!IsDone())
|
||||||
|
return myGenerated;
|
||||||
|
|
||||||
|
if (mySbase.IsEqual(F))
|
||||||
|
{
|
||||||
|
myGenerated.Append(myShape);
|
||||||
|
return myGenerated;
|
||||||
|
}
|
||||||
|
|
||||||
if (myMap.IsBound(F)) {
|
if (myMap.IsBound(F)) {
|
||||||
static TopTools_ListOfShape list;
|
|
||||||
list.Clear(); // For the second passage DPF
|
|
||||||
TopTools_ListIteratorOfListOfShape ite(myMap(F));
|
TopTools_ListIteratorOfListOfShape ite(myMap(F));
|
||||||
for(; ite.More(); ite.Next()) {
|
for(; ite.More(); ite.Next()) {
|
||||||
const TopoDS_Shape& sh = ite.Value();
|
const TopoDS_Shape& sh = ite.Value();
|
||||||
if(!sh.IsSame(F))
|
if(!sh.IsSame(F) && sh.ShapeType() == F.ShapeType())
|
||||||
list.Append(sh);
|
myGenerated.Append(sh);
|
||||||
}
|
}
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
return myGenerated; // empty list
|
return myGenerated; // empty list
|
||||||
}
|
}
|
||||||
@ -1048,19 +1059,20 @@ const TopTools_ListOfShape& BRepFeat_Form::Modified
|
|||||||
const TopTools_ListOfShape& BRepFeat_Form::Generated
|
const TopTools_ListOfShape& BRepFeat_Form::Generated
|
||||||
(const TopoDS_Shape& S)
|
(const TopoDS_Shape& S)
|
||||||
{
|
{
|
||||||
|
myGenerated.Clear();
|
||||||
|
if (!IsDone())
|
||||||
|
return myGenerated;
|
||||||
if (myMap.IsBound(S) &&
|
if (myMap.IsBound(S) &&
|
||||||
S.ShapeType() != TopAbs_FACE) { // check if filter on face or not
|
S.ShapeType() != TopAbs_FACE) { // check if filter on face or not
|
||||||
static TopTools_ListOfShape list;
|
|
||||||
list.Clear(); // For the second passage DPF
|
|
||||||
TopTools_ListIteratorOfListOfShape ite(myMap(S));
|
TopTools_ListIteratorOfListOfShape ite(myMap(S));
|
||||||
for(; ite.More(); ite.Next()) {
|
for(; ite.More(); ite.Next()) {
|
||||||
const TopoDS_Shape& sh = ite.Value();
|
const TopoDS_Shape& sh = ite.Value();
|
||||||
if(!sh.IsSame(S))
|
if(!sh.IsSame(S))
|
||||||
list.Append(sh);
|
myGenerated.Append(sh);
|
||||||
}
|
}
|
||||||
return list;
|
return myGenerated;
|
||||||
}
|
}
|
||||||
else return myGenerated;
|
return myGenerated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
43
tests/bugs/modalg_7/bug31469
Normal file
43
tests/bugs/modalg_7/bug31469
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0031469: Modeling Algorithms - 0031469: BRepFeat_MakePrism has problem with method IsDeleted(...)"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
box S 400 250 300
|
||||||
|
|
||||||
|
explode S face
|
||||||
|
mksurface pl2 S_2
|
||||||
|
trim pl2 pl2 100 200 -200 -100
|
||||||
|
mkface pbase pl2
|
||||||
|
featprism S pbase S_2 -1 0 0 0 1
|
||||||
|
featperformval prism pp 200
|
||||||
|
checkshape pp
|
||||||
|
checknbshapes pp -vertex 12 -edge 20 -face 11 -solid 1
|
||||||
|
savehistory ph
|
||||||
|
if { ![regexp "Not deleted" [isdeleted ph S]] } {
|
||||||
|
puts "Error: S has wrong delete status"
|
||||||
|
}
|
||||||
|
|
||||||
|
if { ![regexp "Not deleted" [isdeleted ph S_2]] } {
|
||||||
|
puts "Error: S_2 has wrong delete status"
|
||||||
|
}
|
||||||
|
|
||||||
|
if {![regexp "The shape has not been modified." [modified m1 ph S]] } {
|
||||||
|
checknbshapes m1 -vertex 12 -edge 20 -face 11 -solid 1
|
||||||
|
} else {
|
||||||
|
puts "Error: S has wrong modified list"
|
||||||
|
}
|
||||||
|
|
||||||
|
if {![regexp "The shape has not been modified." [modified m2 ph S_2]] } {
|
||||||
|
checknbshapes m2 -vertex 8 -edge 8 -wire 2 -face 1
|
||||||
|
} else {
|
||||||
|
puts "Error: S_2 has wrong modified list"
|
||||||
|
}
|
||||||
|
|
||||||
|
explode pbase e
|
||||||
|
if {![regexp "No shapes were generated from the shape." [generated g1 ph pbase_1]] } {
|
||||||
|
checknbshapes g1 -vertex 2 -edge 3 -wire 1 -face 1
|
||||||
|
checkprops g1 -s 20000
|
||||||
|
} else {
|
||||||
|
puts "Error: pbase_1 has wrong generated list"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user