--- trunk/src/selection/NameFinder.hpp 2005/02/03 23:14:05 283 +++ trunk/src/selection/NameFinder.hpp 2005/02/04 04:57:04 284 @@ -42,36 +42,39 @@ #define SELECTION_NAMEFINDER_HPP #include #include +#include #include "utils/BitSet.hpp" namespace oopse { -enum NameNodeType { - rootNode, - molNode, - atomNode, - rbNode, - rbAtomNode, +class TreeNode{ + public: + ~TreeNode(); + std::string name; + BitSet bs; + std::map children; }; -struct NameNode{ - std::string name; - BitSet bs; - std::vector children; - NameNodeType type; -}; - class NameFinder{ public: NameFinder(SimInfo* info); + ~NameFinder(); bool match(const std::string& name, BitSet& bs); private: void loadNames(); - SimInfo* info_; + void matchMolecule(const std::string& molName, BitSet& bs); + void matchStuntDouble(const std::string& molName, const std::string& sdName, BitSet& bs); + void matchRigidAtoms(const std::string& molName, const std::string& rbName, const std::string& rbAtomName, BitSet& bs); - NameNode* root_; + std::vector getMatchedChildren(TreeNode* node, const std::string& name); + bool isMatched(const std::string& str, const std::string& wildcard); + + SimInfo* info_; + int nStuntDouble_; + TreeNode* root_; }; + } #endif