mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-19 15:24:03 +02:00
Compare commits
5 commits
64acbfff4c
...
872e50814d
Author | SHA1 | Date | |
---|---|---|---|
872e50814d | |||
c88da992a0 | |||
7dd8aa0058 | |||
cb9f029c0f | |||
a2b701f083 |
|
@ -22,6 +22,7 @@
|
||||||
- Fix seam allowance. Loose requirements to case with prong.
|
- Fix seam allowance. Loose requirements to case with prong.
|
||||||
- Fix list of dimension popup list. Make sure it will always has enough space for values.
|
- Fix list of dimension popup list. Make sure it will always has enough space for values.
|
||||||
- New grainline type: Four way.
|
- New grainline type: Four way.
|
||||||
|
- [smart-pattern/valentina#163] Show/hide grainline when export.
|
||||||
|
|
||||||
# Valentina 0.7.52 September 12, 2022
|
# Valentina 0.7.52 September 12, 2022
|
||||||
- Fix crash when default locale is ru.
|
- Fix crash when default locale is ru.
|
||||||
|
|
28
dist/OBS_debian/debian.puzzle.1
vendored
28
dist/OBS_debian/debian.puzzle.1
vendored
|
@ -1,6 +1,6 @@
|
||||||
.\" Manpage for puzzle
|
.\" Manpage for puzzle
|
||||||
.\" Contact dismine@gmail.com to correct errors.
|
.\" Contact dismine@gmail.com to correct errors.
|
||||||
.TH puzzle 1 "23 March, 2020" "puzzle man page"
|
.TH puzzle 1 "10 April, 2023" "puzzle man page"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Puzzle \- Valentina's manual layout
|
Puzzle \- Valentina's manual layout
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -15,34 +15,8 @@ is a part of Valentina. And used for creating and editing manual layouts.
|
||||||
Displays this help.
|
Displays this help.
|
||||||
.IP "-v, --version"
|
.IP "-v, --version"
|
||||||
Displays version information.
|
Displays version information.
|
||||||
.IP "-e, --exportFile <The filename of layout file>"
|
|
||||||
The filename of exported layout file. Use it to enable console export mode.
|
|
||||||
.IP "-r, --rawLayout <The raw layout data file>"
|
.IP "-r, --rawLayout <The raw layout data file>"
|
||||||
Load pattern pieces form the raw layout data file.
|
Load pattern pieces form the raw layout data file.
|
||||||
.IP "-f, --format <Format number>"
|
|
||||||
Number corresponding to tiled pdf page template (default = 0, export mode with tiled pdf format): <not defined>
|
|
||||||
.IP "--bdxf"
|
|
||||||
Export dxf in binary form.
|
|
||||||
.IP "--text2paths"
|
|
||||||
Export text as paths.
|
|
||||||
.IP "-c, --crop"
|
|
||||||
Auto crop unused length (export mode).
|
|
||||||
.IP "--cropWidth"
|
|
||||||
Auto crop unused width (export mode).
|
|
||||||
.IP "--tiledPageformat <Template number>"
|
|
||||||
Number corresponding to tiled pdf page template (default = 0, export mode with tiled pdf format): <not defined>
|
|
||||||
.IP "--tiledlmargin <The left margin>"
|
|
||||||
Tiled page left margin in current units like 3.0 (export mode). If not set will be used default value 1 cm.
|
|
||||||
.IP "--tiledrmargin <The right margin>"
|
|
||||||
Tiled page right margin in current units like 3.0 (export mode). If not set will be used default value 1 cm.
|
|
||||||
.IP "--tiledtmargin <The top margin>"
|
|
||||||
Tiled page top margin in current units like 3.0 (export mode). If not set will be used value default value 1 cm.
|
|
||||||
.IP "--tiledbmargin <The bottom margin>"
|
|
||||||
Tiled page bottom margin in current units like 3.0 (export mode). If not set will be used value default value 1 cm.
|
|
||||||
.IP "--tiledLandscape"
|
|
||||||
Set tiled page orienatation to landscape (export mode). Default value if not set portrait.
|
|
||||||
.IP "-t, --test"
|
|
||||||
Run the program in a test mode. The program in this mode loads a single layout file and silently quit without showing the main window. The key have priority before key 'exportFile'.
|
|
||||||
.IP "--no-scaling"
|
.IP "--no-scaling"
|
||||||
Disable high dpi scaling. Call this option if has problem with scaling (by default scaling enabled). Alternatively you can use the QT_AUTO_SCREEN_SCALE_FACTOR=0 environment variable.
|
Disable high dpi scaling. Call this option if has problem with scaling (by default scaling enabled). Alternatively you can use the QT_AUTO_SCREEN_SCALE_FACTOR=0 environment variable.
|
||||||
.IP Arguments:
|
.IP Arguments:
|
||||||
|
|
4
dist/OBS_debian/debian.valentina.1
vendored
4
dist/OBS_debian/debian.valentina.1
vendored
|
@ -1,6 +1,6 @@
|
||||||
.\" Manpage for valentina.
|
.\" Manpage for valentina.
|
||||||
.\" Contact dismine@gmail.com to correct errors.
|
.\" Contact dismine@gmail.com to correct errors.
|
||||||
.TH valentina 1 "3 February, 2021" "valentina man page"
|
.TH valentina 1 "10 April, 2023" "valentina man page"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Valentina \- Pattern making program.
|
Valentina \- Pattern making program.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -136,6 +136,8 @@ The path to output destination folder. By default the directory at which the app
|
||||||
.RE
|
.RE
|
||||||
.IP "--bdxf"
|
.IP "--bdxf"
|
||||||
.RB "Export dxf in binary form."
|
.RB "Export dxf in binary form."
|
||||||
|
.IP "--noGrainline"
|
||||||
|
.RB "Show/hide grainline when export layout."
|
||||||
.IP "--text2paths"
|
.IP "--text2paths"
|
||||||
.RB "Export text as paths."
|
.RB "Export text as paths."
|
||||||
.IP "--exportOnlyDetails"
|
.IP "--exportOnlyDetails"
|
||||||
|
|
1
dist/OBS_debian/debian.valentina.install
vendored
1
dist/OBS_debian/debian.valentina.install
vendored
|
@ -16,3 +16,4 @@ usr/share/icons/hicolor/256x256/mimetypes/*
|
||||||
usr/share/icons/hicolor/512x512/apps/*
|
usr/share/icons/hicolor/512x512/apps/*
|
||||||
usr/share/icons/hicolor/512x512/mimetypes/*
|
usr/share/icons/hicolor/512x512/mimetypes/*
|
||||||
usr/share/applications/*
|
usr/share/applications/*
|
||||||
|
usr/share/metainfo/*
|
||||||
|
|
28
dist/debian/puzzle.1
vendored
28
dist/debian/puzzle.1
vendored
|
@ -1,6 +1,6 @@
|
||||||
.\" Manpage for puzzle
|
.\" Manpage for puzzle
|
||||||
.\" Contact dismine@gmail.com to correct errors.
|
.\" Contact dismine@gmail.com to correct errors.
|
||||||
.TH puzzle 1 "23 March, 2020" "puzzle man page"
|
.TH puzzle 1 "10 April, 2023" "puzzle man page"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Puzzle \- Valentina's manual layout
|
Puzzle \- Valentina's manual layout
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -15,34 +15,8 @@ is a part of Valentina. And used for creating and editing manual layouts.
|
||||||
Displays this help.
|
Displays this help.
|
||||||
.IP "-v, --version"
|
.IP "-v, --version"
|
||||||
Displays version information.
|
Displays version information.
|
||||||
.IP "-e, --exportFile <The filename of layout file>"
|
|
||||||
The filename of exported layout file. Use it to enable console export mode.
|
|
||||||
.IP "-r, --rawLayout <The raw layout data file>"
|
.IP "-r, --rawLayout <The raw layout data file>"
|
||||||
Load pattern pieces form the raw layout data file.
|
Load pattern pieces form the raw layout data file.
|
||||||
.IP "-f, --format <Format number>"
|
|
||||||
Number corresponding to tiled pdf page template (default = 0, export mode with tiled pdf format): <not defined>
|
|
||||||
.IP "--bdxf"
|
|
||||||
Export dxf in binary form.
|
|
||||||
.IP "--text2paths"
|
|
||||||
Export text as paths.
|
|
||||||
.IP "-c, --crop"
|
|
||||||
Auto crop unused length (export mode).
|
|
||||||
.IP "--cropWidth"
|
|
||||||
Auto crop unused width (export mode).
|
|
||||||
.IP "--tiledPageformat <Template number>"
|
|
||||||
Number corresponding to tiled pdf page template (default = 0, export mode with tiled pdf format): <not defined>
|
|
||||||
.IP "--tiledlmargin <The left margin>"
|
|
||||||
Tiled page left margin in current units like 3.0 (export mode). If not set will be used default value 1 cm.
|
|
||||||
.IP "--tiledrmargin <The right margin>"
|
|
||||||
Tiled page right margin in current units like 3.0 (export mode). If not set will be used default value 1 cm.
|
|
||||||
.IP "--tiledtmargin <The top margin>"
|
|
||||||
Tiled page top margin in current units like 3.0 (export mode). If not set will be used value default value 1 cm.
|
|
||||||
.IP "--tiledbmargin <The bottom margin>"
|
|
||||||
Tiled page bottom margin in current units like 3.0 (export mode). If not set will be used value default value 1 cm.
|
|
||||||
.IP "--tiledLandscape"
|
|
||||||
Set tiled page orienatation to landscape (export mode). Default value if not set portrait.
|
|
||||||
.IP "-t, --test"
|
|
||||||
Run the program in a test mode. The program in this mode loads a single layout file and silently quit without showing the main window. The key have priority before key 'exportFile'.
|
|
||||||
.IP "--no-scaling"
|
.IP "--no-scaling"
|
||||||
Disable high dpi scaling. Call this option if has problem with scaling (by default scaling enabled). Alternatively you can use the QT_AUTO_SCREEN_SCALE_FACTOR=0 environment variable.
|
Disable high dpi scaling. Call this option if has problem with scaling (by default scaling enabled). Alternatively you can use the QT_AUTO_SCREEN_SCALE_FACTOR=0 environment variable.
|
||||||
.IP Arguments:
|
.IP Arguments:
|
||||||
|
|
4
dist/debian/valentina.1
vendored
4
dist/debian/valentina.1
vendored
|
@ -1,6 +1,6 @@
|
||||||
.\" Manpage for valentina.
|
.\" Manpage for valentina.
|
||||||
.\" Contact dismine@gmail.com to correct errors.
|
.\" Contact dismine@gmail.com to correct errors.
|
||||||
.TH valentina 1 "3 February, 2021" "valentina man page"
|
.TH valentina 1 "10 April, 2023" "valentina man page"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Valentina \- Pattern making program.
|
Valentina \- Pattern making program.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -136,6 +136,8 @@ The path to output destination folder. By default the directory at which the app
|
||||||
.RE
|
.RE
|
||||||
.IP "--bdxf"
|
.IP "--bdxf"
|
||||||
.RB "Export dxf in binary form."
|
.RB "Export dxf in binary form."
|
||||||
|
.IP "--noGrainline"
|
||||||
|
.RB "Show/hide grainline when export layout."
|
||||||
.IP "--text2paths"
|
.IP "--text2paths"
|
||||||
.RB "Export text as paths."
|
.RB "Export text as paths."
|
||||||
.IP "--exportOnlyDetails"
|
.IP "--exportOnlyDetails"
|
||||||
|
|
|
@ -250,6 +250,62 @@ auto DialogSaveManualLayout::IsBinaryDXFFormat() const -> bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogSaveManualLayout::SetShowGrainline(bool show)
|
||||||
|
{
|
||||||
|
switch(Format())
|
||||||
|
{
|
||||||
|
case LayoutExportFormats::SVG:
|
||||||
|
case LayoutExportFormats::PDF:
|
||||||
|
case LayoutExportFormats::PNG:
|
||||||
|
case LayoutExportFormats::PS:
|
||||||
|
case LayoutExportFormats::EPS:
|
||||||
|
case LayoutExportFormats::PDFTiled:
|
||||||
|
case LayoutExportFormats::TIF:
|
||||||
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_Flat:
|
||||||
|
ui->checkBoxShowGrainline->setChecked(show);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ui->checkBoxShowGrainline->setChecked(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool DialogSaveManualLayout::IsShowGrainline() const
|
||||||
|
{
|
||||||
|
switch(Format())
|
||||||
|
{
|
||||||
|
case LayoutExportFormats::SVG:
|
||||||
|
case LayoutExportFormats::PDF:
|
||||||
|
case LayoutExportFormats::PNG:
|
||||||
|
case LayoutExportFormats::PS:
|
||||||
|
case LayoutExportFormats::EPS:
|
||||||
|
case LayoutExportFormats::PDFTiled:
|
||||||
|
case LayoutExportFormats::TIF:
|
||||||
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_Flat:
|
||||||
|
return ui->checkBoxShowGrainline->isChecked();
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSaveManualLayout::SetDestinationPath(const QString &cmdDestinationPath)
|
void DialogSaveManualLayout::SetDestinationPath(const QString &cmdDestinationPath)
|
||||||
{
|
{
|
||||||
|
@ -444,18 +500,10 @@ void DialogSaveManualLayout::ShowExample()
|
||||||
ui->checkBoxTextAsPaths->setEnabled(true);
|
ui->checkBoxTextAsPaths->setEnabled(true);
|
||||||
ui->checkBoxExportUnified->setEnabled(false);
|
ui->checkBoxExportUnified->setEnabled(false);
|
||||||
ui->checkBoxTilesScheme->setEnabled(false);
|
ui->checkBoxTilesScheme->setEnabled(false);
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(true);
|
||||||
|
|
||||||
switch(currentFormat)
|
switch(currentFormat)
|
||||||
{
|
{
|
||||||
case LayoutExportFormats::DXF_AC1006_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1009_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1012_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1014_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1015_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1018_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1021_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1024_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1027_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1006_AAMA:
|
case LayoutExportFormats::DXF_AC1006_AAMA:
|
||||||
case LayoutExportFormats::DXF_AC1009_AAMA:
|
case LayoutExportFormats::DXF_AC1009_AAMA:
|
||||||
case LayoutExportFormats::DXF_AC1012_AAMA:
|
case LayoutExportFormats::DXF_AC1012_AAMA:
|
||||||
|
@ -475,9 +523,11 @@ void DialogSaveManualLayout::ShowExample()
|
||||||
case LayoutExportFormats::DXF_AC1024_ASTM:
|
case LayoutExportFormats::DXF_AC1024_ASTM:
|
||||||
case LayoutExportFormats::DXF_AC1027_ASTM:
|
case LayoutExportFormats::DXF_AC1027_ASTM:
|
||||||
ui->checkBoxBinaryDXF->setEnabled(true);
|
ui->checkBoxBinaryDXF->setEnabled(true);
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::RLD:
|
case LayoutExportFormats::RLD:
|
||||||
ui->checkBoxTextAsPaths->setEnabled(false);
|
ui->checkBoxTextAsPaths->setEnabled(false);
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::PDFTiled:
|
case LayoutExportFormats::PDFTiled:
|
||||||
ui->checkBoxTilesScheme->setEnabled(true);
|
ui->checkBoxTilesScheme->setEnabled(true);
|
||||||
|
@ -488,10 +538,21 @@ void DialogSaveManualLayout::ShowExample()
|
||||||
case LayoutExportFormats::EPS:
|
case LayoutExportFormats::EPS:
|
||||||
ui->checkBoxExportUnified->setEnabled(true);
|
ui->checkBoxExportUnified->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
case LayoutExportFormats::NC:
|
||||||
|
case LayoutExportFormats::OBJ:
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(false);
|
||||||
|
break;
|
||||||
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_Flat:
|
||||||
case LayoutExportFormats::SVG:
|
case LayoutExportFormats::SVG:
|
||||||
case LayoutExportFormats::PNG:
|
case LayoutExportFormats::PNG:
|
||||||
case LayoutExportFormats::OBJ:
|
|
||||||
case LayoutExportFormats::NC:
|
|
||||||
case LayoutExportFormats::TIF:
|
case LayoutExportFormats::TIF:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -580,6 +641,7 @@ void DialogSaveManualLayout::ReadSettings()
|
||||||
{
|
{
|
||||||
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
||||||
SelectFormat(static_cast<LayoutExportFormats>(settings->GetLayoutExportFormat()));
|
SelectFormat(static_cast<LayoutExportFormats>(settings->GetLayoutExportFormat()));
|
||||||
|
SetShowGrainline(settings->GetShowGrainline());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -592,4 +654,5 @@ void DialogSaveManualLayout::WriteSettings() const
|
||||||
|
|
||||||
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
||||||
settings->SetLayoutExportFormat(static_cast<qint8>(Format()));
|
settings->SetLayoutExportFormat(static_cast<qint8>(Format()));
|
||||||
|
settings->SetShowGrainline(IsShowGrainline());
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,9 @@ public:
|
||||||
void SetBinaryDXFFormat(bool binary);
|
void SetBinaryDXFFormat(bool binary);
|
||||||
auto IsBinaryDXFFormat() const -> bool;
|
auto IsBinaryDXFFormat() const -> bool;
|
||||||
|
|
||||||
|
void SetShowGrainline(bool show);
|
||||||
|
auto IsShowGrainline() const -> bool;
|
||||||
|
|
||||||
void SetDestinationPath(const QString& cmdDestinationPath);
|
void SetDestinationPath(const QString& cmdDestinationPath);
|
||||||
|
|
||||||
auto IsTextAsPaths() const -> bool;
|
auto IsTextAsPaths() const -> bool;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>413</width>
|
<width>413</width>
|
||||||
<height>310</height>
|
<height>293</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -111,8 +111,8 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Options</string>
|
<string>Options</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="checkBoxBinaryDXF">
|
<widget class="QCheckBox" name="checkBoxBinaryDXF">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -122,17 +122,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="checkBoxTextAsPaths">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Text as paths</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxExportUnified">
|
<widget class="QCheckBox" name="checkBoxExportUnified">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -145,7 +135,27 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBoxShowGrainline">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show grainline</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QCheckBox" name="checkBoxTextAsPaths">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Text as paths</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
<widget class="QCheckBox" name="checkBoxTilesScheme">
|
<widget class="QCheckBox" name="checkBoxTilesScheme">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "../layout/vplayout.h"
|
#include "../layout/vplayout.h"
|
||||||
#include "../layout/vpsheet.h"
|
#include "../layout/vpsheet.h"
|
||||||
#include "../vlayout/vtextmanager.h"
|
#include "../vlayout/vtextmanager.h"
|
||||||
|
#include "../vlayout/vgraphicsfillitem.h"
|
||||||
|
|
||||||
#include "../vpapplication.h"
|
#include "../vpapplication.h"
|
||||||
|
|
||||||
|
@ -167,6 +168,7 @@ VPGraphicsPiece::VPGraphicsPiece(const VPPiecePtr &piece, QGraphicsItem *parent)
|
||||||
|
|
||||||
PaintPiece();
|
PaintPiece();
|
||||||
InitLabels();
|
InitLabels();
|
||||||
|
InitGrainlineItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -181,7 +183,6 @@ auto VPGraphicsPiece::boundingRect() const -> QRectF
|
||||||
QPainterPath shape;
|
QPainterPath shape;
|
||||||
shape.addPath(m_seamLine);
|
shape.addPath(m_seamLine);
|
||||||
shape.addPath(m_cuttingLine);
|
shape.addPath(m_cuttingLine);
|
||||||
shape.addPath(m_grainline);
|
|
||||||
shape.addPath(m_internalPaths);
|
shape.addPath(m_internalPaths);
|
||||||
shape.addPath(m_passmarks);
|
shape.addPath(m_passmarks);
|
||||||
shape.addPath(m_placeLabels);
|
shape.addPath(m_placeLabels);
|
||||||
|
@ -451,12 +452,45 @@ void VPGraphicsPiece::InitPieceLabel(const QVector<QPointF> &labelShape, const V
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VPGraphicsPiece::InitGrainlineItem()
|
||||||
|
{
|
||||||
|
delete m_grainlineItem;
|
||||||
|
|
||||||
|
VPPiecePtr piece = m_piece.toStrongRef();
|
||||||
|
if (piece.isNull())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(piece->IsGrainlineEnabled())
|
||||||
|
{
|
||||||
|
QPainterPath grainline;
|
||||||
|
QVector<QPointF> grainLinepoints = piece->GetMappedGrainline();
|
||||||
|
if(!grainLinepoints.isEmpty())
|
||||||
|
{
|
||||||
|
grainline.moveTo(ConstFirst(grainLinepoints));
|
||||||
|
for (int i = 1; i < grainLinepoints.size(); i++)
|
||||||
|
{
|
||||||
|
grainline.lineTo(grainLinepoints.at(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_grainlineItem = new VGraphicsFillItem(this);
|
||||||
|
m_grainlineItem->setPath(grainline);
|
||||||
|
|
||||||
|
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
||||||
|
QPen pen(PieceColor(), settings->GetLayoutLineWidth(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
|
||||||
|
m_grainlineItem->SetCustomPen(true);
|
||||||
|
m_grainlineItem->setPen(pen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPGraphicsPiece::PaintPiece(QPainter *painter)
|
void VPGraphicsPiece::PaintPiece(QPainter *painter)
|
||||||
{
|
{
|
||||||
m_seamLine = QPainterPath();
|
m_seamLine = QPainterPath();
|
||||||
m_cuttingLine = QPainterPath();
|
m_cuttingLine = QPainterPath();
|
||||||
m_grainline = QPainterPath();
|
|
||||||
m_internalPaths = QPainterPath();
|
m_internalPaths = QPainterPath();
|
||||||
m_passmarks = QPainterPath();
|
m_passmarks = QPainterPath();
|
||||||
m_placeLabels = QPainterPath();
|
m_placeLabels = QPainterPath();
|
||||||
|
@ -474,9 +508,6 @@ void VPGraphicsPiece::PaintPiece(QPainter *painter)
|
||||||
// initiliases the cutting line
|
// initiliases the cutting line
|
||||||
PaintCuttingLine(painter, piece);
|
PaintCuttingLine(painter, piece);
|
||||||
|
|
||||||
// initialises the grainline
|
|
||||||
PaintGrainline(painter, piece);
|
|
||||||
|
|
||||||
// initialises the internal paths
|
// initialises the internal paths
|
||||||
PaintInternalPaths(painter, piece);
|
PaintInternalPaths(painter, piece);
|
||||||
|
|
||||||
|
@ -539,35 +570,6 @@ void VPGraphicsPiece::PaintCuttingLine(QPainter *painter, const VPPiecePtr &piec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VPGraphicsPiece::PaintGrainline(QPainter *painter, const VPPiecePtr &piece)
|
|
||||||
{
|
|
||||||
if(piece->IsGrainlineEnabled())
|
|
||||||
{
|
|
||||||
QVector<QPointF> grainLinepoints = piece->GetMappedGrainline();
|
|
||||||
if(!grainLinepoints.isEmpty())
|
|
||||||
{
|
|
||||||
m_grainline.moveTo(ConstFirst(grainLinepoints));
|
|
||||||
for (int i = 1; i < grainLinepoints.size(); i++)
|
|
||||||
{
|
|
||||||
m_grainline.lineTo(grainLinepoints.at(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (painter != nullptr)
|
|
||||||
{
|
|
||||||
painter->save();
|
|
||||||
// here to fill the grainlines arrow. Not wanted for mvp
|
|
||||||
// later maybe if it's configurable
|
|
||||||
// painter->setBrush(blackBrush);
|
|
||||||
|
|
||||||
painter->setBrush(NoBrush());
|
|
||||||
painter->drawPath(m_grainline);
|
|
||||||
painter->restore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPGraphicsPiece::PaintInternalPaths(QPainter *painter, const VPPiecePtr &piece)
|
void VPGraphicsPiece::PaintInternalPaths(QPainter *painter, const VPPiecePtr &piece)
|
||||||
{
|
{
|
||||||
|
@ -790,6 +792,7 @@ void VPGraphicsPiece::on_RefreshPiece(const VPPiecePtr &piece)
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
PaintPiece(); // refresh shapes
|
PaintPiece(); // refresh shapes
|
||||||
InitLabels();
|
InitLabels();
|
||||||
|
InitGrainlineItem();
|
||||||
emit PieceTransformationChanged();
|
emit PieceTransformationChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||||
|
|
||||||
class VTextManager;
|
class VTextManager;
|
||||||
|
class VGraphicsFillItem;
|
||||||
|
|
||||||
class VPGraphicsPiece : public QGraphicsObject
|
class VPGraphicsPiece : public QGraphicsObject
|
||||||
{
|
{
|
||||||
|
@ -92,7 +93,6 @@ private:
|
||||||
|
|
||||||
QPainterPath m_cuttingLine{};
|
QPainterPath m_cuttingLine{};
|
||||||
QPainterPath m_seamLine{};
|
QPainterPath m_seamLine{};
|
||||||
QPainterPath m_grainline{};
|
|
||||||
QPainterPath m_internalPaths{};
|
QPainterPath m_internalPaths{};
|
||||||
QPainterPath m_passmarks{};
|
QPainterPath m_passmarks{};
|
||||||
QPainterPath m_placeLabels{};
|
QPainterPath m_placeLabels{};
|
||||||
|
@ -113,15 +113,16 @@ private:
|
||||||
|
|
||||||
bool m_hoverMode{false};
|
bool m_hoverMode{false};
|
||||||
|
|
||||||
|
VGraphicsFillItem *m_grainlineItem{nullptr};
|
||||||
QVector<QGraphicsPathItem *> m_labelPathItems{};
|
QVector<QGraphicsPathItem *> m_labelPathItems{};
|
||||||
QVector<QGraphicsSimpleTextItem *> m_labelTextItems{};
|
QVector<QGraphicsSimpleTextItem *> m_labelTextItems{};
|
||||||
|
|
||||||
void InitLabels();
|
void InitLabels();
|
||||||
void InitPieceLabel(const QVector<QPointF> &labelShape, const VTextManager &tm);
|
void InitPieceLabel(const QVector<QPointF> &labelShape, const VTextManager &tm);
|
||||||
|
void InitGrainlineItem();
|
||||||
void PaintPiece(QPainter *painter=nullptr);
|
void PaintPiece(QPainter *painter=nullptr);
|
||||||
void PaintSeamLine(QPainter *painter, const VPPiecePtr &piece);
|
void PaintSeamLine(QPainter *painter, const VPPiecePtr &piece);
|
||||||
void PaintCuttingLine(QPainter *painter, const VPPiecePtr &piece);
|
void PaintCuttingLine(QPainter *painter, const VPPiecePtr &piece);
|
||||||
void PaintGrainline(QPainter *painter, const VPPiecePtr &piece);
|
|
||||||
void PaintInternalPaths(QPainter *painter, const VPPiecePtr &piece);
|
void PaintInternalPaths(QPainter *painter, const VPPiecePtr &piece);
|
||||||
void PaintPassmarks(QPainter *painter, const VPPiecePtr &piece);
|
void PaintPassmarks(QPainter *painter, const VPPiecePtr &piece);
|
||||||
void PaintPlaceLabels(QPainter *painter, const VPPiecePtr &piece);
|
void PaintPlaceLabels(QPainter *painter, const VPPiecePtr &piece);
|
||||||
|
|
|
@ -384,11 +384,8 @@ auto VPApplication::NewMainWindow(const VPCommandLinePtr &cmd) -> VPMainWindow *
|
||||||
{
|
{
|
||||||
auto *puzzle = new VPMainWindow(cmd);
|
auto *puzzle = new VPMainWindow(cmd);
|
||||||
m_mainWindows.prepend(puzzle);
|
m_mainWindows.prepend(puzzle);
|
||||||
if (not cmd->IsTestModeEnabled())
|
puzzle->show();
|
||||||
{
|
puzzle->UpdateWindowTitle();
|
||||||
puzzle->show();
|
|
||||||
puzzle->UpdateWindowTitle();
|
|
||||||
}
|
|
||||||
puzzle->InitZoom();
|
puzzle->InitZoom();
|
||||||
return puzzle;
|
return puzzle;
|
||||||
}
|
}
|
||||||
|
@ -700,13 +697,6 @@ auto VPApplication::StartWithFiles(const VPCommandLinePtr &cmd, const QStringLis
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPApplication::SingleStart(const VPCommandLinePtr &cmd, const QStringList &rawLayouts) -> bool
|
auto VPApplication::SingleStart(const VPCommandLinePtr &cmd, const QStringList &rawLayouts) -> bool
|
||||||
{
|
{
|
||||||
if (cmd->IsTestModeEnabled())
|
|
||||||
{
|
|
||||||
qCCritical(pApp, "%s\n", qPrintable(tr("Please, provide one input file.")));
|
|
||||||
cmd.get()->parser.showHelp(V_EX_USAGE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
NewMainWindow(cmd);
|
NewMainWindow(cmd);
|
||||||
if (not rawLayouts.isEmpty())
|
if (not rawLayouts.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,49 +35,12 @@ std::shared_ptr<VPCommandLine> VPCommandLine::instance = nullptr; // NOLINT(cppc
|
||||||
|
|
||||||
#define translate(context, source) QCoreApplication::translate((context), source)// NOLINT(cppcoreguidelines-macro-usage)
|
#define translate(context, source) QCoreApplication::translate((context), source)// NOLINT(cppcoreguidelines-macro-usage)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
|
||||||
auto VPCommandLine::IsExportEnabled() const -> bool
|
|
||||||
{
|
|
||||||
const bool result = IsOptionSet(LONG_OPTION_EXPORT_FILE);
|
|
||||||
auto argSize = parser.positionalArguments().size();
|
|
||||||
if (result && argSize != 1)
|
|
||||||
{
|
|
||||||
qCritical() << translate("Puzzle", "Export options can be used with single input file only.") << "/n";
|
|
||||||
const_cast<VPCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------
|
|
||||||
auto VPCommandLine::OptionExportFile() const -> QString
|
|
||||||
{
|
|
||||||
QString path;
|
|
||||||
if (IsExportEnabled())
|
|
||||||
{
|
|
||||||
path = OptionValue(LONG_OPTION_EXPORT_FILE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPCommandLine::OptionRawLayouts() const -> QStringList
|
auto VPCommandLine::OptionRawLayouts() const -> QStringList
|
||||||
{
|
{
|
||||||
return OptionValues(LONG_OPTION_RAW_LAYOUT);
|
return OptionValues(LONG_OPTION_RAW_LAYOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------
|
|
||||||
auto VPCommandLine::IsTestModeEnabled() const -> bool
|
|
||||||
{
|
|
||||||
const bool r = IsOptionSet(LONG_OPTION_TEST);
|
|
||||||
if (r && parser.positionalArguments().size() != 1)
|
|
||||||
{
|
|
||||||
qCritical() << translate("VCommandLine", "Test option can be used with single input file only.") << "/n";
|
|
||||||
const_cast<VPCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------
|
||||||
auto VPCommandLine::IsGuiEnabled() const -> bool
|
auto VPCommandLine::IsGuiEnabled() const -> bool
|
||||||
{
|
{
|
||||||
|
@ -128,8 +91,6 @@ void VPCommandLine::ProcessInstance(VPCommandLinePtr &instance, const QStringLis
|
||||||
instance.reset(new VPCommandLine);
|
instance.reset(new VPCommandLine);
|
||||||
}
|
}
|
||||||
instance->parser.process(arguments);
|
instance->parser.process(arguments);
|
||||||
|
|
||||||
instance->isGuiEnabled = not (instance->IsGuiEnabled() || instance->IsExportEnabled());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------
|
||||||
|
@ -138,51 +99,9 @@ void VPCommandLine::InitCommandLineOptions()
|
||||||
//keep in mind order here - that is how user will see it, so group-up for usability
|
//keep in mind order here - that is how user will see it, so group-up for usability
|
||||||
//=================================================================================================================
|
//=================================================================================================================
|
||||||
parser.addOptions({
|
parser.addOptions({
|
||||||
{{SINGLE_OPTION_EXPORT_FILE, LONG_OPTION_EXPORT_FILE},
|
|
||||||
translate("VCommandLine", "The filename of exported layout file. Use it to enable console export mode."),
|
|
||||||
translate("VCommandLine", "The filename of layout file")},
|
|
||||||
{{SINGLE_OPTION_RAW_LAYOUT, LONG_OPTION_RAW_LAYOUT},
|
{{SINGLE_OPTION_RAW_LAYOUT, LONG_OPTION_RAW_LAYOUT},
|
||||||
translate("VCommandLine", "Load pattern pieces from the raw layout data file."),
|
translate("VCommandLine", "Load pattern pieces from the raw layout data file."),
|
||||||
translate("VCommandLine", "The raw layout data file")},
|
translate("VCommandLine", "The raw layout data file")},
|
||||||
{{SINGLE_OPTION_EXP2FORMAT, LONG_OPTION_EXP2FORMAT},
|
|
||||||
translate("VCommandLine", "Number corresponding to output format (default = 0, export mode): <not defined>"),
|
|
||||||
translate("VCommandLine", "Format number"), QChar('0')},
|
|
||||||
{LONG_OPTION_BINARYDXF, translate("VCommandLine", "Export dxf in binary form.")},
|
|
||||||
{LONG_OPTION_TEXT2PATHS, translate("VCommandLine", "Export text as paths.")},
|
|
||||||
//=================================================================================================================
|
|
||||||
{{SINGLE_OPTION_CROP_LENGTH, LONG_OPTION_CROP_LENGTH},
|
|
||||||
translate("VCommandLine", "Auto crop unused length (export mode).")},
|
|
||||||
{LONG_OPTION_CROP_WIDTH,
|
|
||||||
translate("VCommandLine", "Auto crop unused width (export mode).")},
|
|
||||||
//=================================================================================================================
|
|
||||||
{LONG_OPTION_TILED_PDF_PAGE_TEMPLATE,
|
|
||||||
translate("VCommandLine", "Number corresponding to tiled pdf page template (default = 0, export mode with "
|
|
||||||
"tiled pdf format): <not defined>"),
|
|
||||||
translate("VCommandLine", "Template number"), QChar('0')},
|
|
||||||
{LONG_OPTION_TILED_PDF_LEFT_MARGIN,
|
|
||||||
translate("VCommandLine","Tiled page left margin in current units like 3.0 (export mode). If not set will be "
|
|
||||||
"used default value 1 cm."),
|
|
||||||
translate("VCommandLine", "The left margin")},
|
|
||||||
{LONG_OPTION_TILED_PDF_RIGHT_MARGIN,
|
|
||||||
translate("VCommandLine", "Tiled page right margin in current units like 3.0 (export mode). If not set will "
|
|
||||||
"be used default value 1 cm."),
|
|
||||||
translate("VCommandLine", "The right margin")},
|
|
||||||
{LONG_OPTION_TILED_PDF_TOP_MARGIN,
|
|
||||||
translate("VCommandLine", "Tiled page top margin in current units like 3.0 (export mode). If not set will be "
|
|
||||||
"used value default value 1 cm."),
|
|
||||||
translate("VCommandLine", "The top margin")},
|
|
||||||
{LONG_OPTION_TILED_PDF_BOTTOM_MARGIN,
|
|
||||||
translate("VCommandLine", "Tiled page bottom margin in current units like 3.0 (export mode). If not set will "
|
|
||||||
"be used value default value 1 cm."),
|
|
||||||
translate("VCommandLine", "The bottom margin")},
|
|
||||||
{LONG_OPTION_TILED_PDF_LANDSCAPE,
|
|
||||||
translate("VCommandLine", "Set tiled page orienatation to landscape (export mode). Default value if not set "
|
|
||||||
"portrait.")},
|
|
||||||
//=================================================================================================================
|
|
||||||
{{SINGLE_OPTION_TEST, LONG_OPTION_TEST},
|
|
||||||
translate("VCommandLine", "Run the program in a test mode. The program in this mode loads a single layout "
|
|
||||||
"file and silently quit without showing the main window. The key have priority "
|
|
||||||
"before key '%1'.").arg(LONG_OPTION_EXPORT_FILE)},
|
|
||||||
{LONG_OPTION_NO_HDPI_SCALING,
|
{LONG_OPTION_NO_HDPI_SCALING,
|
||||||
translate("VCommandLine", "Disable high dpi scaling. Call this option if has problem with scaling (by default "
|
translate("VCommandLine", "Disable high dpi scaling. Call this option if has problem with scaling (by default "
|
||||||
"scaling enabled). Alternatively you can use the %1 environment variable.")
|
"scaling enabled). Alternatively you can use the %1 environment variable.")
|
||||||
|
|
|
@ -44,18 +44,9 @@ class VPCommandLine: public QObject
|
||||||
public:
|
public:
|
||||||
~VPCommandLine() override = default;
|
~VPCommandLine() override = default;
|
||||||
|
|
||||||
/** @brief if user enabled export from cmd */
|
|
||||||
auto IsExportEnabled() const -> bool;
|
|
||||||
|
|
||||||
/** @brief path to export file or empty string if not */
|
|
||||||
auto OptionExportFile() const -> QString;
|
|
||||||
|
|
||||||
/** @brief list with paths to the raw layout data files */
|
/** @brief list with paths to the raw layout data files */
|
||||||
auto OptionRawLayouts() const -> QStringList;
|
auto OptionRawLayouts() const -> QStringList;
|
||||||
|
|
||||||
/** @brief if user enabled test mode from cmd */
|
|
||||||
auto IsTestModeEnabled() const -> bool;
|
|
||||||
|
|
||||||
/** @brief if gui enabled or not */
|
/** @brief if gui enabled or not */
|
||||||
auto IsGuiEnabled() const -> bool;
|
auto IsGuiEnabled() const -> bool;
|
||||||
|
|
||||||
|
@ -77,7 +68,7 @@ private:
|
||||||
Q_DISABLE_COPY_MOVE(VPCommandLine) // NOLINT
|
Q_DISABLE_COPY_MOVE(VPCommandLine) // NOLINT
|
||||||
static VPCommandLinePtr instance; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
static VPCommandLinePtr instance; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
QCommandLineParser parser{};
|
QCommandLineParser parser{};
|
||||||
bool isGuiEnabled{false};
|
bool isGuiEnabled{true};
|
||||||
friend class VPApplication;
|
friend class VPApplication;
|
||||||
|
|
||||||
/** @brief add options to the QCommandLineParser that there are in the cmd can be */
|
/** @brief add options to the QCommandLineParser that there are in the cmd can be */
|
||||||
|
|
|
@ -29,33 +29,9 @@
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
const QString LONG_OPTION_EXPORT_FILE = QStringLiteral("exportFile"); // NOLINT
|
|
||||||
const QString SINGLE_OPTION_EXPORT_FILE = QStringLiteral("e"); // NOLINT
|
|
||||||
|
|
||||||
const QString LONG_OPTION_TEST = QStringLiteral("test"); // NOLINT
|
|
||||||
const QString SINGLE_OPTION_TEST = QStringLiteral("t"); // NOLINT
|
|
||||||
|
|
||||||
const QString LONG_OPTION_RAW_LAYOUT = QStringLiteral("rawLayout"); // NOLINT
|
const QString LONG_OPTION_RAW_LAYOUT = QStringLiteral("rawLayout"); // NOLINT
|
||||||
const QString SINGLE_OPTION_RAW_LAYOUT = QStringLiteral("r"); // NOLINT
|
const QString SINGLE_OPTION_RAW_LAYOUT = QStringLiteral("r"); // NOLINT
|
||||||
|
|
||||||
const QString LONG_OPTION_EXP2FORMAT = QStringLiteral("format"); // NOLINT
|
|
||||||
const QString SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f"); // NOLINT
|
|
||||||
|
|
||||||
const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf"); // NOLINT
|
|
||||||
const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths"); // NOLINT
|
|
||||||
|
|
||||||
const QString LONG_OPTION_CROP_LENGTH = QStringLiteral("crop"); // NOLINT
|
|
||||||
const QString SINGLE_OPTION_CROP_LENGTH = QStringLiteral("c"); // NOLINT
|
|
||||||
|
|
||||||
const QString LONG_OPTION_CROP_WIDTH = QStringLiteral("cropWidth"); // NOLINT
|
|
||||||
|
|
||||||
const QString LONG_OPTION_TILED_PDF_PAGE_TEMPLATE = QStringLiteral("tiledPageformat"); // NOLINT
|
|
||||||
const QString LONG_OPTION_TILED_PDF_LEFT_MARGIN = QStringLiteral("tiledlmargin"); // NOLINT
|
|
||||||
const QString LONG_OPTION_TILED_PDF_RIGHT_MARGIN = QStringLiteral("tiledrmargin"); // NOLINT
|
|
||||||
const QString LONG_OPTION_TILED_PDF_TOP_MARGIN = QStringLiteral("tiledtmargin"); // NOLINT
|
|
||||||
const QString LONG_OPTION_TILED_PDF_BOTTOM_MARGIN = QStringLiteral("tiledbmargin"); // NOLINT
|
|
||||||
const QString LONG_OPTION_TILED_PDF_LANDSCAPE = QStringLiteral("tiledLandscape"); // NOLINT
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief AllKeys return list with all command line keys (short and long forms). Used for testing on conflicts.
|
* @brief AllKeys return list with all command line keys (short and long forms). Used for testing on conflicts.
|
||||||
|
@ -65,24 +41,7 @@ auto AllKeys() -> QStringList
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
LONG_OPTION_EXPORT_FILE,
|
|
||||||
SINGLE_OPTION_EXPORT_FILE,
|
|
||||||
LONG_OPTION_TEST,
|
|
||||||
SINGLE_OPTION_TEST,
|
|
||||||
LONG_OPTION_RAW_LAYOUT,
|
LONG_OPTION_RAW_LAYOUT,
|
||||||
SINGLE_OPTION_RAW_LAYOUT,
|
SINGLE_OPTION_RAW_LAYOUT
|
||||||
LONG_OPTION_EXP2FORMAT,
|
|
||||||
SINGLE_OPTION_EXP2FORMAT,
|
|
||||||
LONG_OPTION_BINARYDXF,
|
|
||||||
LONG_OPTION_TEXT2PATHS,
|
|
||||||
LONG_OPTION_CROP_LENGTH,
|
|
||||||
SINGLE_OPTION_CROP_LENGTH,
|
|
||||||
LONG_OPTION_CROP_WIDTH,
|
|
||||||
LONG_OPTION_TILED_PDF_PAGE_TEMPLATE,
|
|
||||||
LONG_OPTION_TILED_PDF_LEFT_MARGIN,
|
|
||||||
LONG_OPTION_TILED_PDF_RIGHT_MARGIN,
|
|
||||||
LONG_OPTION_TILED_PDF_TOP_MARGIN,
|
|
||||||
LONG_OPTION_TILED_PDF_BOTTOM_MARGIN,
|
|
||||||
LONG_OPTION_TILED_PDF_LANDSCAPE
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,33 +31,9 @@
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
extern const QString LONG_OPTION_EXPORT_FILE;
|
|
||||||
extern const QString SINGLE_OPTION_EXPORT_FILE;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_TEST;
|
|
||||||
extern const QString SINGLE_OPTION_TEST;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_RAW_LAYOUT;
|
extern const QString LONG_OPTION_RAW_LAYOUT;
|
||||||
extern const QString SINGLE_OPTION_RAW_LAYOUT;
|
extern const QString SINGLE_OPTION_RAW_LAYOUT;
|
||||||
|
|
||||||
extern const QString LONG_OPTION_EXP2FORMAT;
|
|
||||||
extern const QString SINGLE_OPTION_EXP2FORMAT;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_BINARYDXF;
|
|
||||||
extern const QString LONG_OPTION_TEXT2PATHS;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_CROP_LENGTH;
|
|
||||||
extern const QString SINGLE_OPTION_CROP_LENGTH;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_CROP_WIDTH;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_TILED_PDF_PAGE_TEMPLATE;
|
|
||||||
extern const QString LONG_OPTION_TILED_PDF_LEFT_MARGIN;
|
|
||||||
extern const QString LONG_OPTION_TILED_PDF_RIGHT_MARGIN;
|
|
||||||
extern const QString LONG_OPTION_TILED_PDF_TOP_MARGIN;
|
|
||||||
extern const QString LONG_OPTION_TILED_PDF_BOTTOM_MARGIN;
|
|
||||||
extern const QString LONG_OPTION_TILED_PDF_LANDSCAPE;
|
|
||||||
|
|
||||||
auto AllKeys() -> QStringList;
|
auto AllKeys() -> QStringList;
|
||||||
|
|
||||||
#endif // VPCOMMANDS_H
|
#endif // VPCOMMANDS_H
|
||||||
|
|
|
@ -293,6 +293,7 @@ struct VPExportData
|
||||||
bool textAsPaths{false};
|
bool textAsPaths{false};
|
||||||
bool exportUnified{true};
|
bool exportUnified{true};
|
||||||
bool showTilesScheme{false};
|
bool showTilesScheme{false};
|
||||||
|
bool showGrainline{true};
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -419,10 +420,6 @@ auto VPMainWindow::LoadFile(const QString& path) -> bool
|
||||||
if (not QFileInfo::exists(path))
|
if (not QFileInfo::exists(path))
|
||||||
{
|
{
|
||||||
qCCritical(pWindow, "%s", qUtf8Printable(tr("File '%1' doesn't exist!").arg(path)));
|
qCCritical(pWindow, "%s", qUtf8Printable(tr("File '%1' doesn't exist!").arg(path)));
|
||||||
if (m_cmd->IsTestModeEnabled())
|
|
||||||
{
|
|
||||||
QCoreApplication::exit(V_EX_NOINPUT);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,11 +467,6 @@ auto VPMainWindow::LoadFile(const QString& path) -> bool
|
||||||
qCCritical(pWindow, "%s\n\n%s", qUtf8Printable(tr("File error.")),
|
qCCritical(pWindow, "%s\n\n%s", qUtf8Printable(tr("File error.")),
|
||||||
qUtf8Printable(tr("Unable to read a layout file. %1").arg(fileReader.errorString())));
|
qUtf8Printable(tr("Unable to read a layout file. %1").arg(fileReader.errorString())));
|
||||||
lock.reset();
|
lock.reset();
|
||||||
|
|
||||||
if (m_cmd->IsTestModeEnabled())
|
|
||||||
{
|
|
||||||
QCoreApplication::exit(V_EX_NOINPUT);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2376,6 +2368,7 @@ void VPMainWindow::ExportScene(const VPExportData &data)
|
||||||
exporter.SetYScale(data.yScale);
|
exporter.SetYScale(data.yScale);
|
||||||
exporter.SetDescription(m_layout->LayoutSettings().GetDescription());
|
exporter.SetDescription(m_layout->LayoutSettings().GetDescription());
|
||||||
exporter.SetBinaryDxfFormat(data.isBinaryDXF);
|
exporter.SetBinaryDxfFormat(data.isBinaryDXF);
|
||||||
|
exporter.SetShowGrainline(data.showGrainline);
|
||||||
|
|
||||||
QList<VPSheetPtr> sheets = data.sheets;
|
QList<VPSheetPtr> sheets = data.sheets;
|
||||||
|
|
||||||
|
@ -2413,17 +2406,17 @@ void VPMainWindow::ExportScene(const VPExportData &data)
|
||||||
case LayoutExportFormats::SVG:
|
case LayoutExportFormats::SVG:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToSVG(sheet->SceneData()->Scene());
|
exporter.ExportToSVG(sheet->SceneData()->Scene(), sheet->SceneData()->GraphicsPiecesAsItems());
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::PDF:
|
case LayoutExportFormats::PDF:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToPDF(sheet->SceneData()->Scene());
|
exporter.ExportToPDF(sheet->SceneData()->Scene(), sheet->SceneData()->GraphicsPiecesAsItems());
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::PNG:
|
case LayoutExportFormats::PNG:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToPNG(sheet->SceneData()->Scene());
|
exporter.ExportToPNG(sheet->SceneData()->Scene(), sheet->SceneData()->GraphicsPiecesAsItems());
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::OBJ:
|
case LayoutExportFormats::OBJ:
|
||||||
exporter.ExportToOBJ(sheet->SceneData()->Scene());
|
exporter.ExportToOBJ(sheet->SceneData()->Scene());
|
||||||
|
@ -2431,12 +2424,12 @@ void VPMainWindow::ExportScene(const VPExportData &data)
|
||||||
case LayoutExportFormats::PS:
|
case LayoutExportFormats::PS:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToPS(sheet->SceneData()->Scene());
|
exporter.ExportToPS(sheet->SceneData()->Scene(), sheet->SceneData()->GraphicsPiecesAsItems());
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::EPS:
|
case LayoutExportFormats::EPS:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToEPS(sheet->SceneData()->Scene());
|
exporter.ExportToEPS(sheet->SceneData()->Scene(), sheet->SceneData()->GraphicsPiecesAsItems());
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::DXF_AC1006_Flat:
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
exporter.SetDxfVersion(DRW::AC1006);
|
exporter.SetDxfVersion(DRW::AC1006);
|
||||||
|
@ -2477,7 +2470,7 @@ void VPMainWindow::ExportScene(const VPExportData &data)
|
||||||
case LayoutExportFormats::TIF:
|
case LayoutExportFormats::TIF:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToTIF(sheet->SceneData()->Scene());
|
exporter.ExportToTIF(sheet->SceneData()->Scene(), sheet->SceneData()->GraphicsPiecesAsItems());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug() << "Can't recognize file type." << Q_FUNC_INFO;
|
qDebug() << "Can't recognize file type." << Q_FUNC_INFO;
|
||||||
|
@ -2565,11 +2558,12 @@ void VPMainWindow::GenerateUnifiedPdfFile(const VPExportData &data, const QStrin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sheet->SceneData()->PrepareForExport();
|
sheet->SceneData()->PrepareForExport(); // Go first because recreates pieces
|
||||||
|
VLayoutExporter::PrepareGrainlineForExport(sheet->SceneData()->GraphicsPiecesAsItems(), data.showGrainline);
|
||||||
QRectF imageRect = sheet->GetMarginsRect();
|
QRectF imageRect = sheet->GetMarginsRect();
|
||||||
sheet->SceneData()->Scene()->render(&painter, VPrintLayout::SceneTargetRect(printer.data(), imageRect),
|
sheet->SceneData()->Scene()->render(&painter, VPrintLayout::SceneTargetRect(printer.data(), imageRect),
|
||||||
imageRect, Qt::IgnoreAspectRatio);
|
imageRect, Qt::IgnoreAspectRatio);
|
||||||
sheet->SceneData()->CleanAfterExport();
|
sheet->SceneData()->CleanAfterExport(); // Will restore the grainlines automatically
|
||||||
|
|
||||||
firstPage = false;
|
firstPage = false;
|
||||||
}
|
}
|
||||||
|
@ -2602,7 +2596,7 @@ void VPMainWindow::ExportPdfTiledFile(const VPExportData &data)
|
||||||
bool firstPage = true;
|
bool firstPage = true;
|
||||||
for (const auto& sheet : data.sheets)
|
for (const auto& sheet : data.sheets)
|
||||||
{
|
{
|
||||||
if (not GeneratePdfTiledFile(sheet, data.showTilesScheme, &painter, printer, firstPage))
|
if (not GeneratePdfTiledFile(sheet, data.showTilesScheme, data.showGrainline, &painter, printer, firstPage))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2620,7 +2614,8 @@ void VPMainWindow::ExportPdfTiledFile(const VPExportData &data)
|
||||||
|
|
||||||
QPainter painter;
|
QPainter painter;
|
||||||
bool firstPage = true;
|
bool firstPage = true;
|
||||||
if (not GeneratePdfTiledFile(data.sheets.at(i), data.showTilesScheme, &painter, printer, firstPage))
|
if (not GeneratePdfTiledFile(data.sheets.at(i), data.showTilesScheme, data.showGrainline, &painter, printer,
|
||||||
|
firstPage))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2629,18 +2624,25 @@ void VPMainWindow::ExportPdfTiledFile(const VPExportData &data)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPMainWindow::GeneratePdfTiledFile(const VPSheetPtr &sheet, bool showTilesScheme, QPainter *painter,
|
auto VPMainWindow::GeneratePdfTiledFile(const VPSheetPtr &sheet, bool showTilesScheme, bool showGrainline,
|
||||||
const QSharedPointer<QPrinter> &printer, bool &firstPage) -> bool
|
QPainter *painter, const QSharedPointer<QPrinter> &printer,
|
||||||
|
bool &firstPage) -> bool
|
||||||
{
|
{
|
||||||
SCASSERT(not sheet.isNull())
|
SCASSERT(not sheet.isNull())
|
||||||
SCASSERT(painter != nullptr)
|
SCASSERT(painter != nullptr)
|
||||||
SCASSERT(not printer.isNull())
|
SCASSERT(not printer.isNull())
|
||||||
|
|
||||||
sheet->SceneData()->PrepareForExport();
|
sheet->SceneData()->PrepareForExport(); // Go first because recreates pieces
|
||||||
|
VLayoutExporter::PrepareGrainlineForExport(sheet->SceneData()->GraphicsPiecesAsItems(), showGrainline);
|
||||||
m_layout->TileFactory()->RefreshTileInfos();
|
m_layout->TileFactory()->RefreshTileInfos();
|
||||||
m_layout->TileFactory()->RefreshWatermarkData();
|
m_layout->TileFactory()->RefreshWatermarkData();
|
||||||
sheet->SceneData()->SetTextAsPaths(false);
|
sheet->SceneData()->SetTextAsPaths(false);
|
||||||
|
|
||||||
|
auto Clean = qScopeGuard([sheet]()
|
||||||
|
{
|
||||||
|
sheet->SceneData()->CleanAfterExport(); // Will restore the grainlines automatically
|
||||||
|
});
|
||||||
|
|
||||||
if (showTilesScheme)
|
if (showTilesScheme)
|
||||||
{
|
{
|
||||||
SetPrinterTiledPageSettings(printer, m_layout, sheet, sheet->GetSheetOrientation(), true);
|
SetPrinterTiledPageSettings(printer, m_layout, sheet, sheet->GetSheetOrientation(), true);
|
||||||
|
@ -2695,8 +2697,6 @@ auto VPMainWindow::GeneratePdfTiledFile(const VPSheetPtr &sheet, bool showTilesS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sheet->SceneData()->CleanAfterExport();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4144,6 +4144,7 @@ void VPMainWindow::on_ExportLayout()
|
||||||
data.textAsPaths = dialog.IsTextAsPaths();
|
data.textAsPaths = dialog.IsTextAsPaths();
|
||||||
data.exportUnified = dialog.IsExportUnified();
|
data.exportUnified = dialog.IsExportUnified();
|
||||||
data.showTilesScheme = dialog.IsTilesScheme();
|
data.showTilesScheme = dialog.IsTilesScheme();
|
||||||
|
data.showGrainline = dialog.IsShowGrainline();
|
||||||
|
|
||||||
ExportData(data);
|
ExportData(data);
|
||||||
}
|
}
|
||||||
|
@ -4194,6 +4195,7 @@ void VPMainWindow::on_ExportSheet()
|
||||||
data.textAsPaths = dialog.IsTextAsPaths();
|
data.textAsPaths = dialog.IsTextAsPaths();
|
||||||
data.exportUnified = dialog.IsExportUnified();
|
data.exportUnified = dialog.IsExportUnified();
|
||||||
data.showTilesScheme = dialog.IsTilesScheme();
|
data.showTilesScheme = dialog.IsTilesScheme();
|
||||||
|
data.showGrainline = dialog.IsShowGrainline();
|
||||||
|
|
||||||
ExportData(data);
|
ExportData(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,7 +479,7 @@ private:
|
||||||
static void ExportUnifiedPdfFile(const VPExportData &data);
|
static void ExportUnifiedPdfFile(const VPExportData &data);
|
||||||
static void GenerateUnifiedPdfFile(const VPExportData &data, const QString &name);
|
static void GenerateUnifiedPdfFile(const VPExportData &data, const QString &name);
|
||||||
void ExportPdfTiledFile(const VPExportData &data);
|
void ExportPdfTiledFile(const VPExportData &data);
|
||||||
auto GeneratePdfTiledFile(const VPSheetPtr &sheet, bool showTilesScheme, QPainter *painter,
|
auto GeneratePdfTiledFile(const VPSheetPtr &sheet, bool showTilesScheme, bool showGrainline, QPainter *painter,
|
||||||
const QSharedPointer<QPrinter> &printer, bool &firstPage) -> bool;
|
const QSharedPointer<QPrinter> &printer, bool &firstPage) -> bool;
|
||||||
|
|
||||||
void UpdateScaleConnection() const;
|
void UpdateScaleConnection() const;
|
||||||
|
|
|
@ -54,6 +54,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutFollowGrainline, (QLatin1S
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPieceGap, (QLatin1String("layout/pieceGap"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPieceGap, (QLatin1String("layout/pieceGap"))) // NOLINT
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutExportFormat, (QLatin1String("layout/exportFormat"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutExportFormat, (QLatin1String("layout/exportFormat"))) // NOLINT
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutLineWidth, (QLatin1String("layout/lineWidth"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutLineWidth, (QLatin1String("layout/lineWidth"))) // NOLINT
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutShowGrainline, (QLatin1String("layout/showGrainline"))) // NOLINT
|
||||||
|
|
||||||
int cachedLineWidth = -1;
|
int cachedLineWidth = -1;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -340,3 +341,15 @@ void VPSettings::SetLayoutLineWidth(int width)
|
||||||
cachedLineWidth = qBound(1, width, 10);
|
cachedLineWidth = qBound(1, width, 10);
|
||||||
setValue(*settingLayoutLineWidth, cachedLineWidth);
|
setValue(*settingLayoutLineWidth, cachedLineWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool VPSettings::GetShowGrainline() const
|
||||||
|
{
|
||||||
|
return value(*settingLayoutShowGrainline, true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VPSettings::SetShowGrainline(bool value)
|
||||||
|
{
|
||||||
|
setValue(*settingLayoutShowGrainline, value);
|
||||||
|
}
|
||||||
|
|
|
@ -103,6 +103,9 @@ public:
|
||||||
auto GetLayoutLineWidth() const -> int;
|
auto GetLayoutLineWidth() const -> int;
|
||||||
void SetLayoutLineWidth(int width);
|
void SetLayoutLineWidth(int width);
|
||||||
|
|
||||||
|
bool GetShowGrainline() const;
|
||||||
|
void SetShowGrainline(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY_MOVE(VPSettings) // NOLINT
|
Q_DISABLE_COPY_MOVE(VPSettings) // NOLINT
|
||||||
};
|
};
|
||||||
|
|
|
@ -328,6 +328,12 @@ auto VCommandLine::IsBinaryDXF() const -> bool
|
||||||
return IsOptionSet(LONG_OPTION_BINARYDXF);
|
return IsOptionSet(LONG_OPTION_BINARYDXF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
auto VCommandLine::IsNoGrainline() const -> bool
|
||||||
|
{
|
||||||
|
return IsOptionSet(LONG_OPTION_NOGRAINLINE);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VCommandLine::IsTextAsPaths() const -> bool
|
auto VCommandLine::IsTextAsPaths() const -> bool
|
||||||
{
|
{
|
||||||
|
@ -621,6 +627,7 @@ void VCommandLine::InitCommandLineOptions()
|
||||||
DialogSaveLayout::MakeHelpFormatList(),
|
DialogSaveLayout::MakeHelpFormatList(),
|
||||||
translate("VCommandLine", "Format number"), QChar('0')},
|
translate("VCommandLine", "Format number"), QChar('0')},
|
||||||
{LONG_OPTION_BINARYDXF, translate("VCommandLine", "Export dxf in binary form.")},
|
{LONG_OPTION_BINARYDXF, translate("VCommandLine", "Export dxf in binary form.")},
|
||||||
|
{LONG_OPTION_NOGRAINLINE, translate("VCommandLine", "Show/hide grainline when export layout.")},
|
||||||
{LONG_OPTION_TEXT2PATHS, translate("VCommandLine", "Export text as paths.")},
|
{LONG_OPTION_TEXT2PATHS, translate("VCommandLine", "Export text as paths.")},
|
||||||
{LONG_OPTION_EXPORTONLYDETAILS,
|
{LONG_OPTION_EXPORTONLYDETAILS,
|
||||||
translate("VCommandLine", "Export only details. Export details as they positioned in the details mode. Any "
|
translate("VCommandLine", "Export only details. Export details as they positioned in the details mode. Any "
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
auto OptExportType() const -> int;
|
auto OptExportType() const -> int;
|
||||||
|
|
||||||
auto IsBinaryDXF() const -> bool;
|
auto IsBinaryDXF() const -> bool;
|
||||||
|
auto IsNoGrainline() const -> bool;
|
||||||
auto IsTextAsPaths() const -> bool;
|
auto IsTextAsPaths() const -> bool;
|
||||||
auto IsExportOnlyDetails() const -> bool;
|
auto IsExportOnlyDetails() const -> bool;
|
||||||
auto IsCSVWithHeader() const -> bool;
|
auto IsCSVWithHeader() const -> bool;
|
||||||
|
|
|
@ -277,6 +277,104 @@ auto DialogSaveLayout::IsBinaryDXFFormat() const -> bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogSaveLayout::SetShowGrainline(bool show)
|
||||||
|
{
|
||||||
|
switch(Format())
|
||||||
|
{
|
||||||
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_Flat:
|
||||||
|
case LayoutExportFormats::SVG:
|
||||||
|
case LayoutExportFormats::PDF:
|
||||||
|
case LayoutExportFormats::PDFTiled:
|
||||||
|
case LayoutExportFormats::PNG:
|
||||||
|
case LayoutExportFormats::PS:
|
||||||
|
case LayoutExportFormats::EPS:
|
||||||
|
case LayoutExportFormats::TIF:
|
||||||
|
ui->checkBoxShowGrainline->setChecked(show);
|
||||||
|
break;
|
||||||
|
case LayoutExportFormats::DXF_AC1006_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1006_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_ASTM:
|
||||||
|
case LayoutExportFormats::RLD:
|
||||||
|
case LayoutExportFormats::NC:
|
||||||
|
case LayoutExportFormats::OBJ:
|
||||||
|
default:
|
||||||
|
ui->checkBoxShowGrainline->setChecked(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
auto DialogSaveLayout::IsShowGrainline() const -> bool
|
||||||
|
{
|
||||||
|
switch(Format())
|
||||||
|
{
|
||||||
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_Flat:
|
||||||
|
case LayoutExportFormats::SVG:
|
||||||
|
case LayoutExportFormats::PDF:
|
||||||
|
case LayoutExportFormats::PDFTiled:
|
||||||
|
case LayoutExportFormats::PNG:
|
||||||
|
case LayoutExportFormats::PS:
|
||||||
|
case LayoutExportFormats::EPS:
|
||||||
|
case LayoutExportFormats::TIF:
|
||||||
|
return ui->checkBoxShowGrainline->isChecked();
|
||||||
|
case LayoutExportFormats::DXF_AC1006_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_AAMA:
|
||||||
|
case LayoutExportFormats::DXF_AC1006_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_ASTM:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_ASTM:
|
||||||
|
case LayoutExportFormats::RLD:
|
||||||
|
case LayoutExportFormats::NC:
|
||||||
|
case LayoutExportFormats::OBJ:
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto DialogSaveLayout::MakeHelpFormatList() -> QString
|
auto DialogSaveLayout::MakeHelpFormatList() -> QString
|
||||||
{
|
{
|
||||||
|
@ -414,18 +512,10 @@ void DialogSaveLayout::ShowExample()
|
||||||
ui->groupBoxPaperFormat->setEnabled(false);
|
ui->groupBoxPaperFormat->setEnabled(false);
|
||||||
ui->groupBoxMargins->setEnabled(false);
|
ui->groupBoxMargins->setEnabled(false);
|
||||||
ui->checkBoxTextAsPaths->setEnabled(true);
|
ui->checkBoxTextAsPaths->setEnabled(true);
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(m_mode == Draw::Layout);
|
||||||
|
|
||||||
switch(currentFormat)
|
switch(currentFormat)
|
||||||
{
|
{
|
||||||
case LayoutExportFormats::DXF_AC1006_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1009_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1012_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1014_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1015_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1018_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1021_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1024_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1027_Flat:
|
|
||||||
case LayoutExportFormats::DXF_AC1006_AAMA:
|
case LayoutExportFormats::DXF_AC1006_AAMA:
|
||||||
case LayoutExportFormats::DXF_AC1009_AAMA:
|
case LayoutExportFormats::DXF_AC1009_AAMA:
|
||||||
case LayoutExportFormats::DXF_AC1012_AAMA:
|
case LayoutExportFormats::DXF_AC1012_AAMA:
|
||||||
|
@ -445,6 +535,7 @@ void DialogSaveLayout::ShowExample()
|
||||||
case LayoutExportFormats::DXF_AC1024_ASTM:
|
case LayoutExportFormats::DXF_AC1024_ASTM:
|
||||||
case LayoutExportFormats::DXF_AC1027_ASTM:
|
case LayoutExportFormats::DXF_AC1027_ASTM:
|
||||||
ui->checkBoxBinaryDXF->setEnabled(true);
|
ui->checkBoxBinaryDXF->setEnabled(true);
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::PDFTiled:
|
case LayoutExportFormats::PDFTiled:
|
||||||
ui->groupBoxPaperFormat->setEnabled(true);
|
ui->groupBoxPaperFormat->setEnabled(true);
|
||||||
|
@ -452,14 +543,26 @@ void DialogSaveLayout::ShowExample()
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::RLD:
|
case LayoutExportFormats::RLD:
|
||||||
ui->checkBoxTextAsPaths->setEnabled(false);
|
ui->checkBoxTextAsPaths->setEnabled(false);
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
|
case LayoutExportFormats::NC:
|
||||||
|
case LayoutExportFormats::OBJ:
|
||||||
|
ui->checkBoxShowGrainline->setEnabled(false);
|
||||||
|
break;
|
||||||
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1009_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1012_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1014_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1015_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1018_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1021_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1024_Flat:
|
||||||
|
case LayoutExportFormats::DXF_AC1027_Flat:
|
||||||
case LayoutExportFormats::SVG:
|
case LayoutExportFormats::SVG:
|
||||||
case LayoutExportFormats::PDF:
|
case LayoutExportFormats::PDF:
|
||||||
case LayoutExportFormats::PNG:
|
case LayoutExportFormats::PNG:
|
||||||
case LayoutExportFormats::OBJ:
|
|
||||||
case LayoutExportFormats::PS:
|
case LayoutExportFormats::PS:
|
||||||
case LayoutExportFormats::EPS:
|
case LayoutExportFormats::EPS:
|
||||||
case LayoutExportFormats::NC:
|
|
||||||
case LayoutExportFormats::TIF:
|
case LayoutExportFormats::TIF:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -768,6 +871,7 @@ void DialogSaveLayout::ReadSettings()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SelectFormat(static_cast<LayoutExportFormats>(settings->GetLayoutExportFormat()));
|
SelectFormat(static_cast<LayoutExportFormats>(settings->GetLayoutExportFormat()));
|
||||||
|
SetShowGrainline(settings->GetShowGrainline());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,6 +923,7 @@ void DialogSaveLayout::WriteSettings() const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
settings->SetLayoutExportFormat(static_cast<qint8>(Format()));
|
settings->SetLayoutExportFormat(static_cast<qint8>(Format()));
|
||||||
|
settings->SetShowGrainline(IsShowGrainline());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,9 @@ public:
|
||||||
void SetBinaryDXFFormat(bool binary);
|
void SetBinaryDXFFormat(bool binary);
|
||||||
auto IsBinaryDXFFormat() const -> bool;
|
auto IsBinaryDXFFormat() const -> bool;
|
||||||
|
|
||||||
|
void SetShowGrainline(bool show);
|
||||||
|
auto IsShowGrainline() const -> bool;
|
||||||
|
|
||||||
static auto MakeHelpFormatList() -> QString;
|
static auto MakeHelpFormatList() -> QString;
|
||||||
void SetDestinationPath(const QString& cmdDestinationPath);
|
void SetDestinationPath(const QString& cmdDestinationPath);
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>493</width>
|
<width>544</width>
|
||||||
<height>391</height>
|
<height>401</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -129,6 +129,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxShowGrainline">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show grainline</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -2523,7 +2523,7 @@ void MainWindow::ExportDraw(const QString &fileName)
|
||||||
exporter.SetImageRect(rect);
|
exporter.SetImageRect(rect);
|
||||||
exporter.SetOffset(rect.topLeft()); // Correct positions to fit SVG view rect
|
exporter.SetOffset(rect.topLeft()); // Correct positions to fit SVG view rect
|
||||||
|
|
||||||
exporter.ExportToSVG(m_sceneDraw);
|
exporter.ExportToSVG(m_sceneDraw, QList<QGraphicsItem *>());
|
||||||
|
|
||||||
m_sceneDraw->SetOriginsVisible(true);
|
m_sceneDraw->SetOriginsVisible(true);
|
||||||
|
|
||||||
|
@ -6655,6 +6655,7 @@ auto MainWindow::DoExport(const VCommandLinePtr &expParams) -> bool
|
||||||
m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath());
|
m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath());
|
||||||
m_dialogSaveLayout->SelectFormat(static_cast<LayoutExportFormats>(expParams->OptExportType()));
|
m_dialogSaveLayout->SelectFormat(static_cast<LayoutExportFormats>(expParams->OptExportType()));
|
||||||
m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF());
|
m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF());
|
||||||
|
m_dialogSaveLayout->SetShowGrainline(!expParams->IsNoGrainline());
|
||||||
m_dialogSaveLayout->SetTextAsPaths(expParams->IsTextAsPaths());
|
m_dialogSaveLayout->SetTextAsPaths(expParams->IsTextAsPaths());
|
||||||
m_dialogSaveLayout->SetXScale(expParams->ExportXScale());
|
m_dialogSaveLayout->SetXScale(expParams->ExportXScale());
|
||||||
m_dialogSaveLayout->SetYScale(expParams->ExportYScale());
|
m_dialogSaveLayout->SetYScale(expParams->ExportYScale());
|
||||||
|
@ -6693,6 +6694,7 @@ auto MainWindow::DoExport(const VCommandLinePtr &expParams) -> bool
|
||||||
m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath());
|
m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath());
|
||||||
m_dialogSaveLayout->SelectFormat(static_cast<LayoutExportFormats>(expParams->OptExportType()));
|
m_dialogSaveLayout->SelectFormat(static_cast<LayoutExportFormats>(expParams->OptExportType()));
|
||||||
m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF());
|
m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF());
|
||||||
|
m_dialogSaveLayout->SetShowGrainline(!expParams->IsNoGrainline());
|
||||||
m_dialogSaveLayout->SetXScale(expParams->ExportXScale());
|
m_dialogSaveLayout->SetXScale(expParams->ExportXScale());
|
||||||
m_dialogSaveLayout->SetYScale(expParams->ExportYScale());
|
m_dialogSaveLayout->SetYScale(expParams->ExportYScale());
|
||||||
|
|
||||||
|
|
|
@ -1116,6 +1116,7 @@ void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
|
||||||
exporter.SetDescription(doc->GetDescription().toHtmlEscaped());
|
exporter.SetDescription(doc->GetDescription().toHtmlEscaped());
|
||||||
exporter.SetIgnorePrinterMargins(ignorePrinterFields);
|
exporter.SetIgnorePrinterMargins(ignorePrinterFields);
|
||||||
exporter.SetBinaryDxfFormat(m_dialogSaveLayout->IsBinaryDXFFormat());
|
exporter.SetBinaryDxfFormat(m_dialogSaveLayout->IsBinaryDXFFormat());
|
||||||
|
exporter.SetShowGrainline(m_dialogSaveLayout->IsShowGrainline());
|
||||||
|
|
||||||
for (int i=0; i < scenes.size(); ++i)
|
for (int i=0; i < scenes.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -1141,18 +1142,18 @@ void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
|
||||||
paper->setVisible(false);
|
paper->setVisible(false);
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToSVG(scene);
|
exporter.ExportToSVG(scene, details.at(i));
|
||||||
paper->setVisible(true);
|
paper->setVisible(true);
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::PDF:
|
case LayoutExportFormats::PDF:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToPDF(scene);
|
exporter.ExportToPDF(scene, details.at(i));
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::PNG:
|
case LayoutExportFormats::PNG:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToPNG(scene);
|
exporter.ExportToPNG(scene, details.at(i));
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::OBJ:
|
case LayoutExportFormats::OBJ:
|
||||||
paper->setVisible(false);
|
paper->setVisible(false);
|
||||||
|
@ -1162,12 +1163,12 @@ void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
|
||||||
case LayoutExportFormats::PS:
|
case LayoutExportFormats::PS:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToPS(scene);
|
exporter.ExportToPS(scene, details.at(i));
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::EPS:
|
case LayoutExportFormats::EPS:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToEPS(scene);
|
exporter.ExportToEPS(scene, details.at(i));
|
||||||
break;
|
break;
|
||||||
case LayoutExportFormats::DXF_AC1006_Flat:
|
case LayoutExportFormats::DXF_AC1006_Flat:
|
||||||
paper->setVisible(false);
|
paper->setVisible(false);
|
||||||
|
@ -1226,7 +1227,7 @@ void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
|
||||||
case LayoutExportFormats::TIF:
|
case LayoutExportFormats::TIF:
|
||||||
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
exporter.SetPen(QPen(Qt::black, VAbstractApplication::VApp()->Settings()->WidthHairLine(),
|
||||||
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
exporter.ExportToTIF(scene);
|
exporter.ExportToTIF(scene, details.at(i));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug() << "Can't recognize file type." << Q_FUNC_INFO;
|
qDebug() << "Can't recognize file type." << Q_FUNC_INFO;
|
||||||
|
|
|
@ -44,8 +44,17 @@ void VGraphicsFillItem::paint(QPainter* painter, const QStyleOptionGraphicsItem*
|
||||||
Q_UNUSED(widget)
|
Q_UNUSED(widget)
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
QPen pen = painter->pen();
|
QPen pen;
|
||||||
pen.setWidthF(width);
|
|
||||||
|
if (m_customPen)
|
||||||
|
{
|
||||||
|
pen = this->pen();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pen = painter->pen();
|
||||||
|
pen.setWidthF(width);
|
||||||
|
}
|
||||||
painter->setPen(pen);
|
painter->setPen(pen);
|
||||||
|
|
||||||
painter->setBrush(painter->pen().color());
|
painter->setBrush(painter->pen().color());
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <QGraphicsPathItem>
|
#include <QGraphicsPathItem>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
class VGraphicsFillItem : public QGraphicsPathItem
|
class VGraphicsFillItem : public QGraphicsPathItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -49,13 +51,20 @@ public:
|
||||||
* @param option unused
|
* @param option unused
|
||||||
* @param widget unused
|
* @param widget unused
|
||||||
*/
|
*/
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||||
|
|
||||||
|
int type() const override {return Type;}
|
||||||
|
enum { Type = UserType + static_cast<int>(Layout::GrainlineItem)};
|
||||||
|
|
||||||
auto GetWidth() const -> qreal;
|
auto GetWidth() const -> qreal;
|
||||||
void SetWidth(const qreal &value);
|
void SetWidth(const qreal &value);
|
||||||
|
|
||||||
|
auto CustomPen() const -> bool;
|
||||||
|
void SetCustomPen(bool newCustomPen);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qreal width{1};
|
qreal width{1};
|
||||||
|
bool m_customPen{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -70,4 +79,15 @@ inline void VGraphicsFillItem::SetWidth(const qreal &value)
|
||||||
width = value;
|
width = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline auto VGraphicsFillItem::CustomPen() const -> bool
|
||||||
|
{
|
||||||
|
return m_customPen;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline void VGraphicsFillItem::SetCustomPen(bool newCustomPen)
|
||||||
|
{
|
||||||
|
m_customPen = newCustomPen;
|
||||||
|
}
|
||||||
#endif // VGRAPHICSFILLITEM_H
|
#endif // VGRAPHICSFILLITEM_H
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include "../vmisc/vabstractvalapplication.h"
|
#include "../vmisc/vabstractvalapplication.h"
|
||||||
#include "../ifc/exception/vexception.h"
|
#include "../ifc/exception/vexception.h"
|
||||||
#include "vprintlayout.h"
|
#include "vprintlayout.h"
|
||||||
|
#include "vgraphicsfillitem.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -67,7 +68,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, PDFTOPS, (QLatin1String("pdftops"))) //
|
||||||
*
|
*
|
||||||
* @param placeholder placeholder that will be appended to each QGraphicsSimpleTextItem item's text string.
|
* @param placeholder placeholder that will be appended to each QGraphicsSimpleTextItem item's text string.
|
||||||
*/
|
*/
|
||||||
void PrepareTextForDXF(const QString &placeholder, const QList<QGraphicsItem *> &paperItems)
|
void PrepareDetailsForDXF(const QString &placeholder, const QList<QGraphicsItem *> &paperItems)
|
||||||
{
|
{
|
||||||
for (auto *item : paperItems)
|
for (auto *item : paperItems)
|
||||||
{
|
{
|
||||||
|
@ -94,7 +95,7 @@ void PrepareTextForDXF(const QString &placeholder, const QList<QGraphicsItem *>
|
||||||
*
|
*
|
||||||
* @param placeholder placeholder that will be removed from each QGraphicsSimpleTextItem item's text string.
|
* @param placeholder placeholder that will be removed from each QGraphicsSimpleTextItem item's text string.
|
||||||
*/
|
*/
|
||||||
void RestoreTextAfterDXF(const QString &placeholder, const QList<QGraphicsItem *> &paperItems)
|
void RestoreDetailsAfterDXF(const QString &placeholder, const QList<QGraphicsItem *> &paperItems)
|
||||||
{
|
{
|
||||||
for (auto *item : paperItems)
|
for (auto *item : paperItems)
|
||||||
{
|
{
|
||||||
|
@ -116,8 +117,22 @@ void RestoreTextAfterDXF(const QString &placeholder, const QList<QGraphicsItem *
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToSVG(QGraphicsScene *scene) const
|
auto VLayoutExporter::IsShowGrainline() const -> bool
|
||||||
{
|
{
|
||||||
|
return m_showGrainline;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLayoutExporter::SetShowGrainline(bool show)
|
||||||
|
{
|
||||||
|
m_showGrainline = show;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLayoutExporter::ExportToSVG(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
|
{
|
||||||
|
PrepareGrainlineForExport(details, m_showGrainline);
|
||||||
|
|
||||||
QSvgGenerator generator;
|
QSvgGenerator generator;
|
||||||
generator.setFileName(m_fileName);
|
generator.setFileName(m_fileName);
|
||||||
|
|
||||||
|
@ -145,11 +160,15 @@ void VLayoutExporter::ExportToSVG(QGraphicsScene *scene) const
|
||||||
painter.scale(m_xScale, m_yScale);
|
painter.scale(m_xScale, m_yScale);
|
||||||
scene->render(&painter, m_imageRect, m_imageRect, Qt::IgnoreAspectRatio);
|
scene->render(&painter, m_imageRect, m_imageRect, Qt::IgnoreAspectRatio);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToPNG(QGraphicsScene *scene) const
|
void VLayoutExporter::ExportToPNG(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
{
|
{
|
||||||
|
PrepareGrainlineForExport(details, m_showGrainline);
|
||||||
|
|
||||||
// Create the image with the exact size of the shrunk scene
|
// Create the image with the exact size of the shrunk scene
|
||||||
QSize drawingSize;
|
QSize drawingSize;
|
||||||
drawingSize.setWidth(qFloor(m_imageRect.width() * m_xScale + m_margins.left() + m_margins.right()));
|
drawingSize.setWidth(qFloor(m_imageRect.width() * m_xScale + m_margins.left() + m_margins.right()));
|
||||||
|
@ -167,11 +186,15 @@ void VLayoutExporter::ExportToPNG(QGraphicsScene *scene) const
|
||||||
|
|
||||||
scene->render(&painter, m_imageRect, m_imageRect, Qt::IgnoreAspectRatio);
|
scene->render(&painter, m_imageRect, m_imageRect, Qt::IgnoreAspectRatio);
|
||||||
image.save(m_fileName);
|
image.save(m_fileName);
|
||||||
|
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToTIF(QGraphicsScene *scene) const
|
void VLayoutExporter::ExportToTIF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
{
|
{
|
||||||
|
PrepareGrainlineForExport(details, m_showGrainline);
|
||||||
|
|
||||||
// Create the image with the exact size of the shrunk scene
|
// Create the image with the exact size of the shrunk scene
|
||||||
QSize drawingSize;
|
QSize drawingSize;
|
||||||
drawingSize.setWidth(qFloor(m_imageRect.width() * m_xScale + m_margins.left() + m_margins.right()));
|
drawingSize.setWidth(qFloor(m_imageRect.width() * m_xScale + m_margins.left() + m_margins.right()));
|
||||||
|
@ -197,14 +220,17 @@ void VLayoutExporter::ExportToTIF(QGraphicsScene *scene) const
|
||||||
if (not writer.write(image))
|
if (not writer.write(image))
|
||||||
{ // failed to save file
|
{ // failed to save file
|
||||||
qCritical() << qUtf8Printable(tr("Can't save file '%1'. Error: %2.").arg(m_fileName, writer.errorString()));
|
qCritical() << qUtf8Printable(tr("Can't save file '%1'. Error: %2.").arg(m_fileName, writer.errorString()));
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToPDF(QGraphicsScene *scene) const
|
void VLayoutExporter::ExportToPDF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
{
|
{
|
||||||
ExportToPDF(scene, m_fileName);
|
ExportToPDF(scene, details, m_fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -222,25 +248,25 @@ void VLayoutExporter::ExportToOBJ(QGraphicsScene *scene) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToPS(QGraphicsScene *scene) const
|
void VLayoutExporter::ExportToPS(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
{
|
{
|
||||||
QTemporaryFile tmp;
|
QTemporaryFile tmp;
|
||||||
if (tmp.open())
|
if (tmp.open())
|
||||||
{
|
{
|
||||||
const QString fileName = m_fileName;
|
const QString fileName = m_fileName;
|
||||||
ExportToPDF(scene, tmp.fileName());
|
ExportToPDF(scene, details, tmp.fileName());
|
||||||
PdfToPs(QStringList{tmp.fileName(), fileName});
|
PdfToPs(QStringList{tmp.fileName(), fileName});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToEPS(QGraphicsScene *scene) const
|
void VLayoutExporter::ExportToEPS(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
{
|
{
|
||||||
QTemporaryFile tmp;
|
QTemporaryFile tmp;
|
||||||
if (tmp.open())
|
if (tmp.open())
|
||||||
{
|
{
|
||||||
const QString fileName = m_fileName;
|
const QString fileName = m_fileName;
|
||||||
ExportToPDF(scene, tmp.fileName());
|
ExportToPDF(scene, details, tmp.fileName());
|
||||||
PdfToPs(QStringList{QStringLiteral("-eps"), tmp.fileName(), fileName});
|
PdfToPs(QStringList{QStringLiteral("-eps"), tmp.fileName(), fileName});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +274,8 @@ void VLayoutExporter::ExportToEPS(QGraphicsScene *scene) const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToFlatDXF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
void VLayoutExporter::ExportToFlatDXF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const
|
||||||
{
|
{
|
||||||
PrepareTextForDXF(endStringPlaceholder, details);
|
PrepareDetailsForDXF(endStringPlaceholder, details);
|
||||||
|
PrepareGrainlineForExport(details, m_showGrainline);
|
||||||
|
|
||||||
VDxfPaintDevice generator;
|
VDxfPaintDevice generator;
|
||||||
generator.SetFileName(m_fileName);
|
generator.SetFileName(m_fileName);
|
||||||
|
@ -270,7 +297,8 @@ void VLayoutExporter::ExportToFlatDXF(QGraphicsScene *scene, const QList<QGraphi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RestoreTextAfterDXF(endStringPlaceholder, details);
|
RestoreDetailsAfterDXF(endStringPlaceholder, details);
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -411,8 +439,11 @@ void VLayoutExporter::PdfToPs(const QStringList ¶ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutExporter::ExportToPDF(QGraphicsScene *scene, const QString &filename) const
|
void VLayoutExporter::ExportToPDF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details,
|
||||||
|
const QString &filename) const
|
||||||
{
|
{
|
||||||
|
PrepareGrainlineForExport(details, m_showGrainline);
|
||||||
|
|
||||||
QPrinter printer;
|
QPrinter printer;
|
||||||
printer.setCreator(QGuiApplication::applicationDisplayName() + QChar(QChar::Space) +
|
printer.setCreator(QGuiApplication::applicationDisplayName() + QChar(QChar::Space) +
|
||||||
QCoreApplication::applicationVersion());
|
QCoreApplication::applicationVersion());
|
||||||
|
@ -453,6 +484,7 @@ void VLayoutExporter::ExportToPDF(QGraphicsScene *scene, const QString &filename
|
||||||
if (not painter.begin(&printer))
|
if (not painter.begin(&printer))
|
||||||
{ // failed to open file
|
{ // failed to open file
|
||||||
qCritical() << qUtf8Printable(tr("Can't open file '%1'").arg(m_fileName));
|
qCritical() << qUtf8Printable(tr("Can't open file '%1'").arg(m_fileName));
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
@ -461,6 +493,8 @@ void VLayoutExporter::ExportToPDF(QGraphicsScene *scene, const QString &filename
|
||||||
painter.scale(m_xScale, m_yScale);
|
painter.scale(m_xScale, m_yScale);
|
||||||
scene->render(&painter, VPrintLayout::SceneTargetRect(&printer, m_imageRect), m_imageRect, Qt::IgnoreAspectRatio);
|
scene->render(&painter, VPrintLayout::SceneTargetRect(&printer, m_imageRect), m_imageRect, Qt::IgnoreAspectRatio);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
|
RestoreGrainlineAfterExport(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -607,3 +641,35 @@ QString VLayoutExporter::ExportFormatSuffix(LayoutExportFormats format)
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLayoutExporter::PrepareGrainlineForExport(const QList<QGraphicsItem *> &items, bool showGrainline)
|
||||||
|
{
|
||||||
|
for (auto *item : items)
|
||||||
|
{
|
||||||
|
QList<QGraphicsItem *> pieceChildren = item->childItems();
|
||||||
|
for (auto *child : qAsConst(pieceChildren))
|
||||||
|
{
|
||||||
|
if (child->type() == VGraphicsFillItem::Type)
|
||||||
|
{
|
||||||
|
child->setVisible(showGrainline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLayoutExporter::RestoreGrainlineAfterExport(const QList<QGraphicsItem *> &items)
|
||||||
|
{
|
||||||
|
for (auto *item : items)
|
||||||
|
{
|
||||||
|
QList<QGraphicsItem *> pieceChildren = item->childItems();
|
||||||
|
for (auto *child : qAsConst(pieceChildren))
|
||||||
|
{
|
||||||
|
if (child->type() == VGraphicsFillItem::Type)
|
||||||
|
{
|
||||||
|
child->setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -76,16 +76,19 @@ public:
|
||||||
auto BinaryDxfFormat() const -> bool;
|
auto BinaryDxfFormat() const -> bool;
|
||||||
void SetBinaryDxfFormat(bool binaryFormat);
|
void SetBinaryDxfFormat(bool binaryFormat);
|
||||||
|
|
||||||
|
auto IsShowGrainline() const -> bool;
|
||||||
|
void SetShowGrainline(bool show);
|
||||||
|
|
||||||
auto DxfVersion() const -> int;
|
auto DxfVersion() const -> int;
|
||||||
void SetDxfVersion(int dxfVersion);
|
void SetDxfVersion(int dxfVersion);
|
||||||
|
|
||||||
void ExportToSVG(QGraphicsScene *scene) const;
|
void ExportToSVG(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToPNG(QGraphicsScene *scene) const;
|
void ExportToPNG(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToTIF(QGraphicsScene *scene) const;
|
void ExportToTIF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToPDF(QGraphicsScene *scene) const;
|
void ExportToPDF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToOBJ(QGraphicsScene *scene) const;
|
void ExportToOBJ(QGraphicsScene *scene) const;
|
||||||
void ExportToPS(QGraphicsScene *scene) const;
|
void ExportToPS(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToEPS(QGraphicsScene *scene) const;
|
void ExportToEPS(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToFlatDXF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
void ExportToFlatDXF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details) const;
|
||||||
void ExportToAAMADXF(const QVector<VLayoutPiece> &details) const;
|
void ExportToAAMADXF(const QVector<VLayoutPiece> &details) const;
|
||||||
void ExportToASTMDXF(const QVector<VLayoutPiece> &details) const;
|
void ExportToASTMDXF(const QVector<VLayoutPiece> &details) const;
|
||||||
|
@ -93,10 +96,11 @@ public:
|
||||||
|
|
||||||
static auto SupportPDFConversion() -> bool;
|
static auto SupportPDFConversion() -> bool;
|
||||||
|
|
||||||
|
|
||||||
static QString ExportFormatDescription(LayoutExportFormats format);
|
static QString ExportFormatDescription(LayoutExportFormats format);
|
||||||
static QString ExportFormatSuffix(LayoutExportFormats format);
|
static QString ExportFormatSuffix(LayoutExportFormats format);
|
||||||
static void PdfToPs(const QStringList ¶ms);
|
static void PdfToPs(const QStringList ¶ms);
|
||||||
|
static void PrepareGrainlineForExport(const QList<QGraphicsItem *> &items, bool showGrainline);
|
||||||
|
static void RestoreGrainlineAfterExport(const QList<QGraphicsItem *> &items);
|
||||||
|
|
||||||
auto offset() const -> QPointF;
|
auto offset() const -> QPointF;
|
||||||
void SetOffset(const QPointF &newOffset);
|
void SetOffset(const QPointF &newOffset);
|
||||||
|
@ -112,10 +116,11 @@ private:
|
||||||
QPen m_pen{};
|
QPen m_pen{};
|
||||||
bool m_ignorePrinterMargins{false};
|
bool m_ignorePrinterMargins{false};
|
||||||
bool m_binaryDxfFormat{false};
|
bool m_binaryDxfFormat{false};
|
||||||
|
bool m_showGrainline{true};
|
||||||
int m_dxfVersion{0};
|
int m_dxfVersion{0};
|
||||||
QPointF m_offset{};
|
QPointF m_offset{};
|
||||||
|
|
||||||
void ExportToPDF(QGraphicsScene *scene, const QString &filename) const;
|
void ExportToPDF(QGraphicsScene *scene, const QList<QGraphicsItem *> &details, const QString &filename) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -48,6 +48,7 @@ const QString LONG_OPTION_EXP2FORMAT = QStringLiteral("format");
|
||||||
const QString SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f");
|
const QString SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f");
|
||||||
|
|
||||||
const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf");
|
const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf");
|
||||||
|
const QString LONG_OPTION_NOGRAINLINE = QStringLiteral("noGrainline"); // NOLINT
|
||||||
const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths");
|
const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths");
|
||||||
const QString LONG_OPTION_EXPORTONLYDETAILS = QStringLiteral("exportOnlyDetails");
|
const QString LONG_OPTION_EXPORTONLYDETAILS = QStringLiteral("exportOnlyDetails");
|
||||||
const QString LONG_OPTION_EXPORTSUCHDETAILS = QStringLiteral("exportSuchDetails");
|
const QString LONG_OPTION_EXPORTSUCHDETAILS = QStringLiteral("exportSuchDetails");
|
||||||
|
@ -149,6 +150,7 @@ QStringList AllKeys()
|
||||||
LONG_OPTION_PAGETEMPLATE, SINGLE_OPTION_PAGETEMPLATE,
|
LONG_OPTION_PAGETEMPLATE, SINGLE_OPTION_PAGETEMPLATE,
|
||||||
LONG_OPTION_EXP2FORMAT, SINGLE_OPTION_EXP2FORMAT,
|
LONG_OPTION_EXP2FORMAT, SINGLE_OPTION_EXP2FORMAT,
|
||||||
LONG_OPTION_BINARYDXF,
|
LONG_OPTION_BINARYDXF,
|
||||||
|
LONG_OPTION_NOGRAINLINE,
|
||||||
LONG_OPTION_TEXT2PATHS,
|
LONG_OPTION_TEXT2PATHS,
|
||||||
LONG_OPTION_EXPORTONLYDETAILS,
|
LONG_OPTION_EXPORTONLYDETAILS,
|
||||||
LONG_OPTION_EXPORTSUCHDETAILS,
|
LONG_OPTION_EXPORTSUCHDETAILS,
|
||||||
|
|
|
@ -47,6 +47,7 @@ extern const QString LONG_OPTION_EXP2FORMAT;
|
||||||
extern const QString SINGLE_OPTION_EXP2FORMAT;
|
extern const QString SINGLE_OPTION_EXP2FORMAT;
|
||||||
|
|
||||||
extern const QString LONG_OPTION_BINARYDXF;
|
extern const QString LONG_OPTION_BINARYDXF;
|
||||||
|
extern const QString LONG_OPTION_NOGRAINLINE;
|
||||||
extern const QString LONG_OPTION_TEXT2PATHS;
|
extern const QString LONG_OPTION_TEXT2PATHS;
|
||||||
extern const QString LONG_OPTION_EXPORTONLYDETAILS;
|
extern const QString LONG_OPTION_EXPORTONLYDETAILS;
|
||||||
extern const QString LONG_OPTION_EXPORTSUCHDETAILS;
|
extern const QString LONG_OPTION_EXPORTSUCHDETAILS;
|
||||||
|
|
|
@ -274,6 +274,12 @@ enum class Vis : ToolVisHolderType
|
||||||
LAST_ONE_DO_NOT_USE //add new stuffs above this, this constant must be last and never used
|
LAST_ONE_DO_NOT_USE //add new stuffs above this, this constant must be last and never used
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class Layout : ToolVisHolderType
|
||||||
|
{
|
||||||
|
GrainlineItem = static_cast<ToolVisHolderType>(Vis::LAST_ONE_DO_NOT_USE),
|
||||||
|
LAST_ONE_DO_NOT_USE //add new stuffs above this, this constant must be last and never used
|
||||||
|
};
|
||||||
|
|
||||||
enum class VarType : qint8 { Measurement, MeasurementSeparator, Increment, IncrementSeparator, LineLength, CurveLength,
|
enum class VarType : qint8 { Measurement, MeasurementSeparator, Increment, IncrementSeparator, LineLength, CurveLength,
|
||||||
CurveCLength, LineAngle, CurveAngle, ArcRadius, PieceExternalArea, PieceSeamLineArea,
|
CurveCLength, LineAngle, CurveAngle, ArcRadius, PieceExternalArea, PieceSeamLineArea,
|
||||||
Unknown };
|
Unknown };
|
||||||
|
|
|
@ -77,6 +77,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSaveLength, (QLatin1String
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPreferOneSheetSolution, // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPreferOneSheetSolution, // NOLINT
|
||||||
(QLatin1String("layout/preferOneSheetSolution")))
|
(QLatin1String("layout/preferOneSheetSolution")))
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutUnitePages, (QLatin1String("layout/unitePages"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutUnitePages, (QLatin1String("layout/unitePages"))) // NOLINT
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutShowGrainline, (QLatin1String("layout/showGrainline"))) // NOLINT
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFields, (QLatin1String("layout/fields"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFields, (QLatin1String("layout/fields"))) // NOLINT
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIgnoreFields, (QLatin1String("layout/ignoreFields"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIgnoreFields, (QLatin1String("layout/ignoreFields"))) // NOLINT
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingStripOptimization, (QLatin1String("layout/stripOptimization"))) // NOLINT
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingStripOptimization, (QLatin1String("layout/stripOptimization"))) // NOLINT
|
||||||
|
@ -971,6 +972,18 @@ void VValentinaSettings::SetBackgroundImageDefOpacity(int value)
|
||||||
setValue(*settingPatternBackgroundImageDefOpacity, qBound(0, value, 100));
|
setValue(*settingPatternBackgroundImageDefOpacity, qBound(0, value, 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool VValentinaSettings::GetShowGrainline() const
|
||||||
|
{
|
||||||
|
return value(*settingLayoutShowGrainline, true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VValentinaSettings::SetShowGrainline(bool value)
|
||||||
|
{
|
||||||
|
setValue(*settingLayoutShowGrainline, value);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T VValentinaSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const
|
T VValentinaSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const
|
||||||
|
|
|
@ -235,6 +235,9 @@ public:
|
||||||
auto GetBackgroundImageDefOpacity() const -> int;
|
auto GetBackgroundImageDefOpacity() const -> int;
|
||||||
void SetBackgroundImageDefOpacity(int value);
|
void SetBackgroundImageDefOpacity(int value);
|
||||||
|
|
||||||
|
bool GetShowGrainline() const;
|
||||||
|
void SetShowGrainline(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY_MOVE(VValentinaSettings) // NOLINT
|
Q_DISABLE_COPY_MOVE(VValentinaSettings) // NOLINT
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue