ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/visitors/ZconsVisitor.cpp
(Generate patch)

Comparing:
trunk/OOPSE-3.0/src/visitors/ZconsVisitor.cpp (file contents), Revision 1490 by gezelter, Fri Sep 24 04:16:43 2004 UTC vs.
branches/new_design/OOPSE-3.0/src/visitors/ZconsVisitor.cpp (file contents), Revision 1701 by tim, Wed Nov 3 16:08:43 2004 UTC

# Line 1 | Line 1
1 < #include "ZconsVisitor.hpp"
1 > #include "visitors/ZconsVisitor.hpp"
2   #include <cmath>
3  
4 + namespace oopse {
5 +
6   ZConsVisitor::ZConsVisitor(SimInfo* info) : BaseVisitor(), zconsReader(NULL){
7    GenericData* data;
8 <  DoubleData* tolerance;  
8 >  DoubleGenericData* tolerance;  
9    ZConsParaData* zConsParaData;
10 <  StringData* filename;
11 <  DoubleData* sampleTime;
10 >  StringGenericData* filename;
11 >  DoubleGenericData* sampleTime;
12    vector<ZConsParaItem>* parameters;
13  
14    this->info = info;
15    visitorName = "ZConsVisitor";
16    
17    //retrieve tolerance for z-constraint molecuels
18 <  data = info->getProperty(ZCONSTOL_ID);
18 >  data = info->getPropertyByName(ZCONSTOL_ID);
19  
20    if (!data){
21      cerr << "Can not get zconstraint tolerance from SimInfo" << endl;
# Line 21 | Line 23 | ZConsVisitor::ZConsVisitor(SimInfo* info) : BaseVisito
23      return;
24    }
25    else{
26 <    tolerance = dynamic_cast<DoubleData*>(data);
26 >    tolerance = dynamic_cast<DoubleGenericData*>(data);
27  
28      if (!tolerance){
29        cerr << "Can not get zconstraint tolerance  from SimInfo" << endl;
# Line 34 | Line 36 | ZConsVisitor::ZConsVisitor(SimInfo* info) : BaseVisito
36    }
37  
38    //retrieve sample time of z-contraint
39 <  data = info->getProperty(ZCONSTIME_ID);
39 >  data = info->getPropertyByName(ZCONSTIME_ID);
40  
41    if (!data){
42      cerr << "Can not get zcons time  from SimInfo" << endl;
# Line 42 | Line 44 | ZConsVisitor::ZConsVisitor(SimInfo* info) : BaseVisito
44      return;
45    }
46    else{
47 <    sampleTime = dynamic_cast<DoubleData*>(data);
47 >    sampleTime = dynamic_cast<DoubleGenericData*>(data);
48  
49      if (!sampleTime){
50        cerr << "Can not get zcons time  from SimInfo" << endl;
# Line 55 | Line 57 | ZConsVisitor::ZConsVisitor(SimInfo* info) : BaseVisito
57    }
58  
59    //retrieve index of z-constraint molecules
60 <  data = info->getProperty(ZCONSPARADATA_ID);
60 >  data = info->getPropertyByName(ZCONSPARADATA_ID);
61    if (!data){
62      cerr << "Can not get index of z-constraint molecules from SimInfo" << endl;
63      haveZcons = false;
# Line 93 | Line 95 | ZConsVisitor::ZConsVisitor(SimInfo* info) : BaseVisito
95    }//end  if (!data  
96    
97    //retrieve output filename of z force
98 <  data = info->getProperty(ZCONSFILENAME_ID);
98 >  data = info->getPropertyByName(ZCONSFILENAME_ID);
99    if (!data){
100      cerr << "Can not get filename of z-constraint output from SimInfo" << endl;
101      haveZcons = false;
102      return;
103    }
104    else{
105 <    filename = dynamic_cast<StringData*>(data);
105 >    filename = dynamic_cast<StringGenericData*>(data);
106  
107      if (!filename){
108        cerr << "Can not get filename of z-constraint output from SimInfo" << endl;
# Line 213 | Line 215 | void ZConsVisitor::internalVisit(StuntDouble* sd, cons
215  
216    
217    //if there is not atom data, just skip it
218 <  data = sd->getProperty("ATOMDATA");
218 >  data = sd->getPropertyByName("ATOMDATA");
219    if(data != NULL){
220      atomData = dynamic_cast<AtomData*>(data);  
221      if(atomData == NULL)
# Line 276 | Line 278 | const string ZConsVisitor::toString(){
278  
279    return result;
280   }
281 +
282 +
283 + }//namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines