Changeset d2d8f5
- Timestamp:
- Feb 5, 2010, 3:19:27 PM (16 years ago)
- Children:
- 86b917
- Parents:
- 42918b
- Location:
- molecuilder/src
- Files:
-
- 6 edited
-
Makefile.am (modified) (1 diff)
-
World.cpp (modified) (2 diffs)
-
World.hpp (modified) (3 diffs)
-
atom.cpp (modified) (4 diffs)
-
atom_particleinfo.cpp (modified) (1 diff)
-
atom_particleinfo.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/Makefile.am
r42918b rd2d8f5 27 27 # deleted once everything is fully refactored 28 28 LEGACYSOURCE = Legacy/oldmenu.cpp 29 LEGACYHEADER = Legacy/oldmenu.hpp Legacy/WorldContent.hpp Legacy/WorldContent_impl.hpp29 LEGACYHEADER = Legacy/oldmenu.hpp 30 30 31 31 SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PATTERNSOURCE} ${UISOURCE} ${LEGACYSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp World.cpp -
molecuilder/src/World.cpp
r42918b rd2d8f5 8 8 #include "World.hpp" 9 9 10 #include <iostream> 10 #include "atom.hpp" 11 12 using namespace std; 11 13 12 14 /******************************* getter and setter ************************/ … … 73 75 } 74 76 77 // some legacy stuff to let the World know about items created outside 78 void World::registerAtom(atom *theAtom){ 79 OBSERVE; 80 atoms[theAtom->getId()] = theAtom; 81 } 75 82 76 // methods for WorldContent CRTP mechanism 77 void World::registerContent(atom *atom){ 78 std::cout << "############### some kind of Atom created ##################" << std::endl;83 void World::unregisterAtom(atom *theAtom){ 84 OBSERVE; 85 atoms.erase(theAtom->getId()); 79 86 } -
molecuilder/src/World.hpp
r42918b rd2d8f5 10 10 11 11 #include <boost/thread.hpp> 12 #include <map> 12 13 13 14 #include "Patterns/Observer.hpp" … … 27 28 private: 28 29 periodentafel *periode; 30 std::map<int,atom*> atoms; 29 31 30 32 … … 52 54 53 55 // functions used for the WorldContent template mechanism 54 void registerContent(atom *theAtom); 56 void registerAtom(atom *theAtom); 57 void unregisterAtom(atom *theAtom); 55 58 private: 56 59 MoleculeListClass *molecules; -
molecuilder/src/atom.cpp
r42918b rd2d8f5 13 13 #include "parser.hpp" 14 14 #include "vector.hpp" 15 #include "World.hpp" 15 16 16 17 /************************************* Functions for class atom *************************************/ … … 21 22 atom::atom() : previous(NULL), next(NULL), father(this), sort(&nr) 22 23 { 24 World::get()->registerAtom(this); 23 25 node = &x; // TesselPoint::x can only be referenced from here 24 26 }; … … 28 30 atom::atom(atom *pointer) : previous(NULL), next(NULL), father(pointer), sort(&nr) 29 31 { 32 World::get()->registerAtom(this); 30 33 type = pointer->type; // copy element of atom 31 34 x.CopyVector(&pointer->x); // copy coordination … … 40 43 atom::~atom() 41 44 { 45 World::get()->unregisterAtom(this); 42 46 unlink(this); 43 47 }; -
molecuilder/src/atom_particleinfo.cpp
r42918b rd2d8f5 20 20 }; 21 21 22 int ParticleInfo::getId() { 23 return nr; 24 } 25 22 26 ostream & operator << (ostream &ost, const ParticleInfo &a) 23 27 { -
molecuilder/src/atom_particleinfo.hpp
r42918b rd2d8f5 35 35 ostream & operator << (ostream &ost) const; 36 36 37 int getId(); 38 37 39 private: 38 40 };
Note:
See TracChangeset
for help on using the changeset viewer.
