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 <QVector>
30 
31 
32 
41 public:
45  RLinetypePattern(const QString& name, int num...);
46  void set(const QList<double> dashes);
47 
49  RLinetypePattern(const QString& name);
50  RLinetypePattern(const RLinetypePattern& other);
51  ~RLinetypePattern();
52 
53  bool isValid() const;
54  int getNumDashes() const;
55  double getPatternLength() const;
56  double getDashLengthAt(int i) const;
57  double getLargestGap() const;
58  bool hasDashAt(double pos) const;
59  double getDelta(double pos) const;
60  bool isSymmetrical(int i) const;
61  void scale(double factor);
62 
63  QVector<qreal> getScreenBasedLinetype();
64 
65  RLinetypePattern& operator=(const RLinetypePattern& other);
66  bool operator==(const RLinetypePattern& other) const;
67 
68 private:
69  QString name;
70  int num;
71  double* pattern;
72  bool* symmetrical;
73 };
74 
75 QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RLinetypePattern& p);
76 
81 Q_DECLARE_METATYPE(_RMapQStringRLinetypePattern*)
82 Q_DECLARE_METATYPE(_RMapQStringRLinetypePattern)
83 
84 #endif