QElectroTech  0.70
createdxf.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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&,double,double,double,int);
35  static void drawArc(const QString&,double x,double y,double rad,double startAngle,double endAngle,int color);
36  static void drawDonut(QString,double,double,double,int);
37 
38  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);
39 
40  static void drawEllipse (const QString &filepath, const QRectF &rect, const int &colorcode);
41 
42  static void drawRectangle(const QString &filepath,double,double,double,double,const int &colorcode);
43  static void drawRectangle(const QString &filepath, const QRectF &rect, const int &colorcode);
44 
45  static void drawLine(const QString &filapath,double,double,double,double, const int &clorcode);
46  static void drawLine(const QString &filepath, const QLineF &line,const int &colorcode);
47 
48  static void drawText(const QString&,const QString&,double,double,double,double,int);
49  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, int colour, bool leftAlign = false, float scale = 0);
50 
51 
52  static int getcolorCode (const long red, const long green, const long blue);
53  static long RGBcodeTable[];
54 
55  static const double sheetWidth;
56  static const double sheetHeight;
57  static double xScale;
58  static double yScale;
59 };
60 
61 #endif // CREATEDXF_H
static long RGBcodeTable[]
Definition: createdxf.h:53
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
static void dxfEnd(const QString &)
Definition: createdxf.cpp:232
static void drawArc(const QString &, double x, double y, double rad, double startAngle, double endAngle, int color)
Definition: createdxf.cpp:671
static void drawRectangle(const QString &filepath, double, double, double, double, const int &colorcode)
Definition: createdxf.cpp:565
static void drawText(const QString &, const QString &, double, double, double, double, int)
Definition: createdxf.cpp:708
static const double sheetHeight
Definition: createdxf.h:56
static void drawDonut(QString, double, double, double, int)
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
static double yScale
Definition: createdxf.h:58
static double xScale
Definition: createdxf.h:57
static const double sheetWidth
Definition: createdxf.h:55
static void drawCircle(const QString &, double, double, double, int)
Definition: createdxf.cpp:256
static void drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode)
Createdxf::drawEllipse Conveniance function for draw ellipse.
Definition: createdxf.cpp:556
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, int colour, bool leftAlign=false, float scale=0)
Definition: createdxf.cpp:747
static void drawLine(const QString &filapath, double, double, double, double, const int &clorcode)
Definition: createdxf.cpp:290
static void dxfBegin(const QString &)
Definition: createdxf.cpp:42