ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/selection/SelectionEvaluator.cpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/selection/SelectionEvaluator.cpp (file contents):
Revision 1982 by tim, Mon Feb 7 20:06:00 2005 UTC vs.
Revision 2097 by tim, Wed Mar 9 17:30:29 2005 UTC

# Line 49 | Line 49 | SelectionEvaluator::SelectionEvaluator(SimInfo* si) :
49   namespace oopse {
50  
51  
52 < SelectionEvaluator::SelectionEvaluator(SimInfo* si) : info(si), nameFinder(info), distanceFinder(info), isLoaded_(false){
52 > SelectionEvaluator::SelectionEvaluator(SimInfo* si)
53 >    : info(si), nameFinder(info), distanceFinder(info), indexFinder(info), isLoaded_(false){
54 >    
55      nStuntDouble = info->getNGlobalAtoms() + info->getNRigidBodies();
56   }            
57  
# Line 102 | Line 104 | bool SelectionEvaluator::loadScriptFileInternal(const
104   }
105  
106   bool SelectionEvaluator::loadScriptFileInternal(const  std::string & filename) {
107 <    ifstream ifs(filename.c_str());
107 >  std::ifstream ifs(filename.c_str());
108      if (!ifs.is_open()) {
109          return false;
110      }
# Line 300 | Line 302 | void SelectionEvaluator::define() {
302  
303      std::string variable = boost::any_cast<std::string>(statement[1].value);
304  
305 <    variables.insert(std::make_pair(variable, expression(statement, 2)));
305 >    variables.insert(VariablesType::value_type(variable, expression(statement, 2)));
306   }
307  
308  
# Line 319 | Line 321 | void SelectionEvaluator::predefine(const std::string&
321              int tok = statement[1].tok;
322              if (tok == Token::identifier || (tok & Token::predefinedset) == Token::predefinedset) {
323                  std::string variable = boost::any_cast<std::string>(statement[1].value);
324 <                variables.insert(std::make_pair(variable, statement));
324 >                variables.insert(VariablesType::value_type(variable, statement));
325  
326              } else {
327                  evalError("invalid variable name:" + script);
# Line 401 | Line 403 | BitSet SelectionEvaluator::indexInstruction(const boos
403          if (index < 0 || index >= bs.size()) {
404              invalidIndex(index);
405          } else {
406 <            bs.setBitOn(index);
406 >            indexFinder.find(index);
407          }
408      } else if (value.type() == typeid(std::pair<int, int>)) {
409          std::pair<int, int> indexRange= boost::any_cast<std::pair<int, int> >(value);
# Line 409 | Line 411 | BitSet SelectionEvaluator::indexInstruction(const boos
411          if (indexRange.first < 0 || indexRange.second >= bs.size()) {
412              invalidIndexRange(indexRange);
413          }else {
414 <            bs.setRangeOn(indexRange.first, indexRange.second);
414 >            indexFinder.find(indexRange.first, indexRange.second);
415          }
416      }
417  
418      return bs;
419   }
420  
419 //BitSet SelectionEvaluator::evaluate(int frameNo) {
420 //
421 //}
422
421   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines