ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/OtherVisitor.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/OtherVisitor.cpp (file contents):
Revision 1118 by tim, Mon Apr 19 03:52:27 2004 UTC vs.
Revision 1119 by tim, Mon Apr 19 17:44:48 2004 UTC

# Line 38 | Line 38 | const string IgnoreVisitor::toString(){
38  
39   const string IgnoreVisitor::toString(){
40    char buffer[65535];
41 +  string result;
42    set<string>::iterator i;
43    
44 <  sprintf(buffer,"------------------------------------------------------------------\n");
45 <  sprintf(buffer,"Visitor name: %s", visitorName.c_str());
44 >  sprintf(buffer ,"------------------------------------------------------------------\n");
45 >  result += buffer;
46  
47 +  sprintf(buffer ,"Visitor name: %s", visitorName.c_str());
48 +  result += buffer;
49 +
50    //print the ignore type list
51 <  sprintf(buffer, "Ignore type list contains below types:\n");
52 <  for(i = itList.begin(); i != itList.end(); ++i)
49 <    sprintf(buffer,"%s,\t", i->c_str());
50 <  sprintf(buffer,"\n");
51 >  sprintf(buffer , "Ignore type list contains below types:\n");
52 >  result += buffer;
53  
54 <  sprintf(buffer,"------------------------------------------------------------------\n");
54 >  for(i = itList.begin(); i != itList.end(); ++i){
55 >    sprintf(buffer ,"%s,\t", i->c_str());
56 >    result += buffer;
57  
58 +  }
59 +  sprintf(buffer ,"\n");
60 +  result += buffer;
61 +
62 +  sprintf(buffer ,"------------------------------------------------------------------\n");
63 +  result += buffer;
64 +
65    return buffer;
66   }
67  
# Line 161 | Line 172 | const string ReplicateVisitor::toString(){
172  
173   const string ReplicateVisitor::toString(){
174    char buffer[65535];
175 +  string result;
176    set<string>::iterator i;
177    
178 <  sprintf(buffer,"------------------------------------------------------------------\n");
179 <  sprintf(buffer,"Visitor name: %s", visitorName.c_str());
178 >  sprintf(buffer ,"------------------------------------------------------------------\n");
179 >  result += buffer;
180  
181 +  sprintf(buffer ,"Visitor name: %s", visitorName.c_str());
182 +  result += buffer;
183 +
184    //print the replicate direction
185 <  sprintf(buffer, "repeatX = %d:\n", replicateOpt[0]);
186 <  sprintf(buffer, "repeatY = %d:\n", replicateOpt[1]);
172 <  sprintf(buffer, "repeatZ = %d:\n", replicateOpt[2]);
185 >  sprintf(buffer , "repeatX = %d:\n", replicateOpt[0]);
186 >  result += buffer;
187  
188 +  sprintf(buffer , "repeatY = %d:\n", replicateOpt[1]);
189 +  result += buffer;
190  
191 +  sprintf(buffer , "repeatZ = %d:\n", replicateOpt[2]);
192 +  result += buffer;
193 +
194 +
195    sprintf(buffer,"------------------------------------------------------------------\n");
196 +  result += buffer;
197  
198 <  return buffer;
198 >  return result;
199   }
200  
201   //----------------------------------------------------------------------------//
# Line 210 | Line 231 | void XYZVisitor::internalVisit(StuntDouble* sd){
231    
232    //if there is not atom data, just skip it
233    data = sd->getProperty("ATOMDATA");
234 <  if(data != NULL)
234 >  if(data != NULL){
235      atomData = dynamic_cast<AtomData*>(data);  
236      if(atomData == NULL)
237        return;
238 +  }
239    else
240      return;
241  
# Line 221 | Line 243 | void XYZVisitor::internalVisit(StuntDouble* sd){
243  
244      if(printDipole)
245        sprintf(buffer, "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
246 <                  atomInfo->AtomType,
246 >                  atomInfo->AtomType.c_str(),
247                    atomInfo->pos[0],
248                    atomInfo->pos[1],
249                    atomInfo->pos[2],
# Line 230 | Line 252 | void XYZVisitor::internalVisit(StuntDouble* sd){
252                    atomInfo->dipole[2]);
253      else
254        sprintf(buffer, "%s%15.8f%15.8f%15.8f",
255 <                  atomInfo->AtomType,
255 >                  atomInfo->AtomType.c_str(),
256                    atomInfo->pos[0],
257                    atomInfo->pos[1],
258                    atomInfo->pos[2]);        
# Line 286 | Line 308 | void PrepareVisitor::internalVisit(StuntDouble * sd){
308  
309    //remove atomdata
310    data = sd->getProperty("ATOMDATA");
311 <  if(data != NULL)
311 >  if(data != NULL){
312      atomData = dynamic_cast<AtomData*>(data);  
313      if(atomData != NULL)
314        sd->removeProperty("ATOMDATA");
315 +  }
316 +  
317   }
318  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines