QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RPattern.h
Go to the documentation of this file.
1
20#ifndef RPATTERN_H
21#define RPATTERN_H
22
23#include "core_global.h"
24
25#include <QString>
26
27#include "RPatternLine.h"
28
29
39public:
40 static QList<QPair<QString, RPattern*> > loadAllFrom(const QString& fileName);
41
42 RPattern();
43 RPattern(const QString& name, const QString& description);
44 ~RPattern();
45
46 bool isValid() const {
47 return !fileName.isEmpty();
48 }
49
50 bool hasDots() const;
51
52 void clear() {
53 fileName.clear();
54 name.clear();
55 description.clear();
56 patternLines.clear();
57 }
58
60 QString getFileName() const {
61 return fileName;
62 }
63
65 const QString getName() const {
66 return name;
67 }
68
70 const QString getDescription() const {
71 return description;
72 }
73
77 bool isLoaded() const {
78 return true;
79 }
80
81 void load() const { }
82
83 QList<RPatternLine> getPatternLines() const {
84 return patternLines;
85 }
86
87 void addPatternLine(const RPatternLine& patternLine) {
88 patternLines.append(patternLine);
89 }
90
91 void scale(double f);
92 void rotate(double a);
93
94private:
96 QString fileName;
97
99 QString name;
100
102 QString description;
103
105 QList<RPatternLine> patternLines;
106};
107
108QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RPattern& p);
109
112
113#endif
Q_DECLARE_METATYPE(RMath *)
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RPattern &p)
Stream operator for QDebug.
Definition RPattern.cpp:170
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPattern.h:38
QString name
Pattern name.
Definition RPattern.h:99
void addPatternLine(const RPatternLine &patternLine)
Definition RPattern.h:87
QList< RPatternLine > patternLines
List of pattern line definitions.
Definition RPattern.h:105
bool isValid() const
Definition RPattern.h:46
QString getFileName() const
Definition RPattern.h:60
const QString getName() const
Definition RPattern.h:65
void load() const
Definition RPattern.h:81
void clear()
Definition RPattern.h:52
QList< RPatternLine > getPatternLines() const
Definition RPattern.h:83
const QString getDescription() const
Definition RPattern.h:70
QString description
Pattern description.
Definition RPattern.h:102
QString fileName
Pattern file name.
Definition RPattern.h:96
bool isLoaded() const
Definition RPattern.h:77
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPatternLine.h:38
#define QCADCORE_EXPORT
Definition core_global.h:10
void rotate(void e, void angle, void center)
Rotates the given entity or shape by the given angle around the given center.
Definition simple_modify.js:109
void scale(void e, void factor, void focusPoint)
Scales the given entity or shape by the given factor with the given focus point.
Definition simple_modify.js:15