File: threeD.tk

package info (click to toggle)
dstooltk 2.0-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,520 kB
  • ctags: 3,169
  • sloc: ansic: 27,185; tcl: 4,770; makefile: 588; sh: 81; csh: 7
file content (120 lines) | stat: -rw-r--r-- 2,720 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# threeD.tk
#

proc threeD(build) wname {
    global Geomview
    global threeD

    build_Title $wname "Geomview threeD interface"

    build_DismissButtonbar $wname dbbar "window(dismiss) threeD" \
	{"Send to geomview" threeD(go)}

    set cmd [build_CmdFrame $wname cmd]

    build_PopupMenu $cmd var1 {} "Geomview(Index1)" \
	"threeD(var_go) 1" \
	[concat [array_to_listvalues Model Varb_Names] \
	     [array_to_listvalues Model Param_Names] \
	     [array_to_listvalues Model Funct_Names] \
	     0 ]

    build_PopupMenu $cmd var2 {} "Geomview(Index2)" \
	"threeD(var_go) 2" \
	[concat [array_to_listvalues Model Varb_Names] \
	     [array_to_listvalues Model Param_Names] \
	     [array_to_listvalues Model Funct_Names] \
	     0 ]

    build_PopupMenu $cmd var3 {} "Geomview(Index3)" \
	"threeD(var_go) 3" \
	[concat [array_to_listvalues Model Varb_Names] \
	     [array_to_listvalues Model Param_Names] \
	     [array_to_listvalues Model Funct_Names] \
	     0 ]

    build_Optionscol $cmd pick threeD(pickcolor) \
        [list "Pick color" Geomview(PickColor)]

    set threeD(Dots_Flag) 0

    build_Optionscol $cmd dots threeD(dots) \
        [list "Connect dots" threeD(Dots_Flag)]

    pack $cmd -fill both -expand 1

}

proc threeD(update) {} {
    tcl_to_pm Geomview
    pm_to_tcl Geomview
}

proc threeD(pickcolor) {} {
    threeD(update)
}

proc threeD(setdots) {} {
    global threeD

    set threeD(Mapping_Flag) [pm GET Model.Mapping_Flag]

    if {$threeD(Dots_Flag) == 1} {
      pm PUT Model.Mapping_Flag 0
    } else {
      pm PUT Model.Mapping_Flag 1
    }

    pm_to_tcl Model
}

proc threeD(unsetdots) {} {
    global threeD

    pm PUT Model.Mapping_Flag $threeD(Mapping_Flag)
    pm_to_tcl Model
}

proc threeD(dots) {} {
    global threeD
    threeD(update)
}

proc threeD(go) {} {
    # in order to force geomview to connect dots do:
    # 1. set the mapping flag before the send command.
    # 2. reset the mapping flag after the send command.

    # close pipeline to geomview after sending data.
    # does not quit geomview, but fixes a problem.
    # problem: start dstool
    #          compute flow
    #          send to geomview (ie. gv starts up ok)
    #          quit geomview
    #          send to geomview again
    #          nothing happens (gv does not start up)
    # cause: dstool does not know that gv quit ?
    # soln: close the pipeline and restart pipeline each time

    threeD(setdots)
    begin_wait "Sending to Geomview..."
    pm EXEC Geomview.Open
    pm EXEC Geomview.Send_Memory
    end_wait
    threeD(unsetdots)

    pm EXEC Geomview.Close
}


proc threeD(var_go) {n} {
    tcl_to_pm Geomview
}

proc threeD(enter) {} {
    pm_to_tcl Geomview
}