mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-06 10:36:12 +03:00
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
94 lines
2.1 KiB
Plaintext
94 lines
2.1 KiB
Plaintext
# ============= OCAF ============================
|
|
# Naming
|
|
#
|
|
# Testing purpose: Naming selection mechanism
|
|
#
|
|
# Test case: F2 (ShapeOrientation is not used)
|
|
#
|
|
# 1. Create Box $B1 (Box1)
|
|
# 2. Create sphere $Sph1
|
|
# 3. Create sphere $Sph2
|
|
# 4. Translate sphere $Sph2 along XYZ
|
|
# 5. Fuse spheres $FS1 = Fuse ($Sph1, $Sph2)
|
|
# 6. Make selection for all sub-shapes
|
|
# 7. Modify B1
|
|
# 8. Recompute modeling functions
|
|
# 9. 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 sphere1
|
|
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 Sph1 [AddSphere D $SPnt1 250]
|
|
ComputeFun D $Sph1:1
|
|
GetShape D $Sph1:1:2 Sp1
|
|
|
|
#3
|
|
NewCommand D
|
|
set Sph2 [AddSphere D $SPnt1 30]
|
|
ComputeFun D $Sph2:1
|
|
GetShape D $Sph2:1:2 Sp2
|
|
erase Box1
|
|
|
|
#4
|
|
NewCommand D
|
|
set FTr2 [PTranslateDXYZ D $Sph2 0 -253 0]
|
|
ComputeFun D $FTr2
|
|
GetShape D $Sph2:2:2 Sp2
|
|
|
|
|
|
#5 Fuse spheres
|
|
NewCommand D
|
|
set FS1 [AddFuse D $Sph1 $Sph2]
|
|
ComputeFun D $FS1
|
|
GetShape D $FS1:2 Sp1
|
|
|
|
#6 test selection
|
|
NewCommand D
|
|
set SL [TestSingleSelection D $Sph1 0]
|
|
## Wires defined as UNION (seam edge of each sphere) fail ==> linked with degenerated edges problem
|
|
set SL2 [TestMultipleSelection D $Sph1 0]
|
|
|
|
#7 modification
|
|
NewCommand D
|
|
BoxDZ D $B1 270
|
|
|
|
#8 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 $Sph1:1
|
|
ComputeFun D $Sph2:1
|
|
|
|
ComputeFun D $FTr2
|
|
ComputeFun D $FS1
|
|
erase
|
|
GetShape D $FS1:2 Sp1
|
|
|
|
|
|
#9 recomputation of entities of the TestSelection commands
|
|
SolveFlatFrom D $SL
|
|
NewCommand D
|
|
|