# | Line 115 | Line 115 | namespace oopse { | |
---|---|---|
115 | return loadScript(filename, script); | |
116 | } | |
117 | ||
118 | < | void SelectionEvaluator::instructionDispatchLoop(BitSet& bs){ |
118 | > | void SelectionEvaluator::instructionDispatchLoop(OOPSEBitSet& bs){ |
119 | ||
120 | while ( pc < aatoken.size()) { | |
121 | statement = aatoken[pc++]; | |
# | Line 136 | Line 136 | namespace oopse { | |
136 | ||
137 | } | |
138 | ||
139 | < | BitSet SelectionEvaluator::expression(const std::vector<Token>& code, int pcStart) { |
140 | < | BitSet bs; |
141 | < | std::stack<BitSet> stack; |
139 | > | OOPSEBitSet SelectionEvaluator::expression(const std::vector<Token>& code, int pcStart) { |
140 | > | OOPSEBitSet bs; |
141 | > | std::stack<OOPSEBitSet> stack; |
142 | ||
143 | for (int pc = pcStart; pc < code.size(); ++pc) { | |
144 | Token instruction = code[pc]; | |
# | Line 149 | Line 149 | namespace oopse { | |
149 | case Token::expressionEnd: | |
150 | break; | |
151 | case Token::all: | |
152 | < | bs = BitSet(nStuntDouble); |
152 | > | bs = OOPSEBitSet(nStuntDouble); |
153 | bs.setAll(); | |
154 | stack.push(bs); | |
155 | break; | |
156 | case Token::none: | |
157 | < | bs = BitSet(nStuntDouble); |
157 | > | bs = OOPSEBitSet(nStuntDouble); |
158 | stack.push(bs); | |
159 | break; | |
160 | case Token::opOr: | |
# | Line 206 | Line 206 | namespace oopse { | |
206 | ||
207 | ||
208 | ||
209 | < | BitSet SelectionEvaluator::comparatorInstruction(const Token& instruction) { |
209 | > | OOPSEBitSet SelectionEvaluator::comparatorInstruction(const Token& instruction) { |
210 | int comparator = instruction.tok; | |
211 | int property = instruction.intValue; | |
212 | float comparisonValue = boost::any_cast<float>(instruction.value); | |
213 | float propertyValue; | |
214 | < | BitSet bs(nStuntDouble); |
214 | > | OOPSEBitSet bs(nStuntDouble); |
215 | bs.clearAll(); | |
216 | ||
217 | SimInfo::MoleculeIterator mi; | |
# | Line 235 | Line 235 | namespace oopse { | |
235 | return bs; | |
236 | } | |
237 | ||
238 | < | void SelectionEvaluator::compareProperty(StuntDouble* sd, BitSet& bs, int property, int comparator, float comparisonValue) { |
239 | < | double propertyValue = 0.0; |
238 | > | void SelectionEvaluator::compareProperty(StuntDouble* sd, OOPSEBitSet& bs, int property, int comparator, float comparisonValue) { |
239 | > | RealType propertyValue = 0.0; |
240 | switch (property) { | |
241 | case Token::mass: | |
242 | propertyValue = sd->getMass(); | |
# | Line 254 | Line 254 | namespace oopse { | |
254 | } | |
255 | } | |
256 | break; | |
257 | + | case Token::x: |
258 | + | propertyValue = sd->getPos().x(); |
259 | + | break; |
260 | + | case Token::y: |
261 | + | propertyValue = sd->getPos().y(); |
262 | + | break; |
263 | + | case Token::z: |
264 | + | propertyValue = sd->getPos().z(); |
265 | + | break; |
266 | default: | |
267 | unrecognizedAtomProperty(property); | |
268 | } | |
# | Line 284 | Line 293 | namespace oopse { | |
293 | ||
294 | } | |
295 | ||
296 | < | void SelectionEvaluator::withinInstruction(const Token& instruction, BitSet& bs){ |
296 | > | void SelectionEvaluator::withinInstruction(const Token& instruction, OOPSEBitSet& bs){ |
297 | ||
298 | boost::any withinSpec = instruction.value; | |
299 | float distance; | |
# | Line 341 | Line 350 | namespace oopse { | |
350 | ||
351 | } | |
352 | ||
353 | < | void SelectionEvaluator::select(BitSet& bs){ |
353 | > | void SelectionEvaluator::select(OOPSEBitSet& bs){ |
354 | bs = expression(statement, 1); | |
355 | } | |
356 | ||
357 | < | BitSet SelectionEvaluator::lookupValue(const std::string& variable){ |
357 | > | OOPSEBitSet SelectionEvaluator::lookupValue(const std::string& variable){ |
358 | ||
359 | < | BitSet bs(nStuntDouble); |
359 | > | OOPSEBitSet bs(nStuntDouble); |
360 | std::map<std::string, boost::any>::iterator i = variables.find(variable); | |
361 | ||
362 | if (i != variables.end()) { | |
363 | < | if (i->second.type() == typeid(BitSet)) { |
364 | < | return boost::any_cast<BitSet>(i->second); |
363 | > | if (i->second.type() == typeid(OOPSEBitSet)) { |
364 | > | return boost::any_cast<OOPSEBitSet>(i->second); |
365 | } else if (i->second.type() == typeid(std::vector<Token>)){ | |
366 | bs = expression(boost::any_cast<std::vector<Token> >(i->second), 2); | |
367 | i->second = bs; /**@todo fixme */ | |
# | Line 365 | Line 374 | namespace oopse { | |
374 | return bs; | |
375 | } | |
376 | ||
377 | < | BitSet SelectionEvaluator::nameInstruction(const std::string& name){ |
377 | > | OOPSEBitSet SelectionEvaluator::nameInstruction(const std::string& name){ |
378 | ||
379 | return nameFinder.match(name); | |
380 | ||
# | Line 388 | Line 397 | namespace oopse { | |
397 | //predefine(); | |
398 | } | |
399 | ||
400 | < | BitSet SelectionEvaluator::evaluate() { |
401 | < | BitSet bs(nStuntDouble); |
400 | > | OOPSEBitSet SelectionEvaluator::evaluate() { |
401 | > | OOPSEBitSet bs(nStuntDouble); |
402 | if (isLoaded_) { | |
403 | pc = 0; | |
404 | instructionDispatchLoop(bs); | |
# | Line 398 | Line 407 | namespace oopse { | |
407 | return bs; | |
408 | } | |
409 | ||
410 | < | BitSet SelectionEvaluator::indexInstruction(const boost::any& value) { |
411 | < | BitSet bs(nStuntDouble); |
410 | > | OOPSEBitSet SelectionEvaluator::indexInstruction(const boost::any& value) { |
411 | > | OOPSEBitSet bs(nStuntDouble); |
412 | ||
413 | if (value.type() == typeid(int)) { | |
414 | int index = boost::any_cast<int>(value); | |
# | Line 422 | Line 431 | namespace oopse { | |
431 | } | |
432 | ||
433 | ||
434 | < | double SelectionEvaluator::getCharge(Atom* atom) { |
435 | < | double charge =0.0; |
434 | > | RealType SelectionEvaluator::getCharge(Atom* atom) { |
435 | > | RealType charge =0.0; |
436 | AtomType* atomType = atom->getAtomType(); | |
437 | if (atomType->isCharge()) { | |
438 | GenericData* data = atomType->getPropertyByName("Charge"); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |