2 if { [array get Draw_Groups "TOPOLOGY Check commands"] == "" } {
9 if { [info exists imagedir] == 0 } {
12 if { [info exists test_image] == 0 } {
16 set scriptdir [file dirname [info script]]
20 #################### procedure GetDigit returns digit (cutted) from string ####################
23 for {set a 0} {$a < [string length $s]} {incr a} {
24 if {[string index $s $a]>="0" && [string index $s $a]<="9"} {
25 set res [set res][string index $s $a]
27 if {[string index $s $a]=="e" || [string index $s $a]=="-"} {
28 set res [set res][string index $s $a]
35 #################### procedure ShapeCenter returns (three coords string) center of given shape
36 proc ShapeCenter {s} {
39 return [CenterOfShape $s]
40 # set ss [explode $s V]
41 # if {[llength $ss] == 0} {set ss $s}
45 # for {set a 0} {[lindex $ss $a] != ""} {incr a} {
46 # set dmp [dump [lindex $ss $a]]
47 # set fromindex [lsearch $dmp Elementary]
48 # if {$fromindex != -1} {
49 # set x [expr $x+[GetDigit [lindex $dmp [expr $fromindex+6]]]]
50 # set y [expr $y+[GetDigit [lindex $dmp [expr $fromindex+12]]]]
51 # set z [expr $z+[GetDigit [lindex $dmp [expr $fromindex+18]]]]
53 # set fromindex [lsearch $dmp "3D"]
54 # set x [expr $x+[GetDigit [lindex $dmp [expr $fromindex+2]]]]
55 # set y [expr $y+[GetDigit [lindex $dmp [expr $fromindex+3]]]]
56 # set z [expr $z+[GetDigit [lindex $dmp [expr $fromindex+4]]]]
58 # set x [expr $x/[llength $ss]]
59 # set y [expr $y/[llength $ss]]
60 # set z [expr $z/[llength $ss]]
64 #################### procedure IsSame returns true, if given shapes has same TShapes ####################
68 if {[IsSameShapes $s1 $s2] == 1} {return 1}
73 # if {[llength $d1]<10 || [llength $d2]<10} {
77 # if {[lindex [dump $s1] 28] == [lindex [dump $s2] 28]} {
78 # if {[lindex [dump $s1] 29] == [lindex [dump $s2] 29]} {return 1}
83 #################### procedure NextLabel set lab as next label of lab at this level ####################
84 proc NextLabel {lab} {
86 set i [string last ":" "[set l]"]
87 if {$i == -1} {set l [expr [set l]+1]} else {
88 set l [string range [set l] 0 $i][expr 1+[string range [set l] [expr $i+1] [string length [set l]]]]
92 #################### checking the naming at myLab label ( tests at myNameLab label ) ####################
93 #################### show errors, increments working labels ####################
94 proc Checking {Name} {
95 global D IsDone TestError
96 upvar 1 myLab l1 myNameLab l2
99 if {[catch {set bad [CheckNaming D $l2 1 Label $l1 1 1 1]}]} {
101 set TestError "$TestError # $Name naming failed at label $l2 with exception"
103 if {[llength $bad] > 0} {
105 set TestError "$TestError # $Name naming failed at label $l2 sublabels $bad"