Changeset 5657 for trunk/gui/scripts
- Timestamp:
- Jun 5, 2015, 8:37:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/drawing.tcl
r5337 r5657 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 2 2 # ---------------------------------------------------------------------- 3 3 # COMPONENT: drawing - 3D drawing of data … … 12 12 package require BLT 13 13 14 namespace eval Rappture { 15 # forward declaration 14 namespace eval Rappture { 15 # forward declaration 16 16 } 17 17 18 18 itcl::class Rappture::Drawing { 19 19 private variable _drawing 20 private variable _xmlobj 21 private variable _styles 22 private variable _shapes 23 private variable _labels 24 private variable _types 25 private variable _data 20 private variable _xmlobj 21 private variable _styles 22 private variable _shapes 23 private variable _labels 24 private variable _types 25 private variable _data 26 26 private variable _hints 27 27 private variable _units 28 28 29 constructor {xmlobj path} { 30 # defined below 31 } 32 destructor { 33 # defined below 29 constructor {xmlobj path} { 30 # defined below 31 } 32 destructor { 33 # defined below 34 34 } 35 35 … … 40 40 public method values { elem } 41 41 public method data { elem } 42 public method hints {{keyword ""}} 43 public method components { args } 42 public method hints {{keyword ""}} 43 public method components { args } 44 44 } 45 45 … … 72 72 glyphs* { 73 73 set _data($elem) [$_xmlobj get $path.$elem.vtk] 74 74 set _data($elem) [string trim $_data($elem)] 75 75 set _styles($elem) [$_xmlobj get $path.$elem.about.style] 76 76 set _labels($elem) [$_xmlobj get $path.$elem.about.label] … … 85 85 set contents [$_xmlobj get $path.$elem.vtk] 86 86 } 87 87 set _data($elem) [string trim $contents] 88 88 set _styles($elem) [$_xmlobj get $path.$elem.about.style] 89 89 set _labels($elem) [$_xmlobj get $path.$elem.about.label] … … 143 143 } 144 144 145 # 146 # label -- 147 # 145 # 146 # label -- 147 # 148 148 # Returns the label of the named drawing element. 149 149 # … … 151 151 if { [info exists _labels($elem)] } { 152 152 return $_labels($elem) 153 } 154 return "" 155 } 156 157 # 158 # type -- 159 # 153 } 154 return "" 155 } 156 157 # 158 # type -- 159 # 160 160 # Returns the type of the named drawing element. 161 161 # … … 163 163 if { [info exists _types($elem)] } { 164 164 return $_types($elem) 165 } 166 return "" 167 } 168 169 # 170 # style -- 171 # 165 } 166 return "" 167 } 168 169 # 170 # style -- 171 # 172 172 # Returns the style string of the named drawing element. 173 173 # … … 175 175 if { [info exists _styles($elem)] } { 176 176 return $_styles($elem) 177 } 178 return "" 179 } 180 181 # 182 # shape -- 183 # 177 } 178 return "" 179 } 180 181 # 182 # shape -- 183 # 184 184 # Returns the shape of the glyphs in the drawing element. 185 185 # … … 188 188 if { [info exists _shapes($elem)] } { 189 189 return $_shapes($elem) 190 } 191 switch -- $shape { 192 arrow - cone - cube - cylinder - dodecahedron - 193 194 195 196 197 198 199 } 200 return "" 201 } 202 203 # 204 # data -- 205 # 190 } 191 switch -- $shape { 192 arrow - cone - cube - cylinder - dodecahedron - 193 icosahedron - line - octahedron - sphere - tetrahedron { 194 return $shape 195 } 196 default { 197 puts stderr "unknown glyph shape \"$shape\"" 198 } 199 } 200 return "" 201 } 202 203 # 204 # data -- 205 # 206 206 # Returns the data of the named drawing element. 207 207 # … … 209 209 if { [info exists _data($elem)] } { 210 210 return $_data($elem) 211 } 212 return "" 213 } 214 215 # ---------------------------------------------------------------------- 216 # method values 211 } 212 return "" 213 } 214 215 # ---------------------------------------------------------------------- 216 # method values 217 217 # Returns a base64 encoded, gzipped Tcl list that represents the 218 # Tcl command and data to recreate the uniform rectangular grid 218 # Tcl command and data to recreate the uniform rectangular grid 219 219 # on the nanovis server. 220 220 # ---------------------------------------------------------------------- … … 222 222 if { [info exists _data($elem)] } { 223 223 return $_data($elem) 224 } 224 } 225 225 return "" 226 226 } 227 227 228 228 itcl::body Rappture::Drawing::components { args } { 229 return [array names _data] 229 return [array names _data] 230 230 } 231 231
Note: See TracChangeset
for help on using the changeset viewer.