src/primitives.h

changeset 1217
314e12e23c3a
parent 1010
969b48eddd6b
child 1222
34def2630300
equal deleted inserted replaced
1216:12f9ea615cbc 1217:314e12e23c3a
51 }; 51 };
52 52
53 QList<RegexEntry> regexes; 53 QList<RegexEntry> regexes;
54 QList<Primitive> prims; 54 QList<Primitive> prims;
55 55
56 explicit PrimitiveCategory (QString name, QObject* parent = 0); 56 explicit PrimitiveCategory(QString name, QObject* parent = 0);
57 bool isValidToInclude(); 57 bool isValidToInclude();
58 QString name() const; 58 QString name() const;
59 59
60 static void loadCategories(); 60 static void loadCategories();
61 static void populateCategories(); 61 static void populateCategories();
71 class PrimitiveScanner : public QObject 71 class PrimitiveScanner : public QObject
72 { 72 {
73 Q_OBJECT 73 Q_OBJECT
74 74
75 public: 75 public:
76 explicit PrimitiveScanner (QObject* parent = 0); 76 explicit PrimitiveScanner(QObject* parent = 0);
77 virtual ~PrimitiveScanner(); 77 virtual ~PrimitiveScanner();
78 static void start(); 78 static void start();
79 79
80 public slots: 80 public slots:
81 void work(); 81 void work();
82 82
83 signals: 83 signals:
84 void starting (int num); 84 void starting(int num);
85 void workDone(); 85 void workDone();
86 void update (int i); 86 void update(int i);
87 87
88 private: 88 private:
89 QList<Primitive> m_prims; 89 QList<Primitive> m_prims;
90 QStringList m_files; 90 QStringList m_files;
91 int m_i; 91 int m_i;
110 class PrimitivePrompt : public QDialog 110 class PrimitivePrompt : public QDialog
111 { 111 {
112 Q_OBJECT 112 Q_OBJECT
113 113
114 public: 114 public:
115 explicit PrimitivePrompt (QWidget* parent = nullptr, Qt::WindowFlags f = 0); 115 explicit PrimitivePrompt(QWidget* parent = nullptr, Qt::WindowFlags f = 0);
116 virtual ~PrimitivePrompt(); 116 virtual ~PrimitivePrompt();
117 Ui_MakePrimUI* ui; 117 Ui_MakePrimUI* ui;
118 118
119 public slots: 119 public slots:
120 void hiResToggled (bool on); 120 void hiResToggled(bool on);
121 }; 121 };
122 122
123 void MakeCircle (int segs, int divs, double radius, QList<QLineF>& lines); 123 void MakeCircle(int segs, int divs, double radius, QList<QLineF>& lines);
124 LDDocument* GeneratePrimitive (PrimitiveType type, int segs, int divs, int num); 124 LDDocument* GeneratePrimitive(PrimitiveType type, int segs, int divs, int num);
125 125
126 // Gets a primitive by the given specs. If the primitive cannot be found, it will 126 // Gets a primitive by the given specs. If the primitive cannot be found, it will
127 // be automatically generated. 127 // be automatically generated.
128 LDDocument* GetPrimitive (PrimitiveType type, int segs, int divs, int num); 128 LDDocument* GetPrimitive(PrimitiveType type, int segs, int divs, int num);
129 129
130 QString MakeRadialFileName (PrimitiveType type, int segs, int divs, int num); 130 QString MakeRadialFileName(PrimitiveType type, int segs, int divs, int num);

mercurial