From 01db99fbe5356bfe22cfb4d7702756fd8e0cf240 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 22 Oct 2007 21:36:28 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1084 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- tools/pymol_asphere/README | 5 +- tools/pymol_asphere/doc/asphere_vis.1 | 74 ++-- tools/pymol_asphere/doc/asphere_vis.manpage | 72 ++-- tools/pymol_asphere/doc/asphere_vis.pdf | Bin 11645 -> 18920 bytes tools/pymol_asphere/examples/README | 8 +- tools/pymol_asphere/examples/colors.ellipse | 4 +- tools/pymol_asphere/src/asphere_vis.cpp | 366 +++++++++----------- tools/pymol_asphere/src/glsurface.cpp | 1 + 8 files changed, 277 insertions(+), 253 deletions(-) diff --git a/tools/pymol_asphere/README b/tools/pymol_asphere/README index df49f8d197..baa2e989ee 100755 --- a/tools/pymol_asphere/README +++ b/tools/pymol_asphere/README @@ -8,10 +8,7 @@ make # may need to edit Makefile for your system This will place the asphere_vis executable in the bin directory. -Documentation is in the doc directory. Note that the doc file says -the ellipsoid axes are specified by an "Ellipsoid" section in the data -file. In the current version of LAMPS, this is now a "Shapes" -section. +Documentation is in the doc directory. See instructions on how to run an example ellipsoid viz in the examples dir. diff --git a/tools/pymol_asphere/doc/asphere_vis.1 b/tools/pymol_asphere/doc/asphere_vis.1 index d8582c8544..a5d21425b9 100755 --- a/tools/pymol_asphere/doc/asphere_vis.1 +++ b/tools/pymol_asphere/doc/asphere_vis.1 @@ -1,7 +1,7 @@ .if !'\*(.T'ps' .if !'\*(.T'html' .tm warning: eqn should have been given a `-T\*(.T' option .if '\*(.T'html' .if !'ps'ps' .tm warning: eqn should have been given a `-Tps' option .if '\*(.T'html' .if !'ps'ps' .tm warning: (it is advisable to invoke groff via: groff -Thtml -e) -.lf 1 /usr/share/groff/1.18.1/tmac/eqnrc +.lf 1 /usr/share/groff/1.18.1.1/tmac/eqnrc .\" Startup file for eqn. .EQ .nr 0C \n(.C @@ -11,36 +11,79 @@ .lf 63 .EN .lf 1 asphere_vis.manpage -.TH asphere_vis 1 "June 22, 2007" "asphere_vis (Graphics Utilities) 0.1" "Graphics Utilities" +.TH asphere_vis 1 "October 22, 2007" "asphere_vis (Graphics Utilities) 0.2" "Graphics Utilities" .SH NAME \fBasphere_vis\fR - Tools for ellipsoid visualization in PyMol of a LAMMPS trajectory. .PD 2 .SH VERSION .PD 1 -Version 0.1 +Version 0.2 .PD 2 .SH SYNOPSIS .PD 1 .TP -\fBasphere_vis\fR input_file dump_file output_py_file [\fB-b\fR] [\fB-c\fR \fIcolor_file\fR] [\fB-d\fR] [\fB-f\fR \fImax_frame\fR] [\fB-h\fR] [\fB-i\fR \fIstart_frame\fR \fIskip\fR \fIend_frame\fR] [\fB-n\fR \fInotice_level\fR] [\fB-r\fR \fIellip_res\fR] [\fB-s\fR] +\fBasphere_vis\fR flavor_file dump_file output_py_file [\fB-b\fR] [\fB-f\fR \fImax_frame\fR] [\fB-h\fR] [\fB-i\fR \fIstart_frame\fR \fIskip\fR \fIend_frame\fR] [\fB-n\fR \fInotice_level\fR] [\fB-o\fR] [\fB-r\fR \fIellip_res\fR] [\fB-s\fR] .br .PD 2 .SH DESCRIPTION .PD 1 -Tool for ellipsoid visualization in PyMol of a LAMMPS trajectory. The \fIinput_file\fR is a LAMMPS data file with a 'Shapes' section or a LAMMPS input script file with ellipsoid diameters specified using the 'shape' command. The trajectory is input from \fIdump_file\fR that must be generated using a LAMMPS dump_style custom command with the following arguments in order: +Tool for converting LAMMPS trajectories into compiled graphics objects for visualization in PyMol. The \fIflavor_file\fR is an input file that describes the color, transparency, and size/shape of each atom type. The \fIflavor_file\fR consists of two possible line formats. For spherical particles, the format is: .PD 0 .PP .PD 1 .PD 0 -.TP .PP .PD 1 -\fItag type x y z quatw quati quatj quatk\fR + \fIatom_type color alpha diameter\fR .PD 0 .PP .PD 1 +.PD 0 +.PP +.PD 1 +where alpha is used to adjust the transparency of the particle. For ellipsoidal particles, the format is: +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 + \fIatom_type color alpha diameter_x diameter_y diameter_z\fR +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 +Ellipsoidal and spherical line formats can be mixed in the same \fIflavor_file\fR For any atom type not listed in the \fIflavor_file\fR a blue sphere of size 1 is assumed. +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 +The \fIdump_file\fR is a LAMMPS trajectory. For atom types specified as spherical in the \fIflavor_file\fR, the \fIdump_file\fR must contain \fItag type x y z\fR as the first columns. For atom types specified as ellipsoidal in the \fIflavor_file\fR, the columns are \fItag type x y z quatw quati quatj quatk\fR.The latter can be gerenated, for example, with the LAMMPS dump_style custom command with the following arguments in order: +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 + \fItag type x y z quatw quati quatj quatk\fR +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 +The output file is a python file for input to Pymol. This can be viewed from the command line using \fIpymol output.py\fR or by using the \fIrun\fR command from within Pymol. .PD 2 .SH PARAMETERS .PD 1 @@ -48,16 +91,6 @@ Tool for ellipsoid visualization in PyMol of a LAMMPS trajectory. The \fIinput_f \fB-b\fR When used with \fB-s\fR, the option will number the filenames based on the frame number. By default, they are numbered consequtively from zero. .TP -\fB-c\fR \fIcolor_file\fR -.PD 0 -.TP -.PP -.PD 1 -Color the atom_types and set transparency based on the color file. The color file contains a space delimited set sequence of the color for an atom followed by the alpha. The color should be the string name and the alpha should be between 0 and 1. -.TP -\fB-d\fR -Use a LAMMPS input script rather than a data file for extracting atom shape information. The input script is specified as \fIinput_file\fR. -.TP \fB-f\fR \fImax_frame\fR .PD 0 .TP @@ -102,6 +135,9 @@ Set the degree of program output. Use: .PD 1 \fB-n\fR 30 All output .TP +\fB-o\fR +Do not output the outline for the simulation box. +.TP \fB-r\fR \fIellip_res\fR .PD 0 .TP @@ -199,10 +235,6 @@ Output the results into separate .py files. The filename and extension for the o .PP .PD 1 -.PD 2 -.SH KNOWN BUGS -.PD 1 -Comments are not allowed at any point between a section header and the end of the contents for a section in either the data file or the input file. .PD 2 .SH AUTHORS .PD 1 diff --git a/tools/pymol_asphere/doc/asphere_vis.manpage b/tools/pymol_asphere/doc/asphere_vis.manpage index 1af337c76c..ec62904e0a 100755 --- a/tools/pymol_asphere/doc/asphere_vis.manpage +++ b/tools/pymol_asphere/doc/asphere_vis.manpage @@ -1,33 +1,76 @@ -.TH asphere_vis 1 "June 22, 2007" "asphere_vis (Graphics Utilities) 0.1" "Graphics Utilities" +.TH asphere_vis 1 "October 22, 2007" "asphere_vis (Graphics Utilities) 0.2" "Graphics Utilities" .SH NAME \fBasphere_vis\fR - Tools for ellipsoid visualization in PyMol of a LAMMPS trajectory. .PD 2 .SH VERSION .PD 1 -Version 0.1 +Version 0.2 .PD 2 .SH SYNOPSIS .PD 1 .TP -\fBasphere_vis\fR input_file dump_file output_py_file [\fB-b\fR] [\fB-c\fR \fIcolor_file\fR] [\fB-d\fR] [\fB-f\fR \fImax_frame\fR] [\fB-h\fR] [\fB-i\fR \fIstart_frame\fR \fIskip\fR \fIend_frame\fR] [\fB-n\fR \fInotice_level\fR] [\fB-r\fR \fIellip_res\fR] [\fB-s\fR] +\fBasphere_vis\fR flavor_file dump_file output_py_file [\fB-b\fR] [\fB-f\fR \fImax_frame\fR] [\fB-h\fR] [\fB-i\fR \fIstart_frame\fR \fIskip\fR \fIend_frame\fR] [\fB-n\fR \fInotice_level\fR] [\fB-o\fR] [\fB-r\fR \fIellip_res\fR] [\fB-s\fR] .br .PD 2 .SH DESCRIPTION .PD 1 -Tool for ellipsoid visualization in PyMol of a LAMMPS trajectory. The \fIinput_file\fR is a LAMMPS data file with a 'Shapes' section or a LAMMPS input script file with ellipsoid diameters specified using the 'shape' command. The trajectory is input from \fIdump_file\fR that must be generated using a LAMMPS dump_style custom command with the following arguments in order: +Tool for converting LAMMPS trajectories into compiled graphics objects for visualization in PyMol. The \fIflavor_file\fR is an input file that describes the color, transparency, and size/shape of each atom type. The \fIflavor_file\fR consists of two possible line formats. For spherical particles, the format is: .PD 0 .PP .PD 1 .PD 0 -.TP .PP .PD 1 -\fItag type x y z quatw quati quatj quatk\fR + \fIatom_type color alpha diameter\fR .PD 0 .PP .PD 1 +.PD 0 +.PP +.PD 1 +where alpha is used to adjust the transparency of the particle. For ellipsoidal particles, the format is: +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 + \fIatom_type color alpha diameter_x diameter_y diameter_z\fR +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 +Ellipsoidal and spherical line formats can be mixed in the same \fIflavor_file\fR For any atom type not listed in the \fIflavor_file\fR a blue sphere of size 1 is assumed. +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 +The \fIdump_file\fR is a LAMMPS trajectory. For atom types specified as spherical in the \fIflavor_file\fR, the \fIdump_file\fR must contain \fItag type x y z\fR as the first columns. For atom types specified as ellipsoidal in the \fIflavor_file\fR, the columns are \fItag type x y z quatw quati quatj quatk\fR.The latter can be gerenated, for example, with the LAMMPS dump_style custom command with the following arguments in order: +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 + \fItag type x y z quatw quati quatj quatk\fR +.PD 0 +.PP +.PD 1 + +.PD 0 +.PP +.PD 1 +The output file is a python file for input to Pymol. This can be viewed from the command line using \fIpymol output.py\fR or by using the \fIrun\fR command from within Pymol. .PD 2 .SH PARAMETERS .PD 1 @@ -35,16 +78,6 @@ Tool for ellipsoid visualization in PyMol of a LAMMPS trajectory. The \fIinput_f \fB-b\fR When used with \fB-s\fR, the option will number the filenames based on the frame number. By default, they are numbered consequtively from zero. .TP -\fB-c\fR \fIcolor_file\fR -.PD 0 -.TP -.PP -.PD 1 -Color the atom_types and set transparency based on the color file. The color file contains a space delimited set sequence of the color for an atom followed by the alpha. The color should be the string name and the alpha should be between 0 and 1. -.TP -\fB-d\fR -Use a LAMMPS input script rather than a data file for extracting atom shape information. The input script is specified as \fIinput_file\fR. -.TP \fB-f\fR \fImax_frame\fR .PD 0 .TP @@ -89,6 +122,9 @@ Set the degree of program output. Use: .PD 1 \fB-n\fR 30 All output .TP +\fB-o\fR +Do not output the outline for the simulation box. +.TP \fB-r\fR \fIellip_res\fR .PD 0 .TP @@ -186,10 +222,6 @@ Output the results into separate .py files. The filename and extension for the o .PP .PD 1 -.PD 2 -.SH KNOWN BUGS -.PD 1 -Comments are not allowed at any point between a section header and the end of the contents for a section in either the data file or the input file. .PD 2 .SH AUTHORS .PD 1 diff --git a/tools/pymol_asphere/doc/asphere_vis.pdf b/tools/pymol_asphere/doc/asphere_vis.pdf index 6dff9e4ef575996d0b4959c0b366b07ca434a72b..6201653bd3e2020ab5cbd6ed892a524e160eb976 100755 GIT binary patch literal 18920 zcmeIa2T+vD(l9JZk|aqg3QNu`3oJ{{IZBosmzsNc4N26-?)z_ul_jy?=dG-?3_#d3t7gdU|@hd!}b(z9^@_4ddY>V1EALS`L9A zgcssw~H&i>B^(=Z{BqCkSJhg;n zfl^^GHc$Azp@wZb{w({|OER`GFRJW)oyI#GpI00RAhV{gKZZYZHRXAYsO-CmN1M=w zt)IfpIu!DtfbLajH|UMj`%8!+3xuyZr}FK+9*vN~ zZO2*zU(s16sbqq^b4^Lhh{WBe-@c9~MX(panNtFzZ3VhMiy>--nam%k@3ooZJX9N^ zFMaw_f{Y}Sw0^^1M{KI(yl%HCx8UGJ7CuM2=7*NU$2(e?UkBP=J;>4OCGpey5`2BD z&r@;E$H6T=l8@|hN8fuoKWHp0rh=#TvaE1QlCS$o<31I(i>}QXu1 z`00@I=}$%YO`c|j#WG(=rpnvJUJdh>tkRwp#eDVV%}AA}T|ZTFV{x#@!T!Rb%9FJL zUN&0EaDD(((i?pcpVxm?zH4is@2R}%Qp>P;o({$poY}~pT9Qwl2YKP} za?j>KUu+~TOYFRr2DyQ$KwMQE^A~B83uEyR$s+IUPVJibg1ZqJj@(bXAGoU3sy0+D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^?4V(=Pq9Yq{<$@Q1Pi$KQXT-ZWUOXyhyxg3NyM}{n}6Nl}?^XA~-CvuO( zzhOdR*HFj<*P4Sd?t{hu2RRo0tkG{YM?+lr zvxhkt>IL!#`(U1bu_eGk0yLOMX&~za)g!7~7%~tY^Mlo}dnLFBqyZsZhtPw%2Yocu zKnUpz<_7aUYBv-Q9GC(HfX{E2s*(aQ=ktCAj}EMa8$`7 zAru}qs5FE@(1+zP7~>awfHq1Og+yQ|*oU-)3qI6%!UZ238(HvCK=}gsMRd{3gp!28<+<`3cxf%Fqa+OK#s7++AgLER2@59qScL~tIu%CC3>d=~ze zf5jUTa==6#2Xz<}!rwdE7l!{+@kZ!?i9BTr)jL8@hDf=D9z};AFh|vBAhQ3HG7CNf z3T--s3tpC;{hU}FH4`&ytcj~Pm&dR3urzf%Wr41);CXcmhvk9+&Pc_8ryju{mP(IHZeF1+!f)VS;8u(E>(Kc}xxu@gf2N$c|A_ JFb; diff --git a/tools/pymol_asphere/examples/README b/tools/pymol_asphere/examples/README index 70ad3ee90d..f0aea0f18b 100644 --- a/tools/pymol_asphere/examples/README +++ b/tools/pymol_asphere/examples/README @@ -4,13 +4,13 @@ from a LAMMPS run. In examples/ellipse, you can run LAMMPS with in.ellipse to generate dump.ellipse -Copy in.ellipse and dump.ellipse to this dir. +Copy dump.ellipse to this dir. Run the tool to create a PyMol input file called ellipse.py by typing: -../bin/asphere_vis in.ellipse dump.ellipse ellipse.py -c colors.ellipse -d +../bin/asphere_vis colors.ellipse dump.ellipse ellipse.py -r 4 -o -Launch PyMol on this input and you should see a nice viz of -4 ellipsoids in a box of LJ particles: +Launch PyMol on this input and you should see a viz of +ellipsoids in a box of LJ particles: pymol ellipse.py diff --git a/tools/pymol_asphere/examples/colors.ellipse b/tools/pymol_asphere/examples/colors.ellipse index 73fdefdd4e..f757e18a8e 100644 --- a/tools/pymol_asphere/examples/colors.ellipse +++ b/tools/pymol_asphere/examples/colors.ellipse @@ -1,3 +1,3 @@ -marine 0.3 -red 1.0 +1 marine 0.7 1 +2 red 1.0 3 1 1 diff --git a/tools/pymol_asphere/src/asphere_vis.cpp b/tools/pymol_asphere/src/asphere_vis.cpp index b5591ed55e..2bf8b2a48b 100644 --- a/tools/pymol_asphere/src/asphere_vis.cpp +++ b/tools/pymol_asphere/src/asphere_vis.cpp @@ -2,7 +2,7 @@ asphere_vis.cpp ------------------- - Convert a Lammps ellipsoid trajectory to a Pymol CGO trajectory + Convert a Lammps trajectory to a Pymol CGO trajectory __________________________________________________________________________ This file is part of the Graphics Utilities package for command-line @@ -51,124 +51,63 @@ int main(int argc, char *argv[]) { end_frame=cl.argint('i',2); } - // ----------------- Get the atom type info from a data file - unsigned atom_types=0; + // ----------------- Assign default atom type info + unsigned max_atom_types=1000; vector shapes; - ifstream in; - if (!cl['d']) { - a::fileopen(in,cl.argstring(' ',0),error); - while (!in.eof()) { - char iline[500]; - in.getline(iline,500); - vector tokens; - a::get_tokens(iline,tokens); - if (tokens.size()>2) - if (tokens[1]=="atom" && tokens[2]=="types") { - atom_types=atoi(tokens[0].c_str()); - break; - } - if (!in) - break; - } - if (atom_types==0) - error.generate_error(0,"asphere_vis", - "Could not find number of atom types in data file."); - // ----------------- Get the atom type shapes - if (parse_to("Shapes",in)) - for (unsigned i=0; i> tempd >> shape; - shape.x *= 0.5; - shape.y *= 0.5; - shape.z *= 0.5; - if (in.eof() || !in) - break; - shapes.push_back(shape); - char iline[500]; - in.getline(iline,500); - } - if (shapes.size()!=atom_types) { - error.buffer() << "Error reading shapes from Pair Coeffs section of " - << "data file. Read " << shapes.size() << " valid shapes, " - << "but expected " << atom_types; - error.addbuf(0,"asphere_vis"); - } - a::fileclose(in,error); - } else { - // ----------------- Get the atom type info from a input file - a::fileopen(in,cl.argstring(' ',0),error); - while (!in.eof()) { - string token; - in >> token; - if (token=="create_box") { - in >> atom_types; - shapes.assign(atom_types,cPt(0.5,0.5,0.5)); - } else if (token=="shape") { - unsigned type; - cPt shape; - in >> type >> shape; - shape.x *= 0.5; - shape.y *= 0.5; - shape.z *= 0.5; - if (type>atom_types) { - error.buffer() << "Error reading shapes from LAMMPS input file. " - << "I thought there were " << atom_types - << " atom types. But found an shape command for " - << "atom type: " << type; - error.addbuf(0,"asphere_vis"); - } - shapes[type-1]=shape; - } else { - char iline[500]; - in.getline(iline,500); - } - - if (!in && !in.eof()) - error.generate_error(0,"asphere_vis", - "Error reading from LAMMPS input file"); - } - a::fileclose(in,error); - } - if (atom_types==0) - error.generate_error(0,"asphere_vis","Found 0 atom types!"); - - // ----------------- Get the colors and alpha values for atom types vector color_list; vector alpha_list; - if (cl['c']) { - a::fileopen(in,cl.argstring('c',0),error); - for (unsigned i=0; i> color >> alpha; - if (in.eof() || !in) - error.generate_error(0,"asphere_vis", - "Improperly formatted color file."); - color_list.push_back(colors[color]); - alpha_list.push_back(alpha); + vector spherical; + shapes.assign(max_atom_types,cPt(0.5,0.5,0.5)); + color_list.assign(max_atom_types,colors["blue"]); + alpha_list.assign(max_atom_types,1.0); + spherical.assign(max_atom_types,true); + + // ----------------- Get the atom type info from a flavor file + unsigned atom_type; + cPt shape; + string color; + double alpha,diameter_x,diameter_y,diameter_z; + unsigned num_types=0; + char iline[5000]; + + ifstream in; + a::fileopen(in,cl.argstring(' ',0),error); + while (!in.eof()) { + in.getline(iline,500); + if (!in || in.eof()) + break; + istringstream line_in(iline); + line_in >> atom_type; + if (!line_in || line_in.eof()) + break; + if (atom_type>max_atom_types) + error.generate_error(0,"asphere_vis", + "asphere_vis will not handle atom types greater than "+ + a::itoa(max_atom_types)); + line_in >> color >> alpha >> diameter_x; + num_types++; + if (!line_in) + error.generate_error(0,"asphere_vis", + "Improperly formatted flavor_file at line:\n "+ + string(iline)); + color_list[atom_type]=colors[color]; + alpha_list[atom_type]=alpha; + line_in >> diameter_y; + if (!line_in) { + shapes[atom_type].x=diameter_x/2.0; + continue; } - a::fileclose(in,error); + line_in >> diameter_z; + if (!line_in) + error.generate_error(0,"asphere_vis", + "Improperly formatted flavor_file at line:\n "+ + string(iline)); + shapes[atom_type]=cPt(diameter_x/2.0,diameter_y/2.0,diameter_z/2.0); + spherical[atom_type]=false; } + error.note[9] << "Read in " << num_types << " atom types from flavor_file.\n"; + a::fileclose(in,error); - a::fileopen(in,cl.argstring(' ',1),error); - ofstream out; - if (!cl['s']) { - a::fileopen(out,cl.argstring(' ',2),error); - } - - - // ----------------- Get the atom count - unsigned atom_count; - if (parse_to("ITEM: NUMBER OF ATOMS",in)) - in >> atom_count; - else - error.generate_error(0,"asphere_vis", - "Could not find ITEM: NUMBER OF ATOMS in input file."); - if (!in) - error.generate_error(0,"asphere_vis", - "Error reading ITEM: NUMBER OF ATOMS in input file."); - // ----------------- Get the triangles per ellipsoid unsigned ellip_res=10; if (cl['r']) @@ -178,16 +117,21 @@ int main(int argc, char *argv[]) { ellip_res=10; } - // ----------------- Get the bounding box - bool bound_found=false; + a::fileopen(in,cl.argstring(' ',1),error); + ofstream out; if (!cl['s']) { + a::fileopen(out,cl.argstring(' ',2),error); + } + // ----------------- Get the bounding box + GLSurface glb; + bool bound_found=false; + if (!cl['o']) { if (parse_to("ITEM: BOX BOUNDS",in)) { bound_found=true; cPt bound[2]; - in >> bound[0].x >> bound[1].x; - in >> bound[0].y >> bound[1].y; - in >> bound[0].z >> bound[1].z; - GLSurface gls; + in >> bound[0].x >> bound[1].x; + in >> bound[0].y >> bound[1].y; + in >> bound[0].z >> bound[1].z; Vertex v; v.transparency=1; v.valid_normal=false; @@ -195,31 +139,33 @@ int main(int argc, char *argv[]) { for (unsigned i=0; i<2; i++) for (unsigned j=0; j<2; j++) for (unsigned k=0; k<2; k++) { - v.cpt=cPt(bound[i].x,bound[j].y,bound[k].z); - gls.addvertex(v); + v.cpt=cPt(bound[i].x,bound[j].y,bound[k].z); + glb.addvertex(v); } - gls.addline(0,1); - gls.addline(0,2); - gls.addline(0,4); - gls.addline(1,3); - gls.addline(1,5); - gls.addline(2,3); - gls.addline(2,6); - gls.addline(3,7); - gls.addline(4,5); - gls.addline(4,6); - gls.addline(5,7); - gls.addline(6,7); - gls.writelines(out,"gridb"); + glb.addline(0,1); + glb.addline(0,2); + glb.addline(0,4); + glb.addline(1,3); + glb.addline(1,5); + glb.addline(2,3); + glb.addline(2,6); + glb.addline(3,7); + glb.addline(4,5); + glb.addline(4,6); + glb.addline(5,7); + glb.addline(6,7); + if (!cl['s']) + glb.writelines(out,"gridb"); out << "cmd.set('cgo_dot_width',8)\n"; } else error.addwarning(0,9,"asphere_vis", "Could not find ITEM: BOX BOUNDS in input file. No box output."); } - if (!in) - error.generate_error(0,"asphere_vis", - "Error reading ITEM: BOX BOUNDS."); + if (!in) + error.generate_error(0,"asphere_vis", + "Error reading ITEM: BOX BOUNDS."); + a::fileclose(in,error); // ----------------- Generate the frames unsigned frame=0; @@ -227,11 +173,7 @@ int main(int argc, char *argv[]) { if (cl['f']) max_frame=cl.argint('f',0); - colorPt color=colors["marine"]; - double alpha=1.0; - Vertex v; - v.color=color; - v.transparency=1.0; + a::fileopen(in,cl.argstring(' ',1),error); // ----------------- Get to the start frame while (frame> atom_count; + else + break; + if (!in) + error.generate_error(0,"asphere_vis", + "Error reading ITEM: NUMBER OF ATOMS in input file."); + if (frame>end_frame) break; if (!parse_to("ITEM: ATOMS",in)) break; GLSurface gls; - for (unsigned i=0; i> id >> atom_type; + unsigned id, atom_type; cPt atom_center; - in >> atom_center; - Quaternion q; - in >> q; - if (!in) { - error.addwarning(0,9,"asphere_vis","Error reading frame: "+ - a::itoa(frame)); - break; - } - cPt radius(shapes[atom_type-1]); - if (radius.x == radius.y && radius.y == radius.z) { - v.cpt=atom_center; - if (cl['c']) { - v.color=color_list[atom_type-1]; - v.transparency=alpha_list[atom_type-1]; - } - gls.addvertex(v); - gls.add_sphere(gls.size_vertices()-1,radius.x); - } else { - if (cl['c']) { - color=color_list[atom_type-1]; - alpha=alpha_list[atom_type-1]; - } - gls.add_ellipsoid(atom_center,radius,q, - color,alpha,ellip_res); + Quaternion q; + for (unsigned i=0; i> id >> atom_type; + if (atom_type>max_atom_types) + error.generate_error(0,"asphere_vis", + "asphere_vis will not handle atom types greater than "+ + a::itoa(max_atom_types)); + + line_in >> atom_center; + if (spherical[atom_type]==false) + line_in >> q; + if (!line_in) { + error.addwarning(0,9,"asphere_vis","Error reading frame: "+ + a::itoa(frame)); + break; } - } + if (spherical[atom_type]) { + v.cpt=atom_center; + v.color=color_list[atom_type]; + v.transparency=alpha_list[atom_type]; + gls.addvertex(v); + gls.add_sphere(gls.size_vertices()-1,shapes[atom_type].x); + } else { + gls.add_ellipsoid(atom_center,shapes[atom_type],q,color_list[atom_type], + alpha_list[atom_type],ellip_res); + } + } if (!in) break; if (cl['s']) { if (cl['b']) fi.set_file_num(frame); a::fileopen(out,fi.nextfilename(),error); + if (!cl['o']) { + glb.writelines(out,"gridb"); + out << "cmd.set('cgo_dot_width',8)\n"; + } } gls.writetris(out,"ellipse"); if (gls.size_spheres()!=0) @@ -321,13 +278,13 @@ int main(int argc, char *argv[]) { void Describe(CommandLine &cl,ostream &out) { string name=cl.program_name(); string progname=a::strcenter(name,70); - string gridversion=a::strcenter("Graphics Library Version 0.1",70); + string gridversion=a::strcenter("Graphics Library Version 0.2",70); out << endl << progname << endl << gridversion << endl << "______________________________________________________________________\n" << a::strcenter("W. Michael Brown",70) << endl << a::strcenter("1/12/2007",70) << endl << "______________________________________________________________________\n" - << "Tool for LAMMPS aspherical trajectory visualization in pymol.\n\n" + << "Tool for LAMMPS trajectory visualization in Pymol.\n\n" << cl.format_synopsis("","","") << endl << endl << "Use '" << name << " -h > " << name << ".1' to generate a man page for this\n" @@ -339,20 +296,15 @@ void Describe(CommandLine &cl,ostream &out) { void HandleArgs(CommandLine &cl, int argc, char *argv[], Error *error) { // Arguments cl.addmanditory(' ',3); - cl.addargname(' ',"input_file"); - cl.addargname(' ',"dump_file"); - cl.addargname(' ',"output_py_file"); - cl.add('d',0); - cl.adddescription('d',"Use a LAMMPS input script rather than a data file for extracting atom shape information. The input script is specified as input_file."); + cl.addargname(' ',"flavor_file"); + cl.addargname(' ',"dump_file"); + cl.addargname(' ',"output_py_file"); cl.add('f',1); cl.addargname('f',"max_frame"); cl.adddescription('f',"Do not write more than max_frame frames to the output file."); cl.add('r',1); cl.addargname('r',"ellip_res"); cl.adddescription('r',"Resolution of ellipsoids in PyMol. The number of triangles per ellipsoid is equal to 2*(ellip_res^2). Default is 10."); - cl.add('c',1); - cl.addargname('c',"color_file"); - cl.adddescription('c',"Color the atom_types and set transparency based on the color file. The color file contains a space delimited set sequence of the color for an atom followed by the alpha. The color should be the string name and the alpha should be between 0 and 1."); cl.add('s',0); cl.adddescription('s',"Output the results into separate .py files. The filename and extension for the output files is taken from output_py_file."); cl.add('i',3); @@ -362,6 +314,8 @@ void HandleArgs(CommandLine &cl, int argc, char *argv[], Error *error) { cl.adddescription('i',"Render the specified frame interval inclusive between start_frame and end_frame. skip gives the number of frames to skip between each rendered frame. A value of 0 outputs every frame between start_frame and end_frame. The first frame in the dump file is frame 0."); cl.add('b',0); cl.adddescription('b',"When used with -s, the option will number the filenames based on the frame number. By default, they are numbered consequtively from zero."); + cl.add('o',0); + cl.adddescription('o',"Do not output the outline for the simulation box."); // Stuff for every executable cl.addhelp('h',0); @@ -374,32 +328,40 @@ void HandleArgs(CommandLine &cl, int argc, char *argv[], Error *error) { cl.addtoman_chapter("NAME","Tools for ellipsoid visualization in PyMol of a LAMMPS trajectory."); // Version - cl.addtoman_chapter("VERSION","Version 0.1"); + cl.addtoman_chapter("VERSION","Version 0.2"); // Full Description - const string desc[5]={ - "Tool for ellipsoid visualization in PyMol of a LAMMPS trajectory. The input_file is a LAMMPS ", - "data file with a 'Shapes' section or a LAMMPS input script file with ellipsoid diameters specified using the ", - "'shape' command. The trajectory is input from dump_file that must ", - "be generated using a LAMMPS dump_style custom command with the following arguments in order:\n", - ".TP\\fItag type x y z quatw quati quatj quatk\\fR\n" - }; - cl.addtoman_chapter("DESCRIPTION",5,desc); + const string desc[22]={ + "Tool for converting LAMMPS trajectories into compiled graphics objects for ", + "visualization in PyMol. The flavor_file is an input file that describes ", + "the color, transparency, and size/shape of each atom type. The flavor_file ", + "consists of two possible line formats. For spherical particles, the format ", + "is:\n\n", + "\t\\fIatom_type color alpha diameter\\fR\n\n", + "where alpha is used to adjust the transparency of the particle. For ", + "ellipsoidal particles, the format is:\n\n" + "\t\\fIatom_type color alpha diameter_x diameter_y diameter_z\\fR\n\n", + "Ellipsoidal and spherical line formats can be mixed in the same flavor_file ", + "For any atom type not listed in the flavor_file a blue sphere of size 1 is ", + "assumed.\n\n", + "The dump_file is a LAMMPS trajectory. For atom types specified as spherical ", + "in the flavor_file, the dump_file must contain \\fItag type x y z\\fR as ", + "the first columns. For atom types specified as ellipsoidal in the ", + "flavor_file, the columns are \\fItag type x y z quatw quati quatj quatk\\fR.", + "The latter can be gerenated, for example, with the ", + "LAMMPS dump_style custom command with the following arguments in order:\n\n", + "\t\\fItag type x y z quatw quati quatj quatk\\fR\n\n", + "The output file is a python file for input to Pymol. This can be viewed ", + "from the command line using \\fIpymol output.py\\fR or by using the \\fIrun\\fR ", + "command from within Pymol." + }; + cl.addtoman_chapter("DESCRIPTION",22,desc); Colors colors; cl.addtoman_chapter("AVAILABLE COLORS",colors.colorlist()); - // bugs - const string bugs[3]={ - "Comments are not allowed at any point between a section header and ", - "the end of the contents for a section in either the data file or ", - "the input file." - }; - cl.addtoman_chapter("KNOWN BUGS",3,bugs); - - // Authors - cl.addtoman_chapter("AUTHORS","W. Michael Brown"); + cl.addtoman_chapter("AUTHORS","W. Michael Brown"); // Parse the commandline if (!cl.parse(argc,argv,error)) { @@ -420,7 +382,7 @@ void HandleArgs(CommandLine &cl, int argc, char *argv[], Error *error) { // Output the help if (cl['h']) { - cl.write_man_page(cout,"0.1","Graphics Utilities"); + cl.write_man_page(cout,"0.2","Graphics Utilities"); exit(0); } } diff --git a/tools/pymol_asphere/src/glsurface.cpp b/tools/pymol_asphere/src/glsurface.cpp index 23e484132a..e61498607e 100755 --- a/tools/pymol_asphere/src/glsurface.cpp +++ b/tools/pymol_asphere/src/glsurface.cpp @@ -535,6 +535,7 @@ void GLSurface::add_super_ellipsoid(const cPt &cen, const cPt &rad, Vertex ver; ver.color=color; ver.transparency=alpha; + ver.valid_normal=true; double dU=(u2-u1)/u_segs; double dV=(v2-v1)/v_segs; double U=u1;