mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-26 11:05:31 +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
133 lines
2.8 KiB
Plaintext
133 lines
2.8 KiB
Plaintext
# =================== OCAF ======================
|
|
# Naming
|
|
#
|
|
# Testing purpose: Naming selection mechanism
|
|
#
|
|
# Test case: F5 (ShapeOrientation is not used)
|
|
# 1. Create 4 points: $Pnt1 - $Pnt4
|
|
# 2. Create closed line $Lin2
|
|
# 3. Create prism Pr ($Prism)
|
|
# 4. Create 2 prisms $Prism1, $Prism2
|
|
# 5. $FS1 = Fuse ($Prism1, $Prism2); $FS2 = Fuse ($Prism1, $Prism3)
|
|
# 6. Create sphere $Sph
|
|
# 7. Cut sphere $Cut1 = Cut ($Prism, $Sph)
|
|
# 8. Make selections for all sub-shapes
|
|
# 9. Modify $Pnt1
|
|
# 10. Recompute modeling functions
|
|
# 11. Recompute selections
|
|
# ===============================================
|
|
|
|
#pload FULL
|
|
erase
|
|
Close D
|
|
|
|
NewDocument D MDTV-Standard
|
|
isos 12
|
|
|
|
#1 - create 4 Pnts
|
|
NewCommand D
|
|
AddDriver D PntXYZ PntRLT Line3D Attach;
|
|
set Pnt1 [AddPoint D 0 0 0]; ## add point1
|
|
ComputeFun D $Pnt1:1; ## compute function
|
|
GetShape D $Pnt1:1:2 P1; ## check result
|
|
whatis P1
|
|
# referes to result NS
|
|
GetReference D $Pnt1; ## check is reference set
|
|
|
|
set Pnt2 [AddPoint D 0 200 0];
|
|
ComputeFun D $Pnt2:1;
|
|
set Pnt3 [AddPoint D 200 200 0];
|
|
ComputeFun D $Pnt3:1;
|
|
set Pnt4 [AddPoint D 200 0 0];
|
|
ComputeFun D $Pnt4:1;
|
|
GetShape D $Pnt2:1:2 P2;
|
|
GetShape D $Pnt3:1:2 P3;
|
|
GetShape D $Pnt4:1:2 P4;
|
|
|
|
#2 create closed Lin2
|
|
NewCommand D
|
|
set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4]
|
|
ComputeFun D $Lin2:1;
|
|
GetShape D $Lin2:1:2 L1;
|
|
|
|
#3 Prism
|
|
NewCommand D
|
|
AddDriver D Prism
|
|
set Prism [AddPrism D $Lin2 300 0]
|
|
ComputeFun D $Prism:1
|
|
GetShape D $Prism:1:2 Pr
|
|
GetReference D $Prism; ## check is reference set
|
|
|
|
#4 create two prisms
|
|
NewCommand D
|
|
explode Pr F
|
|
set Bas1 [AttachShape D Pr_1 ${Prism} ${Prism} 1]
|
|
set Bas2 [AttachShape D Pr_4 ${Prism} ${Prism} 1]
|
|
|
|
set Prism2 [AddPrism D $Bas1 300 0]
|
|
ComputeFun D $Prism2:1
|
|
GetShape D $Prism2:1:2 Pr2
|
|
|
|
|
|
set Prism3 [AddPrism D $Bas2 500 0]
|
|
ComputeFun D $Prism3:1
|
|
GetShape D $Prism3:1:2 Pr3
|
|
|
|
#5 => fuse
|
|
NewCommand D
|
|
AddDriver D Fuse Sph Cut
|
|
set FS1 [AddFuse D $Prism $Prism2]
|
|
ComputeFun D $FS1
|
|
GetShape D $FS1:2 Pr
|
|
|
|
set FS2 [AddFuse D $Prism $Prism3]
|
|
ComputeFun D $FS2
|
|
GetShape D $FS2:2 Pr
|
|
|
|
#6
|
|
set Sph [AddSphere D $Pnt3 150]
|
|
NewCommand D
|
|
ComputeFun D $Sph:1
|
|
GetShape D $Sph:1:2 Sp
|
|
|
|
#7 Cut sphere
|
|
NewCommand D
|
|
set Cut1 [AddCut D $Prism $Sph]
|
|
ComputeFun D $Cut1
|
|
GetShape D $Cut1:2 Pr
|
|
don Pr
|
|
|
|
#8 test selection
|
|
NewCommand D
|
|
set SL [TestSingleSelection D $Prism 0]
|
|
set SL2 [TestMultipleSelection D $Prism 0]
|
|
|
|
|
|
|
|
#9 modify
|
|
PntOffset D $Pnt1 50 30 skip
|
|
|
|
#10 recompute
|
|
NewCommand D
|
|
ComputeFun D $Pnt1:1
|
|
ComputeFun D $Lin2:1
|
|
ComputeFun D $Prism:1
|
|
ComputeFun D $Bas1:1
|
|
ComputeFun D $Bas2:1
|
|
ComputeFun D $Prism2:1
|
|
ComputeFun D $Prism3:1
|
|
ComputeFun D $FS1
|
|
ComputeFun D $FS2
|
|
ComputeFun D $Sph:1
|
|
ComputeFun D $Cut1
|
|
erase
|
|
GetShape D $Cut1:2 Pr
|
|
#GetShape D $Prism:1:2 Pr
|
|
#GetShape D $Prism2:1:2 Pr2
|
|
#GetShape D $Prism3:1:2 Pr3
|
|
|
|
#11 recomputation of entities of the TestSelection commands
|
|
SolveFlatFrom D $SL
|
|
NewCommand D
|
|
|