1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-01 10:26:12 +03:00
gka 24de79c3a5 0023523: In session DRAW it is impossible to close document having name already once closed document.
Added destructor for TDocStd_Document which performs destruction of document in logical order in order to avoid exception when Undo and Redo fields are destructed after THF_Data field.
Added removing name of closed document from tcl variables in the DRAW in order to avoid exception during use the same name for new document.
Modification to avoid compilation error class ViewerTest
Minor correction in test caf basic G3
2012-12-14 16:17:11 +04:00

145 lines
3.3 KiB
Plaintext

# ============= OCAF ============================
# Naming
#
# Testing purpose: Naming selection mechanism
#
# Test case: E9 (ShapeOrientation is not used)
#
# 1. Create Box B1
# 2. Create 4 spheres ($Sph1 - $Sph4)
# 3. Rotate all spheres around line
# 4. Fuse all spheres with box B1
# 5. Make selection for all sub-shapes
# 6. Modify B1
# 7. Recompute modeling functions
# 8. Recompute selections
# ===============================================
#pload FULL
erase
Close D
NewDocument D MDTV-Standard
isos 12
#1 - create Box using short-cut
NewCommand D
AddDriver D Box; ## add box driver to driver table
set B1 [AddBox D 130 140 150]; ## add box
ComputeFun D $B1:1; ## compute box1 function
GetShape D $B1:1:2 Box1; ## check result
whatis Box1
# referes to result NS
GetReference D $B1; ## check is reference set
#2 - create 4 spheres
AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
NewCommand D
explode Box1 V
set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment
set SPnt2 [AttachShape D Box1_2 ${B1} ${B1} 0]; ## set attachment
set SPnt3 [AttachShape D Box1_3 ${B1} ${B1} 0]; ## set attachment
set SPnt4 [AttachShape D Box1_4 ${B1} ${B1} 0]; ## set attachment
set Sph1 [AddSphere D $SPnt1 25]
ComputeFun D $Sph1:1
GetShape D $Sph1:1:2 Sp1
set Sph2 [AddSphere D $SPnt2 25]
ComputeFun D $Sph2:1
GetShape D $Sph2:1:2 Sp2
set Sph3 [AddSphere D $SPnt3 25]
ComputeFun D $Sph3:1
GetShape D $Sph3:1:2 Sp3
set Sph4 [AddSphere D $SPnt4 25]
ComputeFun D $Sph4:1
GetShape D $Sph4:1:2 Sp4
NewCommand D
#3 Rotate spheres
explode Box1 E
set Sel1 [AttachShape D Box1_1 ${B1} ${B1} 0];
set FR1 [PRotateRoundLine D $Sph1 $Sel1 120]
ComputeFun D $FR1
GetShape D $FR1:2 Sp1
set Sel2 [AttachShape D Box1_1 ${B1} ${B1} 0];
set FR2 [PRotateRoundLine D $Sph2 $Sel2 120]
ComputeFun D $FR2
GetShape D $FR2:2 Sp2
set Sel3 [AttachShape D Box1_3 ${B1} ${B1} 0];
set FR3 [PRotateRoundLine D $Sph3 $Sel3 120]
ComputeFun D $FR3
GetShape D $FR3:2 Sp3
set Sel4 [AttachShape D Box1_3 ${B1} ${B1} 0];
set FR4 [PRotateRoundLine D $Sph4 $Sel4 120]
ComputeFun D $FR4
GetShape D $FR4:2 Sp4
NewCommand D
#4 Fuse spheres
set FS1 [AddFuse D $B1 $Sph1]
ComputeFun D $FS1
GetShape D $FS1:2 Box1
set FS2 [AddFuse D $B1 $Sph2]
ComputeFun D $FS2
GetShape D $FS2:2 Box1
set FS3 [AddFuse D $B1 $Sph3]
ComputeFun D $FS3
GetShape D $FS3:2 Box1
set FS4 [AddFuse D $B1 $Sph4]
ComputeFun D $FS4
GetShape D $FS4:2 Box1
#5 test selection
NewCommand D
set SL [TestSingleSelection D $B1 0]
set SL2 [TestMultipleSelection D $B1 0]
#6 modification
NewCommand D
BoxDX D $B1 210
BoxDZ D $B1 270
#7 recomputation
NewCommand D
InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
ComputeFun D $B1:1
ComputeFun D $SPnt1:1
ComputeFun D $SPnt2:1
ComputeFun D $SPnt3:1
ComputeFun D $SPnt4:1
ComputeFun D $Sph1:1
ComputeFun D $Sph2:1
ComputeFun D $Sph3:1
ComputeFun D $Sph4:1
ComputeFun D $Sel1:1
ComputeFun D $Sel2:1
ComputeFun D $Sel3:1
ComputeFun D $Sel4:1
ComputeFun D $FR1
ComputeFun D $FR2
ComputeFun D $FR3
ComputeFun D $FR4
ComputeFun D $FS1
ComputeFun D $FS2
ComputeFun D $FS3
ComputeFun D $FS4
erase
GetShape D $FS4:2 Box1
#8 recomputation of entities of the TestSelection commands
SolveFlatFrom D $SL
NewCommand D