QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
createdxf.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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
29{
30 public:
31 Createdxf();
32 ~Createdxf();
33 static void dxfBegin (const QString&);
34 static void dxfEnd(const QString&);
35 // you can add more functions to create more drawings.
36 static void drawCircle(
37 const QString&,
38 double,
39 double,
40 double,
41 int);
42
43 static void drawCircle(
44 const QString& ,
45 QPointF,
46 double,
47 int );
48
49 static void drawArc(
50 const QString&,
51 double x,
52 double y,
53 double rad,
54 double startAngle,
55 double endAngle,
56 int color);
57 static void drawDonut(QString,double,double,double,int);
58
59 static void drawArcEllipse (
60 const QString &file_path,
61 qreal x,
62 qreal y,
63 qreal w,
64 qreal h,
65 qreal startAngle,
66 qreal spanAngle,
67 qreal hotspot_x,
68 qreal hotspot_y,
69 qreal rotation_angle,
70 const int &colorcode);
71
72 static void drawArcEllipse(
73 const QString &file_path,
74 QRectF rect,
75 qreal startAngle,
76 qreal spanAngle,
77 QPointF hotspot,
78 qreal rotation_angle,
79 const int &colorcode);
80
81 static void drawEllipse (const QString &filepath,
82 const QRectF &rect,
83 const int &colorcode);
84
85 static void drawRectangle(
86 const QString &filepath,
87 double,
88 double,
89 double,
90 double,
91 const int &colorcode);
92 static void drawRectangle(
93 const QString &filepath,
94 const QRectF &rect,
95 const int &colorcode);
96
97 static void drawPolygon(
98 const QString &filepath,
99 const QPolygonF &poly,
100 const int &colorcode);
101
102 static void drawLine(
103 const QString &filapath,
104 double,
105 double,
106 double,
107 double,
108 const int &clorcode);
109 static void drawLine(
110 const QString &filepath,
111 const QLineF &line,
112 const int &colorcode);
113
114 static void drawText(
115 const QString&,
116 const QString&,
117 double,double,
118 double,
119 double,
120 int,
121 double xScale=1.0);
122 static void drawText(
123 const QString&,
124 const QString&,
125 QPointF,
126 double,
127 double,
128 int,
129 double xScale=1.0);
130 static void drawTextAligned(
131 const QString& fileName,
132 const QString& text,
133 double x,
134 double y,
135 double height,
136 double rotation,
137 double oblique,
138 int hAlign,
139 int vAlign,
140 double xAlign,
141 double xScale,
142 int colour);
143
144 static void drawPolyline(
145 const QString &filepath,
146 const QPolygonF &poly,
147 const int &colorcode,
148 bool preScaled = false);
149
150 static int getcolorCode (
151 const long red,
152 const long green,
153 const long blue);
154 static long RGBcodeTable[];
155 static int dxfColor(QColor color);
156 static int dxfColor(QPen pen);
157
158 static const double sheetWidth;
159 static const double sheetHeight;
160 static double xScale;
161 static double yScale;
162};
163
164#endif // CREATEDXF_H
The Createdxf class This class exports the project to DXF Format.
Definition createdxf.h:29
static const double sheetWidth
Definition createdxf.h:158
static void drawLine(const QString &filapath, double, double, double, double, const int &clorcode)
Createdxf::drawLine draw line in DXF Format.
Definition createdxf.cpp:313
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:637
static int dxfColor(QColor color)
Definition createdxf.cpp:441
static void dxfEnd(const QString &)
Createdxf::dxfEnd End Section of every DXF File.
Definition createdxf.cpp:235
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:419
~Createdxf()
Definition createdxf.cpp:36
Createdxf()
Definition createdxf.cpp:32
static void drawPolyline(const QString &filepath, const QPolygonF &poly, const int &colorcode, bool preScaled=false)
Createdxf::drawPolyline Convenience function for draw polyline.
Definition createdxf.cpp:831
static double xScale
Definition createdxf.h:160
static void dxfBegin(const QString &)
Definition createdxf.cpp:41
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)
Definition createdxf.cpp:741
static void drawText(const QString &, const QString &, double, double, double, double, int, double xScale=1.0)
Createdxf::drawText draw simple text in dxf format without any alignment specified.
Definition createdxf.cpp:692
static void drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode)
Createdxf::drawEllipse Conveniance function for draw ellipse.
Definition createdxf.cpp:949
static void drawRectangle(const QString &filepath, double, double, double, double, const int &colorcode)
Createdxf::drawRectangle draw rectangle in dxf format.
Definition createdxf.cpp:608
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:449
static void drawDonut(QString, double, double, double, int)
static long RGBcodeTable[]
Definition createdxf.h:356
static void drawPolygon(const QString &filepath, const QPolygonF &poly, const int &colorcode)
Createdxf::drawPolygon Convenience function for draw polygon.
Definition createdxf.cpp:986
static double yScale
Definition createdxf.h:161
static const double sheetHeight
Definition createdxf.h:159
static void drawCircle(const QString &, double, double, double, int)
Createdxf::drawCircle draw circle in dxf format.
Definition createdxf.cpp:266