QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLinetypePattern.h
Go to the documentation of this file.
1 
20 #ifndef RLINETYPEPATTERN_H
21 #define RLINETYPEPATTERN_H
22 
23 #include "core_global.h"
24 
25 #include <stdarg.h>
26 #include <math.h>
27 
28 #include <QMetaType>
29 #include <QString>
30 #include <QList>
31 #include <QVector>
32 
33 
34 
43 public:
47  RLinetypePattern(const QString& name, int num...);
48  void set(const QList<double> dashes);
49 
51  RLinetypePattern(const QString& name);
52  RLinetypePattern(const RLinetypePattern& other);
53  ~RLinetypePattern();
54 
55  bool isValid() const;
56  int getNumDashes() const;
57  double getPatternLength() const;
58  double getDashLengthAt(int i) const;
59  double getLargestGap() const;
60  bool hasDashAt(double pos) const;
61  double getDelta(double pos) const;
62  bool isSymmetrical(int i) const;
63  void scale(double factor);
64 
65  QVector<qreal> getScreenBasedLinetype();
66 
67  RLinetypePattern& operator=(const RLinetypePattern& other);
68  bool operator==(const RLinetypePattern& other) const;
69 
70 private:
71  QString name;
72  int num;
73  double* pattern;
74  bool* symmetrical;
75 };
76 
77 QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RLinetypePattern& p);
78 
83 Q_DECLARE_METATYPE(_RMapQStringRLinetypePattern*)
84 Q_DECLARE_METATYPE(_RMapQStringRLinetypePattern)
85 
86 #endif