Subversion Repositories wimsdev

Rev

Rev 17079 | Rev 17083 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!if $wims_read_parm!=slib_header
13593 bpr 2
  !goto proc
20 reyssat 3
!endif
4158 bpr 4
 
4351 bpr 5
slib_author=Bernadette, Perrin-Riou
14219 bpr 6
slib_title=3Dviewer
4158 bpr 7
 
17081 bpr 8
slib_example=j87_augmented_sphenocorona,bondcolor=red id=1 show=[,AA,FF]\
16944 bpr 9
rhombicosidodecahedron,label=false scale=1 height=400 width=400 bgcolor=blue id=2\
16996 bpr 10
cube,label=false scale=0.8 height=300 width=300 id=3 show=[,AA,FF]\
17079 bpr 11
[14,6;-1.00,-1.00,-1;1.00,-1.00,-1;1.00,1.00,-1;-1.00,1.00,-1;-1.00,-1.00,1.00;1.00,-1.00,1.00;-1.00,1.00,-1.00;-1.00,1.00,1.00;1.00,1.00,-1.00;1.00,1.00,1.00;-1.00,-1.00,1.00;1.00,-1.00,1.00;1.00,-1.00,1.00;1.00,1.00,1.00;4,10,7,9,11;4,6,8,9,7;4,0,6,7,4;4,2,1,12,13;4,1,0,4,5;4,0,1,2,3],bondcolor=red scale=0.8 height=500 width=500 show=[,AA,FF]\
12
[14,6;-1.00,-1.00,-1;1.00,-1.00,-1;1.00,1.00,-1;-1.00,1.00,-1;-1.00,-3.00,-1.00;1.00,-3.00,-1.00;-3.00,-1.00,-1.00;-3.00,-3.00,-1.00;-5.00,-1.00,-1.00;-5.00,-3.00,-1.00;-3.00,-5.00,-1.00;-5.00,-5.00,-1.00;3.00,-1.00,-1.00;3.00,1.00,-1.00;4,10,7,9,11;4,6,8,9,7;4,0,6,7,4;4,2,1,12,13;4,1,0,4,5;4,0,1,2,3],bondcolor=blue scale=0.8 height=500 width=500 show=[,AA,FF]\
16996 bpr 13
[14,6;-1.00,-1.00,-1;1.00,-1.00,-1;1.00,1.00,-1;-1.00,1.00,-1;-1.00,-2.41,0.414;1.00,-2.41,0.414;-2.41,3.25E-19,-2.17E-19;-2.41,-1.41,1.41;-2.41,1.41,1.41;-2.41,0.E-18,2.83;-1.00,-2.41,2.41;-1.00,-1.00,3.83;2.41,-1.00,0.414;2.41,1.00,0.414;4,10,7,9,11;4,6,8,9,7;4,0,6,7,4;4,2,1,12,13;4,1,0,4,5;4,0,1,2,3],scale=0.8 height=500 width=500 show=[,AA,FF]\
14
[14,6;-1.00,-1.00,-1;1.00,-1.00,-1;1.00,1.00,-1;-1.00,1.00,-1;-1.00,-1.62,0.902;1.00,-1.62,0.902;-1.62,0.809,-0.412;-1.62,0.191,1.49;4.34E-19,1.93,-0.0489;4.34E-19,1.31,1.85;-0.500,-1.46,1.60;1.12,-0.345,1.97;1.62,-1.00,0.902;1.62,1.00,0.902;4,10,7,9,11;4,6,8,9,7;4,0,6,7,4;4,2,1,12,13;4,1,0,4,5;4,0,1,2,3],scale=0.8 height=500 width=500 show=[SS,AA,FF]\
17081 bpr 15
[[3,1;1,0,0;0,1,0;0,0,1],[3,1;1,0,0;0,1,0;0,0,2],[3,1;1,0,0;0,1,0;0,0,3];3,0,1,2],bondcolor=red scale=0.8 height=500 width=500 show=[,AA,FF] id=tr animstep=3\
16944 bpr 16
 
20 reyssat 17
!exit
18
 
19
:proc
17079 bpr 20
!reset slib_option slib_scriptanim slib_format slib_animstep
21
slib_data =!item 1 of $wims_read_parm
22
 
16944 bpr 23
slib_data=!declosing $slib_data
14219 bpr 24
slib_option= !item -1 of $wims_read_parm
20 reyssat 25
 
17079 bpr 26
!for slib_a in animstep label,scale,box,bonds,bgcolor,bondcolor,atomcolor,facecolor,format,width,height,id, show
14219 bpr 27
  !reset slib_$slib_a
20 reyssat 28
  slib_$slib_a=!getopt $slib_a in $slib_option
29
!next slib_a
17079 bpr 30
!default slib_animstep=1
20 reyssat 31
!default slib_label=false
14219 bpr 32
!default slib_bgcolor=white
33
!default slib_bondcolor=yellow
20 reyssat 34
!default slib_box=true
35
!default slib_bonds=true
36
!default slib_scale=0.8
17002 bpr 37
!default slib_width=400
38
!default slib_height=400
14219 bpr 39
!default slib_id=!randint 1000,3000
20 reyssat 40
slib_out=
41
slib_cnt_word=!wordcnt $slib_data
16944 bpr 42
slib_cnt_item=!itemcnt $slib_data
43
!if $slib_cnt_word=1 and $slib_cnt_item=1
20 reyssat 44
  slib_data=!record 0 of data/polyedre_off/$slib_data.off
45
  slib_format=off
14219 bpr 46
  slib_atomes=$slib_data
16944 bpr 47
  slib_atomes=!translate ; to $\
48
$ in $slib_atomes
20 reyssat 49
!else
17079 bpr 50
  !if $slib_animstep>1
51
    slib_atomes=$(slib_data[1;])
52
    !for slib_k=1 to $slib_animstep
53
      !set slib_atomes$slib_k=!item $slib_k of $slib_atomes
54
      !set slib_atomes$slib_k=!declosing $(slib_atomes$slib_k)
55
      !set slib_atomes$slib_k=!replace internal , by $ $ in $(slib_atomes$slib_k)
56
      !set slib_atomes$slib_k=!translate ; to $\
57
$ in $(slib_atomes$slib_k)
58
      !set slib_atomes$slib_k=!translate $	$ to $\
59
$ in $(slib_atomes$slib_k)
60
    !next
61
    !set slib_faces=$(slib_data[2..-1;])
62
    !set slib_faces=!replace internal , by $ $ in $slib_faces
63
    !set slib_faces=!translate $	$ to $\
64
$ in $slib_faces
65
  !else
66
    slib_data=!replace internal , by $ $ in $slib_data
67
    slib_atomes=!translate $	$ to $\
68
$ in $slib_data
69
  !endif
20 reyssat 70
!endif
71
 
16996 bpr 72
!default slib_show=,AA,
16944 bpr 73
!!careful confusion with slib_width in off2jmol
74
!set slib_width_v=$(slib_width)
75
!set slib_height_v=$(slib_height)
17079 bpr 76
!!! FIXME: séparer en deux les deux générations de fichiers.
77
!if $slib_animstep=1
78
  !readproc slib/geo3D/off2jmol $slib_atomes,[$slib_show],[ ,$slib_bondcolor,],[0.01,0.01],url distance
79
  !readproc slib/chemistry/jmolshow $(slib_out[2]),$slib_height_v,$slib_width_v,$slib_bgcolor,script "$(slib_out[1])"; zoom 130,$(slib_id)
80
!else
81
  !set slib_spt=yes
82
  !for slib_k=1 to $slib_animstep
83
    !set slib_dat=$(slib_atomes$slib_k)\
84
$slib_faces
85
    !readproc slib/geo3D/off2jmol [$slib_dat],[$slib_show],[ ,$slib_bondcolor,],[0.01,0.01],url distance id=$(slib_id)_$slib_k spt=$slib_spt
86
    !if $slib_spt=yes
87
      !set slib_filespt=$(slib_out[1])
88
      !set slib_spt=no
89
    !endif
90
    !set slib_scriptanim=!append item ['load $(slib_out[2]);load $(slib_filespt)', "$[$slib_k-1]"]\
91
  to $slib_scriptanim
92
  !next
93
  !set slib_scriptanim=<script>Jmol.jmolRadioGroup(XXXXX,[$slib_scriptanim])</script>
94
  !readproc slib/chemistry/jmolshow $(slib_out[2]),$slib_height_v,$slib_width_v,$slib_bgcolor,script "$(slib_out[1])"; zoom 130,$(slib_id)
95
!endif
17002 bpr 96
$slib_out