66 |
|
|
67 |
|
const string LipidHeadVisitor::toString(){ |
68 |
|
char buffer[65535]; |
69 |
+ |
string result; |
70 |
|
set<string>::iterator i; |
71 |
|
|
72 |
< |
sprintf(buffer,"------------------------------------------------------------------\n"); |
73 |
< |
sprintf(buffer,"Visitor name: %s", visitorName.c_str()); |
72 |
> |
sprintf(buffer ,"------------------------------------------------------------------\n"); |
73 |
> |
result += buffer; |
74 |
> |
|
75 |
> |
sprintf(buffer ,"Visitor name: %s\n", visitorName.c_str()); |
76 |
> |
result += buffer; |
77 |
|
|
78 |
|
//print the ignore type list |
79 |
< |
sprintf(buffer, "lipidHeadName list contains below types:\n"); |
80 |
< |
for(i = lipidHeadName.begin(); i != lipidHeadName.end(); ++i) |
77 |
< |
sprintf(buffer,"%s,\t", i->c_str()); |
78 |
< |
sprintf(buffer,"\n"); |
79 |
> |
sprintf(buffer , "lipidHeadName list contains below types:\n"); |
80 |
> |
result += buffer; |
81 |
|
|
82 |
< |
sprintf(buffer,"------------------------------------------------------------------\n"); |
82 |
> |
for(i = lipidHeadName.begin(); i != lipidHeadName.end(); ++i){ |
83 |
> |
sprintf(buffer ,"%s\t", i->c_str()); |
84 |
> |
result += buffer; |
85 |
> |
} |
86 |
|
|
87 |
< |
return buffer; |
87 |
> |
sprintf(buffer ,"\n"); |
88 |
> |
result += buffer; |
89 |
|
|
90 |
< |
} |
90 |
> |
sprintf(buffer ,"------------------------------------------------------------------\n"); |
91 |
> |
result += buffer; |
92 |
> |
|
93 |
> |
return result; |
94 |
> |
|
95 |
> |
} |
96 |
> |
|
97 |
> |
void RBCOMVisitor::visit(RigidBody* rb){ |
98 |
> |
AtomData* atomData; |
99 |
> |
AtomInfo* atomInfo; |
100 |
> |
double pos[3]; |
101 |
> |
|
102 |
> |
rb->getPos(pos); |
103 |
> |
atomInfo = new AtomInfo; |
104 |
> |
atomInfo->AtomType = "X"; |
105 |
> |
atomInfo->pos[0] = pos[0]; |
106 |
> |
atomInfo->pos[1] = pos[1]; |
107 |
> |
atomInfo->pos[2] = pos[2]; |
108 |
> |
atomInfo->dipole[0] = 0; |
109 |
> |
atomInfo->dipole[1] = 0; |
110 |
> |
atomInfo->dipole[2] = 0; |
111 |
> |
|
112 |
> |
atomData = new AtomData; |
113 |
> |
atomData->setID("ATOMDATA"); |
114 |
> |
atomData->addAtomInfo(atomInfo); |
115 |
> |
|
116 |
> |
rb->addProperty(atomData); |
117 |
> |
} |
118 |
> |
|
119 |
> |
const string RBCOMVisitor::toString(){ |
120 |
> |
char buffer[65535]; |
121 |
> |
string result; |
122 |
> |
|
123 |
> |
sprintf(buffer ,"------------------------------------------------------------------\n"); |
124 |
> |
result += buffer; |
125 |
> |
|
126 |
> |
sprintf(buffer ,"Visitor name: %s\n", visitorName.c_str()); |
127 |
> |
result += buffer; |
128 |
> |
|
129 |
> |
//print the ignore type list |
130 |
> |
sprintf(buffer , "Visitor Description: add a pseudo atom at the center of the mass of the rigidbody\n"); |
131 |
> |
result += buffer; |
132 |
> |
|
133 |
> |
sprintf(buffer ,"------------------------------------------------------------------\n"); |
134 |
> |
result += buffer; |
135 |
> |
|
136 |
> |
return result; |
137 |
> |
|
138 |
> |
} |
139 |
> |
|