From: eric c. <dif...@gm...> - 2006-06-24 18:19:57
|
On Jun 23, 2006, at 10:49 PM, Bob Hanson wrote: > simple things like this are possible; the bitset idea or atom > expression > idea provides flexibility. If null, then it could certainly default to > "replace all" but I thought we were interested in something that > didn't > necessarily replace all. > true, something more generally applicable would be better. still, what about the case where an atom may be added or deleted? i suppose that at the beginning of the method we could have something like this: void replaceCoords(BitSet atomList, Point3f[] coordList) { int newAtomCount = atomList.size(); if (newAtomCount > atomCount) { for(int i = atomCount; i < newAtomCount; i++) { addAtom(); // the syntax for this method baffles me at the moment } atomCount = newAtomCount; } else if (newAtomCount < atomCount) { for(int i = atomCount - 1; i >= newAtomCount; i--) deleteAtom(i); atomCount = newAtomCount; } // rest of code } though clearly i don't understand all the fields of addAtom() yet. would this be the best way to go about this? |