On Wed, Feb 10, 2010 at 7:10 AM, P.Canepa <pc...@kent.ac.uk> wrote:

> Dear Bob,
> 3)  ATOMS IN THE ASYMMETRIC UNIT that starts the atomic coordinates section
> As you seethe numbers of  lattice parameters and atomic coordinates are
> found two lines below.
>


> In addition the values of the lattice parameters and x y z per each atoms
> are on the same line, how can I tackle this problem reading line by line (as
> you did in Wien2kReader.java) ?


All the readers are subclasses of smarter.AtomCollectionReader. At the end
of that class code you will see a whole set of public functions you can tap
into. In particular there is a global field "line" that is read with

readLine();

When you are reading a mix of text and numbers from a line, first consider
whether there is guaranteed white space between them. Not all programs do
that. If that is the case, then

String[] tokens = getTokens();  // from the NEXT line

or

String[] tokens = getTokens(line); // from the CURRENT line

would be my choice. Then I do something like:

atom.set(parseFloat(tokens[0]), parseFloat(tokens[1]),
parseFloat(tokens[2]));


for example.

Or, if you know it is column based, you can just use:

readLine();

atom.set(parseFloat(line.substring(10,20)), parseFloat.....)

Something like that.

Don't worry so much about getting this perfect. I'll edit it down to the
simplest way to read the file. Just get it reading the file successfully any
way you want.

Bob


> Can you help me?
> Furthermore does jmol need the direct lattice vector to define the cell?
> Thank you
> --
> Pieremanuele Canepa
> Room 104
> School of Physical Sciences, Ingram Building,
> University of Kent, Canterbury, Kent,
> CT2 7NH
> United Kingdom
> -----------------------------------------------------------
> ________________________________________
> From: Robert Hanson [hans...@stolaf.edu]
> Sent: Tuesday, February 09, 2010 2:27 PM
> To: jmol-developers@lists.sourceforge.net
> Subject: Re: [Jmol-developers] Extend Jmol to crystal files
>
> That would be great. Please:
>
> 1) Check out the Jmol code using SVN/Eclipse.
>
> 2) Create your reader. Please add this to org.jmol.adapter.readers.xtal
> (unless it is XML, then use ....xml). Take a look at
> org.jmol.adapter.smarter.AtomSetCollectionReader.java to get a sense of what
> is going to happen in the reader.
>
> I can help if you get stuck. This mostly involves:
>
>  (a) adding a bit of code to org.jmol.adapter.smarter.Resolver.java
>  (b) copying one of the other readers as a template as CrystalReader.java
>  (c) modifying the template as needed
>
> 3) Create a working patch and send it to us. This should be just two files
> -- Resolver.java and CrystalReader.java
>
> 4) I will check over your code, make sure it doesn't conflict with other
> readers, make sure it properly accounts for various options, and probably
> edit it a bit to be consistent with our styling. Then I will add it to Jmol
> 11.9.x
>
> Bob
>
> On Tue, Feb 9, 2010 at 5:19 AM, P.Canepa <pc...@kent.ac.uk<mailto:
> pc...@kent.ac.uk>> wrote:
> I am physic PhD student and  I am willing  to contribute to the development
> of  Jmol.
>  Reading trough Jmol web-page  I realized that it is already capable to
> save file for other famous period code such as: CASTEP, WIEN2k, VASP, etc...
> I would like to extend it to  CRYSTAL09, the periodic code developed at the
> University of Turin, Italy (http:\\www.crystal.unito.it<
> http://www.crystal.unito.it>). I have a bit of experience with java
>  (especially java swing) and I use daily CRYSTAL . Can you give me some hint
> as to start developing class to deal with crystal files?
> Many Thanks, Piero
>
>
> --
> Pieremanuele Canepa
> Room 104
> School of Physical Sciences, Ingram Building,
> University of Kent, Canterbury, Kent,
> CT2 7NH
> United Kingdom
> -----------------------------------------------------------
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net<mailto:
> Jmol-developers@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
>
>
> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> 1520 St. Olaf Ave.
> Northfield, MN 55057
> http://www.stolaf.edu/people/hansonr
> phone: 507-786-3107
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
>
> ------------------------------------------------------------------------------
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to