| 48 |
|
#include <fstream> |
| 49 |
|
|
| 50 |
|
#include "brains/SimInfo.hpp" |
| 51 |
< |
#include "selection/Token.hpp" |
| 51 |
> |
#include "selection/SelectionToken.hpp" |
| 52 |
|
#include "selection/SelectionCompiler.hpp" |
| 53 |
|
#include "selection/NameFinder.hpp" |
| 54 |
|
#include "selection/DistanceFinder.hpp" |
| 55 |
|
#include "selection/IndexFinder.hpp" |
| 56 |
< |
#include "utils/BitSet.hpp" |
| 56 |
> |
#include "utils/OOPSEBitSet.hpp" |
| 57 |
|
#include "primitives/StuntDouble.hpp" |
| 58 |
|
#include "utils/StringUtils.hpp" |
| 59 |
|
namespace oopse { |
| 61 |
|
|
| 62 |
|
/** |
| 63 |
|
* @class SelectionEvaluator SelectionEvaluator.hpp "selection/SelectionEvaluator" |
| 64 |
< |
* @brief Evalute the tokens compiled by SelectionCompiler and return a BitSet |
| 64 |
> |
* @brief Evalute the tokens compiled by SelectionCompiler and return a OOPSEBitSet |
| 65 |
|
*/ |
| 66 |
|
class SelectionEvaluator{ |
| 67 |
|
public: |
| 72 |
|
bool loadScriptString(const std::string& script); |
| 73 |
|
bool loadScriptFile(const std::string& filename); |
| 74 |
|
|
| 75 |
< |
BitSet evaluate(); |
| 75 |
> |
OOPSEBitSet evaluate(); |
| 76 |
|
|
| 77 |
|
/** |
| 78 |
|
* Tests if the result from evaluation of script is dynamic. |
| 116 |
|
void clearDefinitionsAndLoadPredefined(); |
| 117 |
|
|
| 118 |
|
void define(); |
| 119 |
< |
void select(BitSet& bs); |
| 119 |
> |
void select(OOPSEBitSet& bs); |
| 120 |
|
void predefine(const std::string& script); |
| 121 |
|
|
| 122 |
< |
void instructionDispatchLoop(BitSet& bs); |
| 122 |
> |
void instructionDispatchLoop(OOPSEBitSet& bs); |
| 123 |
|
|
| 124 |
< |
void withinInstruction(const Token& instruction, BitSet& bs); |
| 124 |
> |
void withinInstruction(const Token& instruction, OOPSEBitSet& bs); |
| 125 |
|
|
| 126 |
< |
BitSet comparatorInstruction(const Token& instruction); |
| 127 |
< |
void compareProperty(StuntDouble* sd, BitSet& bs, int property, int comparator, float comparisonValue); |
| 128 |
< |
BitSet nameInstruction(const std::string& name); |
| 129 |
< |
BitSet indexInstruction(const boost::any& value); |
| 130 |
< |
BitSet expression(const std::vector<Token>& tokens, int pc); |
| 126 |
> |
OOPSEBitSet comparatorInstruction(const Token& instruction); |
| 127 |
> |
void compareProperty(StuntDouble* sd, OOPSEBitSet& bs, int property, int comparator, float comparisonValue); |
| 128 |
> |
OOPSEBitSet nameInstruction(const std::string& name); |
| 129 |
> |
OOPSEBitSet indexInstruction(const boost::any& value); |
| 130 |
> |
OOPSEBitSet expression(const std::vector<Token>& tokens, int pc); |
| 131 |
|
|
| 132 |
< |
BitSet lookupValue(const std::string& variable); |
| 132 |
> |
OOPSEBitSet lookupValue(const std::string& variable); |
| 133 |
|
|
| 134 |
|
void evalError(const std::string& message) { |
| 135 |
|
std::cerr << "SelectionEvaulator Error: " << message << std::endl; |
| 162 |
|
|
| 163 |
|
bool containDynamicToken(const std::vector<Token>& tokens); |
| 164 |
|
|
| 165 |
< |
double getCharge(Atom* atom); |
| 165 |
> |
RealType getCharge(Atom* atom); |
| 166 |
|
|
| 167 |
|
SelectionCompiler compiler; |
| 168 |
|
|