mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
0033165: Data exchange - Instance name is not saved during writing step file
Instance name is saved also with identity location transformation
This commit is contained in:
parent
f73592edf0
commit
3c9178dd5c
@ -1595,8 +1595,10 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
|
|||||||
// SINON, la shape est prise et transferee telle quelle
|
// SINON, la shape est prise et transferee telle quelle
|
||||||
TopoDS_Shape sh0 = shape;
|
TopoDS_Shape sh0 = shape;
|
||||||
gp_Trsf aLoc;
|
gp_Trsf aLoc;
|
||||||
|
Standard_Boolean isShapeLocated = Standard_False;
|
||||||
if ( GroupMode() >0) {
|
if ( GroupMode() >0) {
|
||||||
TopLoc_Location shloc = shape.Location();
|
TopLoc_Location shloc = shape.Location();
|
||||||
|
isShapeLocated = !shloc.IsIdentity();
|
||||||
aLoc = shloc.Transformation();
|
aLoc = shloc.Transformation();
|
||||||
TopLoc_Location shident;
|
TopLoc_Location shident;
|
||||||
sh0.Location (shident);
|
sh0.Location (shident);
|
||||||
@ -1676,7 +1678,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
|
|||||||
myContext.NextIndex();
|
myContext.NextIndex();
|
||||||
|
|
||||||
// abv 16.10.00: bind CDSR (et al) to located shape in order to be able to track instances
|
// abv 16.10.00: bind CDSR (et al) to located shape in order to be able to track instances
|
||||||
if (mapper != start && aLoc.Form() != gp_Identity) {
|
if (mapper != start && isShapeLocated) {
|
||||||
Handle(Transfer_Binder) bnd = FP->Find ( start );
|
Handle(Transfer_Binder) bnd = FP->Find ( start );
|
||||||
for ( Standard_Integer j=1; j <= roots->Length(); j++ )
|
for ( Standard_Integer j=1; j <= roots->Length(); j++ )
|
||||||
if ( bnd.IsNull() ) bnd = TransientResult ( roots->Value(j) );
|
if ( bnd.IsNull() ) bnd = TransientResult ( roots->Value(j) );
|
||||||
|
41
tests/bugs/modalg_8/bug33165
Normal file
41
tests/bugs/modalg_8/bug33165
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
puts "===================================="
|
||||||
|
puts "0033165: Data exchange - Instance name is not saved during writing step file"
|
||||||
|
puts "===================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload OCAF XDEDRAW
|
||||||
|
|
||||||
|
box b 1 1 1
|
||||||
|
reset b
|
||||||
|
copy b b1
|
||||||
|
|
||||||
|
# set valid location with identity matrix
|
||||||
|
reset b1
|
||||||
|
|
||||||
|
ttranslate b 1 1 1
|
||||||
|
|
||||||
|
compound b1 b c
|
||||||
|
XNewDoc d
|
||||||
|
XAddShape d c 1
|
||||||
|
|
||||||
|
set label1 "0:1:1:1:1"
|
||||||
|
set label2 "0:1:1:1:2"
|
||||||
|
set name1 "name1"
|
||||||
|
set name2 "name2"
|
||||||
|
|
||||||
|
SetName d $label1 $name1
|
||||||
|
SetName d $label2 $name2
|
||||||
|
|
||||||
|
set file $imagedir/${test_image}.stp
|
||||||
|
WriteStep d $file
|
||||||
|
ReadStep d1 $file
|
||||||
|
|
||||||
|
if { [GetName d1 $label1] != $name1 } {
|
||||||
|
puts "Error: The name is missed"
|
||||||
|
}
|
||||||
|
|
||||||
|
if { [GetName d1 $label2] != $name2 } {
|
||||||
|
puts "Error: The name is missed"
|
||||||
|
}
|
||||||
|
|
||||||
|
file delete -force ${file}
|
Loading…
x
Reference in New Issue
Block a user