/usr/share/xcrysden/Tcl/loadAttributes.tcl is in xcrysden-data 1.5.53-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | #############################################################################
# Author: #
# ------ #
# Anton Kokalj Email: Tone.Kokalj@ijs.si #
# Department of Physical and Organic Chemistry Phone: x 386 1 477 3523 #
# Jozef Stefan Institute Fax: x 386 1 477 3811 #
# Jamova 39, SI-1000 Ljubljana #
# SLOVENIA #
# #
# Source: $XCRYSDEN_TOPDIR/Tcl/loadAttributes.tcl
# ------ #
# Copyright (c) 1996-2003 by Anton Kokalj #
#############################################################################
proc xsfLoadAttributes {file} {
global mody
set elementcolor 0
set elementradius 0
set genericattr 0
foreach line [split [ReadFile $file] \n] {
xcDebug -stderr "---> $elementradius ;;; $line"
if { [llength $line] == 0 } {
# an empty-line --> skip it
continue
} elseif { [regexp -- {^[a-zA-Z]a*} $line] } {
set keyword [string trim $line { }]; # get rid of trailing white-spaces
switch -glob -- $keyword {
"ELEMENTCOL*" {
set elementcolor 1
set elementradius 0
set genericattr 0
}
"ELEMENTRAD*" {
set elementcolor 0
set elementradius 1
set genericattr 0
}
default {
set elementcolor 0
set elementradius 0
set genericattr 1
set key [lindex $keyword 0]
set values [lrange $keyword 1 end]
xcDebug -stderr "----> generic option: $keyword $values"
if { ! [info exists mody($key)] } {
ErrorDialog "while parsing attribute file \"$file\", while reading string \"$keyword\""
}
if { [catch {eval {xc_newvalue .mesa $mody($key)} $values} error ] } {
ErrorDialog "while parsing attribute file \"$file\", while reading string \"$keyword\".\n\nError message: $error"
}
}
}
} else {
if { $elementcolor } {
if { [llength $line] != 4 } {
ErrorDialog "should get 4 numbers (i.e. atomic-number r g b), but got: $line\nwhile reading attribute file: $file"
return
}
xc_newvalue .mesa $mody(L_ATCOL_ONE) [lindex $line 0] \
[lindex $line 1] [lindex $line 2] [lindex $line 3]
} elseif { $elementradius } {
if { [llength $line] != 2 } {
ErrorDialog "should get 2 numbers (i.e. atomic-number atomic-radius), but got: $line\nwhile reading attribute file: $file"
return
}
xc_newvalue .mesa $mody(L_ATRAD_ONE) [lindex $line 0] \
[lindex $line 1]
xc_newvalue .mesa $mody(L_RCOV_ONE) [lindex $line 0] \
[lindex $line 1]
}
}
}
}
# ------------------------------------------------------------------------
# loads the attributes from a definition file such as
# ~/.xcrysden/custom-definitions
# ------------------------------------------------------------------------
proc defLoadAttributes {} {
global mody atmRad atmCol
#
# load atmRad
#
foreach atmNum [array names atmRad] {
if { $atmNum < 0 || $atmNum > 100 } {
ErrorDialog "atomic number out of range. Check the atmRad array in the deifinition file"
}
foreach code [list $mody(L_ATRAD_ONE) $mody(L_RCOV_ONE)] {
xcCatchEval \
[list xc_newvalue .mesa $code $atmNum $atmRad($atmNum)] \
"Can't change the atomic radius for atomic-number $atmNum. Check the definition of atmRad($atmNum) in the definition file."
}
}
#
# load atmCol
#
foreach atmNum [array names atmCol] {
if { $atmNum < 0 || $atmNum > 100 } {
ErrorDialog "atomic number out of range. Check the atmCol array in the deifinition file"
}
xcCatchEval \
[list eval "xc_newvalue .mesa $mody(L_ATCOL_ONE) $atmNum" $atmCol($atmNum)] \
"Can't change the atomic color for atomic-number $atmNum. Check the definition of atmCol($atmNum) in the definition file."
}
#
# load myParam
#
load_myParam
}
proc load_myParam {} {
global myParam mody
if { [info exists myParam] } {
foreach _elem [array names myParam] {
switch -exact -- $_elem {
"ATRAD_SCALE" -
"TESSELLATION" -
"UNIBONDCOLOR" -
"PERSPECTIVEFOVY" -
"PERSPECTIVEFRONT" -
"PERSPECTIVEBACK" -
"BALLF" -
"RODF" -
"WFLINEWIDTH" -
"PLLINEWIDTH" -
"FRAMELINEWIDTH" -
"OUTLINEWIDTH" -
"WF3DLINEWIDTH" -
"PLRADIUS" -
"COV_SCALE" -
"FRAMECOL" -
"FRAMELINEWIDTH" -
"FRAMERODF" -
"BACKGROUND" {
# myParam array element is OK !!!
set elem L_$_elem
xcCatchEval \
[list eval "xc_newvalue .mesa $mody($elem)" $myParam($_elem)] \
"Can't change the $_elem attribute. Check the definition of myParam($_elem) in the definition file."
}
"CRYSTAL_MAXCELL" -
"SLAB_MAXCELL" -
"POLYMER_MAXCELL" -
"MPEG_ENCODE_PARAM_FILE" {
continue
}
"ATOMIC_LABEL_FONT" -
"ATOMIC_LABEL_BRIGHTCOLOR" -
"ATOMIC_LABEL_DARKCOLOR" {
global atomLabel
if { ! [info exists myParam(ATOMIC_LABEL_BRIGHTCOLOR)] } {
set myParam(ATOMIC_LABEL_BRIGHTCOLOR) [xc_getvalue .mesa $mody(GET_GLOBALATOMLABEL_BRIGHTCOLOR)]
}
if { ! [info exists myParam(ATOMIC_LABEL_DARKCOLOR)] } {
set myParam(ATOMIC_LABEL_DARKCOLOR) [xc_getvalue .mesa $mody(GET_GLOBALATOMLABEL_DARKCOLOR)]
}
if { ! [info exists myParam(ATOMIC_LABEL_FONT)] } {
set myParam(ATOMIC_LABEL_FONT) raster
}
set atomLabel(globalFont.brightColor) $myParam(ATOMIC_LABEL_BRIGHTCOLOR)
set atomLabel(globalFont.darkColor) $myParam(ATOMIC_LABEL_DARKCOLOR)
puts stderr "DEBUG> .mesa xc_setfont $myParam(ATOMIC_LABEL_FONT) \
$myParam(ATOMIC_LABEL_BRIGHTCOLOR) \
$myParam(ATOMIC_LABEL_DARKCOLOR)"
.mesa xc_setfont $myParam(ATOMIC_LABEL_FONT) \
$myParam(ATOMIC_LABEL_BRIGHTCOLOR) \
$myParam(ATOMIC_LABEL_DARKCOLOR)
}
"FS_BACKGROUND" -
"FS_CELLTYPE" -
"FS_CROPBZ" -
"FS_DISPLAYCELL" -
"FS_CELLDISPLAYTYPE" -
"FS_DRAWSTYLE" -
"FS_TRANSPARENT" -
"FS_SHADEMODEL" -
"FS_INTERPOLATIONDEGREE" -
"FS_FRONTFACE" -
"FS_REVERTNORMALS" -
"FS_WIRECELLCOLOR" -
"FS_SOLIDCELLCOLOR" -
"FS_ANTIALIAS" -
"FS_DEPTHCUING" {
#
# Fermi-Surface customizations (do nothing)
#
DummyProc
}
default {
# myParam array element is not recognized !!!
ErrorDialog "syntax error in custom-definition file: myParam array element \"$_elem\" is not recognized. Check the deifinition file."
}
}
}
}
}
|