5
namespace StructureSynth {
8
/// These are the built-in primitives,
9
/// for drawing boxes, spheres and other simple geometric shapes.
10
class PrimitiveRule : public Rule {
12
enum PrimitiveType { Box, Sphere, Dot, Grid, Cylinder, Line, Mesh, Other } ;
14
PrimitiveRule(PrimitiveType type);
15
virtual void apply(Builder* builder) const;
17
/// Returns a list over rules that this rule references.
18
/// (Empty for all PrimitiveRules!)
19
virtual QList<RuleRef*> getRuleRefs() const { return QList<RuleRef*>(); }
21
/// 'class' is an identifier used for distinguishing between
22
/// different forms of the the same PrimiteType.
23
/// This is used together with Template Renderers.
25
/// For instance 'box::metal' will be parsed in to a 'box' primitive with a 'metal' class identifier.
26
void setClass(QString classID) { this->classID = classID; }
27
QString getClass() { return classID; }
35
/// Triangle rules are special, since they have explicit coordinate representation.
36
class TriangleRule : public PrimitiveRule {
39
TriangleRule(SyntopiaCore::Math::Vector3f p1,
40
SyntopiaCore::Math::Vector3f p2,
41
SyntopiaCore::Math::Vector3f p3);
43
virtual void apply(Builder* builder) const;
46
SyntopiaCore::Math::Vector3f p1;
47
SyntopiaCore::Math::Vector3f p2;
48
SyntopiaCore::Math::Vector3f p3;