--- trunk/OOPSE/libmdtools/RigidBodyVisitor.cpp 2004/04/19 17:44:48 1119 +++ trunk/OOPSE/libmdtools/RigidBodyVisitor.cpp 2004/04/20 05:39:38 1126 @@ -93,3 +93,47 @@ const string LipidHeadVisitor::toString(){ return result; } + +void RBCOMVisitor::visit(RigidBody* rb){ + AtomData* atomData; + AtomInfo* atomInfo; + double pos[3]; + + rb->getPos(pos); + atomInfo = new AtomInfo; + atomInfo->AtomType = "X"; + atomInfo->pos[0] = pos[0]; + atomInfo->pos[1] = pos[1]; + atomInfo->pos[2] = pos[2]; + atomInfo->dipole[0] = 0; + atomInfo->dipole[1] = 0; + atomInfo->dipole[2] = 0; + + atomData = new AtomData; + atomData->setID("ATOMDATA"); + atomData->addAtomInfo(atomInfo); + + rb->addProperty(atomData); +} + +const string RBCOMVisitor::toString(){ + char buffer[65535]; + string result; + + sprintf(buffer ,"------------------------------------------------------------------\n"); + result += buffer; + + sprintf(buffer ,"Visitor name: %s\n", visitorName.c_str()); + result += buffer; + + //print the ignore type list + sprintf(buffer , "Visitor Description: add a pseudo atom at the center of the mass of the rigidbody\n"); + result += buffer; + + sprintf(buffer ,"------------------------------------------------------------------\n"); + result += buffer; + + return result; + +} +