mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-29 05:44:14 +02:00
4278ef864e
qelectrotech --export-dxf <project.qet> <output_dir> [--show-terminals] writes one DXF per folio, named <NN>_<title>.dxf like the PNG and SVG exports. Discussion #1072. The DXF code moves out of ExportDialog into DxfExport, unchanged except that its options come from an ExportProperties argument instead of the dialog. The dialog and the command line both call it, and the command line uses the dialog's default options (the preferences' export settings), so both write the same entities. - Createdxf answers a file it cannot open with a message box and exit(0); the command line checks the file first and fails with a message and exit code 1 instead. - A note is printed when pictures become outline boxes, as the dialog warns. - Scripting: qet.exportDxf(outDir, showTerminals). MCP: format "dxf". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2d2Zi8BfrYRPX88zhaoFG
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
/*
|
|
Copyright 2006-2026 The QElectroTech Team
|
|
This file is part of QElectroTech.
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef DXFEXPORT_H
|
|
#define DXFEXPORT_H
|
|
|
|
#include <QPointF>
|
|
#include <QSize>
|
|
#include <QString>
|
|
|
|
class Diagram;
|
|
class ExportProperties;
|
|
|
|
/**
|
|
Writes a folio as a DXF file. Used by the export dialog and by
|
|
--export-dxf (discussion #1072), so both write the same file for the
|
|
same options.
|
|
*/
|
|
namespace DxfExport
|
|
{
|
|
QSize folioSize(Diagram *diagram, const ExportProperties &properties);
|
|
void write(Diagram *diagram, int width, int height,
|
|
const QString &path, const ExportProperties &properties);
|
|
QPointF rotation_transformed(qreal px, qreal py,
|
|
qreal origin_x, qreal origin_y, qreal angle);
|
|
}
|
|
|
|
#endif // DXFEXPORT_H
|