[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Helper functions



Well, I was thinking from the other direction - a container class which can contain particles and/or other containers. So for example, a rigid body would be a simple container of particles, a residue would be similar, while a chain would be a container of residues. (Whether you have an actual Residue class derived from Container, and whether it's done at the C++ or Python level, is debatable.) The two approaches are, of course, essentially equivalent.
To cover a loose end in my last email, I am not sure that providing a subclass of Particle called Container which provides more direct access to children and parents would be such a good idea. Why should we just do it for Containers? Why not geometric particles? Spherical particles? If we head that route we should probably just chuck the get_string, get_int sort of access entirely and just have a real class hierarchy.