0029604: Uniform mechanism providing History of shape's modifications for OCCT algori...
[occt.git] / tests / boolean / history / A3
CommitLineData
803a8caf 1puts "Check History of Boolean operations"
2
3puts "Case with overlapping planar faces"
4
5plane p 0 0 0 0 0 1
6mkface f1 p -10 10 -10 10
7mkface f2 p 0 20 -10 10
8
9bclearobjects
10bcleartools
11baddobjects f1
12baddtools f2
13bfillds
14
15puts "Common operation"
16bbop rcom 0
17
4f7d41ea 18# get history of the operation
19savehistory com_hist
803a8caf 20
21# check that both f1 and f2 have not been deleted
4f7d41ea 22if {[string trim [isdeleted com_hist f1]] != "Not deleted."} {
803a8caf 23 puts "Error: Incorrect information about Deleted shapes"
24}
25
4f7d41ea 26if {[string trim [isdeleted com_hist f2]] != "Not deleted."} {
803a8caf 27 puts "Error: Incorrect information about Deleted shapes"
28}
29
30# check that both f1 and f2 have been Modified into the same face
4f7d41ea 31modified rm1 com_hist f1
803a8caf 32checknbshapes rm1 -face 1 -m "Information about modification of f1"
33
4f7d41ea 34modified rm2 com_hist f2
803a8caf 35checknbshapes rm2 -face 1 -m "Information about modification of f2"
36
37compound rm1 rm2 cm
38checknbshapes cm -face 1 -m "Information about modification of f1 and f2"
39
40
41# check that none of the f1 and f2 have Generated shapes
4f7d41ea 42if {[string trim [generated rg com_hist f1]] != "No shapes were generated from the shape."} {
803a8caf 43 puts "Error: Incorrect information about Generated shapes"
44}
45
4f7d41ea 46if {[string trim [generated rg com_hist f2]] != "No shapes were generated from the shape."} {
803a8caf 47 puts "Error: Incorrect information about Generated shapes"
48}
49
50
51puts "Fuse operation"
52bbop rfuse 1
53
4f7d41ea 54# get history of the operation
55savehistory fuse_hist
56
803a8caf 57# check that both f1 and f2 have not been deleted
4f7d41ea 58if {[string trim [isdeleted fuse_hist f1]] != "Not deleted."} {
803a8caf 59 puts "Error: Incorrect information about Deleted shapes"
60}
61
4f7d41ea 62if {[string trim [isdeleted fuse_hist f2]] != "Not deleted."} {
803a8caf 63 puts "Error: Incorrect information about Deleted shapes"
64}
65
66# check that both f1 and f2 have been Modified
4f7d41ea 67modified rm fuse_hist f1
803a8caf 68checknbshapes rm -face 2 -m "Information about modification of f1"
69
4f7d41ea 70modified rm fuse_hist f2
803a8caf 71checknbshapes rm -face 2 -m "Information about modification of f2"
72
73# check that none of the f1 and f2 have Generated shapes
4f7d41ea 74if {[string trim [generated rg fuse_hist f1]] != "No shapes were generated from the shape."} {
803a8caf 75 puts "Error: Incorrect information about Generated shapes"
76}
77
4f7d41ea 78if {[string trim [generated rg fuse_hist f2]] != "No shapes were generated from the shape."} {
803a8caf 79 puts "Error: Incorrect information about Generated shapes"
80}
81
82
83puts "CUT operation"
84bbop rcut 2
85
4f7d41ea 86# get history of the operation
87savehistory cut_hist
88
803a8caf 89# check that f1 has not been deleted
4f7d41ea 90if {[string trim [isdeleted cut_hist f1]] != "Not deleted."} {
803a8caf 91 puts "Error: Incorrect information about Deleted shapes"
92}
93
94# check that f2 has been deleted
4f7d41ea 95if {[string trim [isdeleted cut_hist f2]] != "Deleted."} {
803a8caf 96 puts "Error: Incorrect information about Deleted shapes"
97}
98
99# check that f1 has been modified
4f7d41ea 100modified rm cut_hist f1
803a8caf 101checknbshapes rm -face 1 -m "Information about modification of f1"
102
103# check that f2 has not been modified
4f7d41ea 104if {[string trim [modified rm cut_hist f2]] != "The shape has not been modified."} {
803a8caf 105 puts "Error: Incorrect information about Modified shapes"
106}
107
108# check that none of the f1 and f2 have Generated shapes
4f7d41ea 109if {[string trim [generated rg cut_hist f1]] != "No shapes were generated from the shape."} {
803a8caf 110 puts "Error: Incorrect information about Generated shapes"
111}
112
4f7d41ea 113if {[string trim [generated rg cut_hist f2]] != "No shapes were generated from the shape."} {
803a8caf 114 puts "Error: Incorrect information about Generated shapes"
115}
116
117
118puts "TUC operation"
119bbop rtuc 3
120
4f7d41ea 121# get history of the operation
122savehistory tuc_hist
123
803a8caf 124# check that f1 has been deleted
4f7d41ea 125if {[string trim [isdeleted tuc_hist f1]] != "Deleted."} {
803a8caf 126 puts "Error: Incorrect information about Deleted shapes"
127}
128
129# check that f2 has not been deleted
4f7d41ea 130if {[string trim [isdeleted tuc_hist f2]] != "Not deleted."} {
803a8caf 131 puts "Error: Incorrect information about Deleted shapes"
132}
133
134# check that f1 has not been modified
4f7d41ea 135if {[string trim [modified rm tuc_hist f1]] != "The shape has not been modified."} {
803a8caf 136 puts "Error: Incorrect information about Modified shapes"
137}
138
139# check that f2 has been modified
4f7d41ea 140modified rm tuc_hist f2
803a8caf 141checknbshapes rm -face 1 -m "Information about modification of f1"
142
143# check that none of the f1 and f2 have Generated shapes
4f7d41ea 144if {[string trim [generated rg tuc_hist f1]] != "No shapes were generated from the shape."} {
803a8caf 145 puts "Error: Incorrect information about Generated shapes"
146}
147
4f7d41ea 148if {[string trim [generated rg tuc_hist f2]] != "No shapes were generated from the shape."} {
803a8caf 149 puts "Error: Incorrect information about Generated shapes"
150}
151
152
153
154puts "SECTION operation"
155bbop rsec 4
156
4f7d41ea 157# get history of the operation
158savehistory sec_hist
159
803a8caf 160# check that both f1 and f2 have been deleted
4f7d41ea 161if {[string trim [isdeleted sec_hist f1]] != "Deleted."} {
803a8caf 162 puts "Error: Incorrect information about Deleted shapes"
163}
164
4f7d41ea 165if {[string trim [isdeleted sec_hist f2]] != "Deleted."} {
803a8caf 166 puts "Error: Incorrect information about Deleted shapes"
167}
168
169# check that none of the f1 and f2 have been Modified
4f7d41ea 170if {[string trim [modified rm sec_hist f1]] != "The shape has not been modified."} {
803a8caf 171 puts "Error: Incorrect information about Modified shapes"
172}
173
4f7d41ea 174if {[string trim [modified rm sec_hist f2]] != "The shape has not been modified."} {
803a8caf 175 puts "Error: Incorrect information about Modified shapes"
176}
177
178# check that none of the f1 and f2 have Generated shapes
4f7d41ea 179if {[string trim [generated rg sec_hist f1]] != "No shapes were generated from the shape."} {
803a8caf 180 puts "Error: Incorrect information about Generated shapes"
181}
182
4f7d41ea 183if {[string trim [generated rg sec_hist f2]] != "No shapes were generated from the shape."} {
803a8caf 184 puts "Error: Incorrect information about Generated shapes"
185}