296 |
|
|
297 |
|
//----------------------------------------------------------------------------// |
298 |
|
|
299 |
< |
void PrepareVisitor::internalVisit(StuntDouble * sd){ |
299 |
> |
void PrepareVisitor::internalVisit(Atom * atom){ |
300 |
|
GenericData* data; |
301 |
|
AtomData* atomData; |
302 |
|
|
303 |
|
//if visited property is existed, remove it |
304 |
< |
data = sd->getProperty("VISITED"); |
304 |
> |
data = atom->getProperty("VISITED"); |
305 |
|
if(data != NULL){ |
306 |
< |
sd->removeProperty("VISITED"); |
306 |
> |
atom->removeProperty("VISITED"); |
307 |
|
} |
308 |
|
|
309 |
|
//remove atomdata |
310 |
< |
data = sd->getProperty("ATOMDATA"); |
310 |
> |
data = atom->getProperty("ATOMDATA"); |
311 |
|
if(data != NULL){ |
312 |
|
atomData = dynamic_cast<AtomData*>(data); |
313 |
|
if(atomData != NULL) |
314 |
< |
sd->removeProperty("ATOMDATA"); |
314 |
> |
atom->removeProperty("ATOMDATA"); |
315 |
|
} |
316 |
|
|
317 |
|
} |
318 |
|
|
319 |
+ |
void PrepareVisitor::internalVisit(RigidBody * rb){ |
320 |
+ |
GenericData* data; |
321 |
+ |
AtomData* atomData; |
322 |
+ |
vector<Atom*> myAtoms; |
323 |
+ |
vector<Atom*>::iterator atomIter; |
324 |
+ |
|
325 |
+ |
//if visited property is existed, remove it |
326 |
+ |
data = rb->getProperty("VISITED"); |
327 |
+ |
if(data != NULL){ |
328 |
+ |
rb->removeProperty("VISITED"); |
329 |
+ |
} |
330 |
+ |
|
331 |
+ |
//remove atomdata |
332 |
+ |
data = rb->getProperty("ATOMDATA"); |
333 |
+ |
if(data != NULL){ |
334 |
+ |
atomData = dynamic_cast<AtomData*>(data); |
335 |
+ |
if(atomData != NULL) |
336 |
+ |
rb->removeProperty("ATOMDATA"); |
337 |
+ |
} |
338 |
+ |
|
339 |
+ |
myAtoms = rb->getAtoms(); |
340 |
+ |
|
341 |
+ |
for(atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter) |
342 |
+ |
internalVisit (*atomIter); |
343 |
+ |
} |