1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#pragma once
#include "Rule.h"
#include "CustomRule.h"
namespace StructureSynth {
namespace Model {
/// Container for all rules.
class RuleSet {
public:
/// Constructor. Automatically adds built-in rules.
RuleSet();
/// Deletes rules
~RuleSet();
/// Added rules belong to the RuleSet and will be deleted by the RuleSet destructor.
void addRule(Rule* rule);
/// Resolve symbolic names into pointers
/// Returns a list of the primitives used
QStringList resolveNames();
/// TODO: Implement
QStringList getUnreferencedNames();
Rule* getStartRule() const ;
CustomRule* getTopLevelRule() const { return topLevelRule; }
/// For debug
void dumpInfo() const;
void setRecurseDepthFirst(bool value) { recurseDepth = value; };
bool recurseDepthFirst() { return recurseDepth; }
void setRulesMaxDepth(int maxDepth);
private:
QList<Rule*> rules;
CustomRule* topLevelRule;
bool recurseDepth;
};
}
}
|