ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/selection/DistanceFinder.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/selection/DistanceFinder.cpp (file contents):
Revision 2042 by tim, Thu Feb 17 15:18:36 2005 UTC vs.
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC

# Line 43 | Line 43 | DistanceFinder::DistanceFinder(SimInfo* info) : info_(
43   #include "primitives/Molecule.hpp"
44   namespace oopse {
45  
46 < DistanceFinder::DistanceFinder(SimInfo* info) : info_(info) {
46 >  DistanceFinder::DistanceFinder(SimInfo* info) : info_(info) {
47  
48      nStuntDoubles_ = info_->getNGlobalAtoms() + info_->getNGlobalRigidBodies();
49      stuntdoubles_.resize(nStuntDoubles_);
# Line 58 | Line 58 | DistanceFinder::DistanceFinder(SimInfo* info) : info_(
58      
59      for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) {
60          
61 <        for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
62 <            stuntdoubles_[atom->getGlobalIndex()] = atom;
63 <        }
61 >      for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
62 >        stuntdoubles_[atom->getGlobalIndex()] = atom;
63 >      }
64  
65 <        for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) {
66 <            stuntdoubles_[rb->getGlobalIndex()] = rb;
67 <        }
65 >      for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) {
66 >        stuntdoubles_[rb->getGlobalIndex()] = rb;
67 >      }
68          
69      }    
70  
71 < }
71 >  }
72  
73 < BitSet DistanceFinder::find(const BitSet& bs, double distance) {
73 >  BitSet DistanceFinder::find(const BitSet& bs, double distance) {
74      StuntDouble * center;
75      Vector3d centerPos;
76      Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
# Line 78 | Line 78 | BitSet DistanceFinder::find(const BitSet& bs, double d
78      assert(bsResult.size() == bs.size());
79      
80      for (int i = bs.firstOnBit(); i != -1; i = bs.nextOnBit(i)) {
81 <        center = stuntdoubles_[i];
82 <        centerPos = center->getPos();
83 <        for (int j = 0; j < stuntdoubles_.size(); ++j) {
84 <            Vector3d r =centerPos - stuntdoubles_[j]->getPos();
85 <            currSnapshot->wrapVector(r);
86 <            if (r.length() <= distance) {
87 <                bsResult.setBitOn(j);
88 <            }
89 <        }
81 >      center = stuntdoubles_[i];
82 >      centerPos = center->getPos();
83 >      for (int j = 0; j < stuntdoubles_.size(); ++j) {
84 >        Vector3d r =centerPos - stuntdoubles_[j]->getPos();
85 >        currSnapshot->wrapVector(r);
86 >        if (r.length() <= distance) {
87 >          bsResult.setBitOn(j);
88 >        }
89 >      }
90      }
91  
92      return bsResult;
93 < }
93 >  }
94  
95   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines