QElectroTech  0.8-dev
createdxf.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef CREATEDXF_H
19 #define CREATEDXF_H
20 #include <QString>
21 #include <QtCore>
22 #include <QtWidgets>
23 
24 
25 /* This class exports the project to DXF Format */
26 class Createdxf
27 {
28  public:
29  Createdxf();
30  ~Createdxf();
31  static void dxfBegin (const QString&);
32  static void dxfEnd(const QString&);
33  // you can add more functions to create more drawings.
34  static void drawCircle(const QString&,
35  double,
36  double,
37  double,
38  int);
39  static void drawArc(const QString&,
40  double x,
41  double y,
42  double rad,
43  double startAngle,
44  double endAngle,
45  int color);
46  static void drawDonut(QString,double,double,double,int);
47 
48  static void drawArcEllipse (const QString &file_path,
49  qreal x,
50  qreal y,
51  qreal w,
52  qreal h,
53  qreal startAngle,
54  qreal spanAngle,
55  qreal hotspot_x,
56  qreal hotspot_y,
57  qreal rotation_angle,
58  const int &colorcode);
59 
60  static void drawEllipse (const QString &filepath,
61  const QRectF &rect,
62  const int &colorcode);
63 
64  static void drawRectangle(const QString &filepath,
65  double,
66  double,
67  double,
68  double,
69  const int &colorcode);
70  static void drawRectangle(const QString &filepath,
71  const QRectF &rect,
72  const int &colorcode);
73 
74  static void drawLine(const QString &filapath,
75  double,
76  double,
77  double,
78  double,
79  const int &clorcode);
80  static void drawLine(const QString &filepath,
81  const QLineF &line,
82  const int &colorcode);
83 
84  static void drawText(const QString&,
85  const QString&,
86  double,double,
87  double,
88  double,
89  int);
90  static void drawTextAligned(const QString& fileName,
91  const QString& text,
92  double x,
93  double y,
94  double height,
95  double rotation,
96  double oblique,
97  int hAlign,
98  int vAlign,
99  double xAlign,
100  double xScale,
101  int colour,
102  bool leftAlign = false,
103  float scale = 0);
104 
105 
106  static int getcolorCode (const long red,
107  const long green,
108  const long blue);
109  static long RGBcodeTable[];
110 
111  static const double sheetWidth;
112  static const double sheetHeight;
113  static double xScale;
114  static double yScale;
115 };
116 
117 #endif // CREATEDXF_H
Createdxf::sheetHeight
static const double sheetHeight
Definition: createdxf.h:112
Createdxf::yScale
static double yScale
Definition: createdxf.h:114
exportdialog.h
Createdxf
Definition: createdxf.h:27
Createdxf::dxfBegin
static void dxfBegin(const QString &)
Definition: createdxf.cpp:42
Createdxf::dxfEnd
static void dxfEnd(const QString &)
Definition: createdxf.cpp:232
Createdxf::RGBcodeTable
static long RGBcodeTable[]
Definition: createdxf.h:109
Createdxf::getcolorCode
static int getcolorCode(const long red, const long green, const long blue)
Createdxf::getcolorCode This function returns the ACI color which is the "nearest" color to the color...
Definition: createdxf.cpp:389
Createdxf::drawLine
static void drawLine(const QString &filapath, double, double, double, double, const int &clorcode)
Definition: createdxf.cpp:290
Createdxf::drawCircle
static void drawCircle(const QString &, double, double, double, int)
Definition: createdxf.cpp:256
Createdxf::drawRectangle
static void drawRectangle(const QString &filepath, double, double, double, double, const int &colorcode)
Definition: createdxf.cpp:565
Createdxf::drawText
static void drawText(const QString &, const QString &, double, double, double, double, int)
Createdxf::drawText draw simple text in dxf format without any alignment specified.
Definition: createdxf.cpp:736
Createdxf::xScale
static double xScale
Definition: createdxf.h:113
Createdxf::drawArc
static void drawArc(const QString &, double x, double y, double rad, double startAngle, double endAngle, int color)
Createdxf::drawArc draw arc in dx format.
Definition: createdxf.cpp:683
Createdxf::sheetWidth
static const double sheetWidth
Definition: createdxf.h:111
Createdxf::drawEllipse
static void drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode)
Createdxf::drawEllipse Conveniance function for draw ellipse.
Definition: createdxf.cpp:556
Createdxf::drawArcEllipse
static void drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal spanAngle, qreal hotspot_x, qreal hotspot_y, qreal rotation_angle, const int &colorcode)
Definition: createdxf.cpp:426
Createdxf::drawTextAligned
static void drawTextAligned(const QString &fileName, const QString &text, double x, double y, double height, double rotation, double oblique, int hAlign, int vAlign, double xAlign, double xScale, int colour, bool leftAlign=false, float scale=0)
Definition: createdxf.cpp:781
Createdxf::Createdxf
Createdxf()
Definition: createdxf.cpp:32
createdxf.h
Createdxf::~Createdxf
~Createdxf()
Definition: createdxf.cpp:37
Createdxf::drawDonut
static void drawDonut(QString, double, double, double, int)
ExportDialog::rotation_transformed
static QPointF rotation_transformed(qreal, qreal, qreal, qreal, qreal)
Definition: exportdialog.cpp:668