1 |
< |
#include "OtherVisitor.hpp" |
2 |
< |
#include "DirectionalAtom.hpp" |
3 |
< |
#include "RigidBody.hpp" |
4 |
< |
#include "Molecule.hpp" |
5 |
< |
#include "SimInfo.hpp" |
1 |
> |
#include "visitors/OtherVisitor.hpp" |
2 |
> |
#include "primitives/DirectionalAtom.hpp" |
3 |
> |
#include "primitives/RigidBody.hpp" |
4 |
> |
#include "primitives/Molecule.hpp" |
5 |
> |
#include "brains/SimInfo.hpp" |
6 |
> |
|
7 |
> |
namespace oopse { |
8 |
> |
|
9 |
|
//----------------------------------------------------------------------------// |
10 |
|
void IgnoreVisitor::visit(Atom* atom){ |
11 |
|
if(isIgnoreType(atom->getType())) |
41 |
|
|
42 |
|
void IgnoreVisitor::internalVisit(StuntDouble* sd){ |
43 |
|
GenericData* data; |
44 |
< |
data = sd->getProperty("IGNORE"); |
44 |
> |
data = sd->getPropertyByName("IGNORE"); |
45 |
|
|
46 |
|
//if this stuntdoulbe is already marked as ignore just skip it |
47 |
|
if (data == NULL){ |
103 |
|
AtomInfo* atomInfo; |
104 |
|
vector<AtomInfo*>::iterator i; |
105 |
|
|
106 |
< |
data = sd->getProperty("ATOMDATA"); |
106 |
> |
data = sd->getPropertyByName("ATOMDATA"); |
107 |
|
if(data != NULL){ |
108 |
|
atomData = dynamic_cast<AtomData*>(data); |
109 |
|
if(atomData == NULL) |
174 |
|
IntVec3 dir; |
175 |
|
|
176 |
|
//if there is not atom data, just skip it |
177 |
< |
data = sd->getProperty("ATOMDATA"); |
177 |
> |
data = sd->getPropertyByName("ATOMDATA"); |
178 |
|
if(data != NULL){ |
179 |
|
atomData = dynamic_cast<AtomData*>(data); |
180 |
|
if(atomData == NULL) |
273 |
|
char buffer[1024]; |
274 |
|
|
275 |
|
//if there is not atom data, just skip it |
276 |
< |
data = sd->getProperty("ATOMDATA"); |
276 |
> |
data = sd->getPropertyByName("ATOMDATA"); |
277 |
|
if(data != NULL){ |
278 |
|
atomData = dynamic_cast<AtomData*>(data); |
279 |
|
if(atomData == NULL) |
309 |
|
bool XYZVisitor::isIgnore(StuntDouble* sd){ |
310 |
|
GenericData* data; |
311 |
|
|
312 |
< |
data = sd->getProperty("IGNORE"); |
312 |
> |
data = sd->getPropertyByName("IGNORE"); |
313 |
|
return data ==NULL ? false : true; |
314 |
|
} |
315 |
|
|
364 |
|
AtomData* atomData; |
365 |
|
|
366 |
|
//if visited property is existed, remove it |
367 |
< |
data = atom->getProperty("VISITED"); |
367 |
> |
data = atom->getPropertyByName("VISITED"); |
368 |
|
if(data != NULL){ |
369 |
|
atom->removeProperty("VISITED"); |
370 |
|
} |
371 |
|
|
372 |
|
//remove atomdata |
373 |
< |
data = atom->getProperty("ATOMDATA"); |
373 |
> |
data = atom->getPropertyByName("ATOMDATA"); |
374 |
|
if(data != NULL){ |
375 |
|
atomData = dynamic_cast<AtomData*>(data); |
376 |
|
if(atomData != NULL) |
386 |
|
vector<Atom*>::iterator atomIter; |
387 |
|
|
388 |
|
//if visited property is existed, remove it |
389 |
< |
data = rb->getProperty("VISITED"); |
389 |
> |
data = rb->getPropertyByName("VISITED"); |
390 |
|
if(data != NULL){ |
391 |
|
rb->removeProperty("VISITED"); |
392 |
|
} |
393 |
|
|
394 |
|
//remove atomdata |
395 |
< |
data = rb->getProperty("ATOMDATA"); |
395 |
> |
data = rb->getPropertyByName("ATOMDATA"); |
396 |
|
if(data != NULL){ |
397 |
|
atomData = dynamic_cast<AtomData*>(data); |
398 |
|
if(atomData != NULL) |
451 |
|
myAtoms = rb->getAtoms(); |
452 |
|
for(atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter){ |
453 |
|
|
454 |
< |
data = (*atomIter)->getProperty("ATOMDATA"); |
454 |
> |
data = (*atomIter)->getPropertyByName("ATOMDATA"); |
455 |
|
if(data != NULL){ |
456 |
|
atomData = dynamic_cast<AtomData*>(data); |
457 |
|
if(atomData == NULL) |
493 |
|
return result; |
494 |
|
} |
495 |
|
|
496 |
+ |
|
497 |
+ |
}//namespace oopse |