Visualization using observer pattern
Wed, 22 Oct 1997 08:48:27 GMT

Hi all,

I just discovered a lightweight visualization package called Flex
(, which can act as a
visualization server via TCP/IP sockets. I hust hacked a little MMTK
extension to display Collection objects. Nothing more than a prototype ,
really. My big picture would be to have an observer instantiated in the
Python interpreter which would send an updated version of registered
molecules to the graphics server whenever you change the molecule's
coordinates. I think this would give MMTK some QUANTA-like qualities and
would IMHO be a better way than passing temporary VRML/PDB files around. 

Now my question: How could molecules notify the observer upon coordinate
change, _without_ the user invoking special notify() methods explicitly in
the interpreter? As I don't want to mess with the existing class structure
for ChemicalObjects, but still want to make my standard collections
viewable, I decided to override the __getattr__ and __setattr__ methods at
the Atom or ChemicalObjects class or at the Atom instance level. None
worked though. 

Anybody got a clue? Andrew (still there?), how was that problem solved in
VMD? Here, the problem is to _no_ introduce something like an abstract base
class which makes everything chemical object 'notifying'... this would
break a LOT of old code.

Any ideas are welcome! If anybodies interested in the extension (ugly as it
is), just ask.


Lutz Ehrlich

Structural Biology
Meyerhofstr. 1
D-69012 Heidelberg

web  :
phone: +49-6221-387-140
fax  : +49-6221-387-517