This is helpful.

I will try to digest it and will try it out.

Miguel

> On Friday 29 August 2003 18:50, Miguel wrote:
>> I am trying to work on the adapter to map the cdk class hierarchy to
>> the Jmol view of the world.
>>
>> Some of us discussed this briefly the other day on #cdk irc. However,
>> I have now spent some time on it and I am (once again :) confused and
>> frustrated.
>
> My apologies for the lack of documentation.
>
>> The Jmol picture of the world is pretty simple.
>>  A clientFile contains one or more frames
>>  A frame contains one or more atoms/bonds/vectors/crystal cells
>>
>> Someone needs to help me map this over to the cdk world. There are
>> simply too many layers for me to figure it out.
>
> It is fo many of us... even to Christoph and I...
>
>> This class hierarchy seems very complicated to me. I only want to ask
>> a few (seemingly simple) questions:
>>  - How many frames are in your file?
>> For each frame:
>>  - How many atoms do you have?
>>    (the client can answer '0' if it doesn't want to figure it out)
>>  - Iterate over all the atoms
>>  - Iterate over all the bonds
>>    (if you have any)
>>  - Iterate over all the vectors
>>    (if you have any)
>>  - Iterate over all the lines which make up your crystal cell
>>    (if you have any)
>
> I'll get back to this...
>
>> I assume that a jmol.clientFile is a cdk.ChemFile. However, this may
>> not be correct. Please confirm.
>
> Here is an overview of the classes, with some explanation to what I
> think they  are...
>
> A ChemFile is a container that should be able to contain a complete
> chemical document, one of any sort... This might not be feasible at all,
> but it's just  a starting point, and given its flexibility it might just
> work...
>
> A ChemFile contains one or more ChemSequence's. A ChemSequence is a set
> of chemical entities that home some relation ship... it may be a plain
> set of  models, or an animation. A set of molecules might be presented
> as a  SetOfMolecules too, btw.
>
> Each sequence contains zero or more ChemModel, and each ChemModel holds
> an instance of chemical space: a set of atoms, bonds, lattice vectors
> etc...
>
> A ChemModel then contains chemistry... either a SetOfMolecules, which
> should actually be a SetOfAtomContainers... this is to provide an option
> of splitting  up things in space... into molecules is used, but don't
> directly see any  other use for this... It can also contains a
> SetOfReactions and a Crystal.  When more than just one of those three is
> given, the behaviour is not really  specified, but I think it should all
> be taken into account...
>
>> Does a ChemSequence correspond to a single "frame" of an animation?
>
> An animation.
>
>> If so, then a ChemSequence would map to a single 'frame' in the Jmol
>> world. That is, the atoms which get rendered to the screen at one time
>> are:
>> - all the Atoms
>> -- in all the Molecules
>> --- in the SetOfMolecules
>> ---- in all the ChemModels
>> ----- contained in the specified ChemSequence
>> ------ contained in the ChemFile
>
> Getting back to the iterators... There are helper classes that help you
> retrieve information from this tree... these are called manipulators,
> and  could best be used in the Iterators... The most straightforward
> method in the  *Manipulators (cdk.tools) classes, is the
> getAllInOneContainer() methods... They create a new container containing
> all the atoms and bonds in the  object... e.g. if Jmol is using the
> ChemModel for one frame, then it could  retrieve all Atoms as follows:
>
> ChemModel frame1;
> Atom[] allAtoms =
> ChemModelManipulator.getAllInOneContainer(frame1).getAtoms();
>
>> Now a Crystal is not a Molecule. Therefore, it cannot be contained in
>> a SetOfMolecules. Therefore, it must be handled differently. But it
>> seems that there is only one Crystal in a ChemModel, so I suppose that
>> simplifies things somewhat down the crystal branch.
>
>>  - How many frames are in your file?
>
> (The actual syntax might be slightly off... doing this without having
> API  besides me...)
>
> ChemFile jmolDocument;
> if (jmolDocument.getChemSequenceCount() > 0) {
>       int frameCount = jmolDocument.getChemSequence(0).getChemModelCount();
> } else {
>       int frameCount = 0;
> }
>
>>  - How many atoms do you have?
>>    (the client can answer '0' if it doesn't want to figure it out)
>
> int atomCount =
> ChemFileManipulator.getAllInOneContainer(jmolDocument).getAtomCount();
>
>>  - Iterate over all the atoms
>
> Atom[] atoms =
> ChemFileManipulator.getAllInOneContainer(jmolDocument).getAtoms(); for
> (int i=0; i<atoms.length; i++) {
> }
>
>>  - Iterate over all the bonds
>
> Bond[] bonds =
> ChemFileManipulator.getAllInOneContainer(jmolDocument).getBonds(); for
> (int i=0; i<bonds.length; i++) {
> }
>
>>  - Iterate over all the vectors
>>    (if you have any)
>
> Unspecified in CDK... we should probably discuss this in more depth...
>
>>  - Iterate over all the lines which make up your crystal cell
>>    (if you have any)
>
> Yes, that is more straight forward... it should look something like
> (excluding tests for nullness):
>
> Crystal crystal =
> jmolDocument.getChemSequence(0).getChemModel(0).getCrystal();
> double[] vectorForAAxis = crystal.getA();
> double[] vectorForBAxis = crystal.getB();
> double[] vectorForCAxis = crystal.getC();
>
> The Crystal class currently has no fields for its dimensions in terms of
> unit  cells... I've planned to extend it for this purpose and will do
> this next  week...The Iterator will take care of using this information
> in iterating  over all Atoms that need to be displayed... And the
> Iterator will also take  care of displaying the atoms in several ways:
> 1) the original atoms, 2) all  atoms within the unit cell box.
>
> Ok, hope this helps for now...
>
> Egon
>
> --
> PhD Molecular Representation in Chemometrics
> Dept. Analytical Chemistry
> http://www-cac.sci.kun.nl/people/egonw.html
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Jmol-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers


--------------------------------------------------
Miguel Howard                   [EMAIL PROTECTED]
c/Peņa Primera 11-13 esc dcha 6B
37002 Salamanca
Espaņa Spain
--------------------------------------------------
telefono casa 923 27 10 82 movil 650 52 54 58
--------------------------------------------------
To call from the US dial    9:00 am Pacific US   =
home 011 34 923 27 10 82   12:00 noon Eastern US =
cell 011 34 650 52 54 58    6:00 pm Spain
--------------------------------------------------




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to