atom_example.cpp

00001 #include <elements.h>
00002 
00003 void main()
00004 {
00005         // instanciates a new Hydrogen atom
00006   Atom* a1 = new Atom(elements["H"]);
00007 
00008         // add a new float descriptor
00009         a1->addFloatDescriptor("myFloatDescriptor", 0, "Angstrom", "My cute additional descriptor");
00010 
00011         // get value of myFloatDescriptor for atom a1
00012         float mfdValue = a1->getFloatDescriptor("myFloatDescriptor")->getValue();
00013         string mfdUnit = a1->getFloatDescriptor("myFloatDescriptor")->getValue();
00014         cout << "the value of myFloatDescriptor is equal" << mfd << " " << mfdUnit << endl;
00015 
00016         // get atomic number
00017         int thisAn = a1->getAn();
00018         cout << "atomic number: " << thisAn << endl;
00019 
00020   a1->describe();
00021 }

Generated on Wed Nov 28 12:12:51 2007 for ChemCpp by  doxygen 1.4.6