From 7dd36a4d0e8b208bac968b7f37a20f0ac77938cf Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Tue, 12 Dec 2017 22:47:03 -0800 Subject: [PATCH] Added --html-parts-width/height to the command line. --- common/lc_application.cpp | 14 ++++++++++++++ docs/leocad.1 | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/common/lc_application.cpp b/common/lc_application.cpp index c8643123..70172476 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -141,6 +141,8 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& int ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT); int ImageStart = 0; int ImageEnd = 0; + int PartImagesWidth = -1; + int PartImagesHeight = -1; QString ImageName; QString ModelName; QString CameraName; @@ -246,6 +248,10 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& SaveHTML = true; ParseString(SaveHTMLName, false); } + else if (Param == QLatin1String("--html-parts-width")) + ParseInteger(PartImagesWidth); + else if (Param == QLatin1String("--html-parts-height")) + ParseInteger(PartImagesHeight); else if (Param == QLatin1String("-v") || Param == QLatin1String("--version")) { printf("LeoCAD Version " LC_VERSION_TEXT "\n"); @@ -273,6 +279,8 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& printf(" -3ds, --export-3ds : Exports the model to 3D Studio 3DS format.\n"); printf(" -dae, --export-collada : Exports the model to COLLADA DAE format.\n"); printf(" -html, --export-html : Creates an HTML page for the model.\n"); + printf(" --html-parts-width : Sets the part pictures width.\n"); + printf(" --html-parts-height : Sets the part pictures height.\n"); printf(" -v, --version: Output version information and exit.\n"); printf(" -?, --help: Display this help and exit.\n"); printf(" \n"); @@ -470,6 +478,12 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& if (!SaveHTMLName.isEmpty()) Options.PathName = SaveHTMLName; + if (PartImagesWidth > 0) + Options.PartImagesWidth = PartImagesWidth; + + if (PartImagesHeight > 0) + Options.PartImagesHeight = PartImagesHeight; + mProject->ExportHTML(Options); } } diff --git a/docs/leocad.1 b/docs/leocad.1 index a5de2293..5aaa8113 100644 --- a/docs/leocad.1 +++ b/docs/leocad.1 @@ -110,6 +110,14 @@ Exports the model to COLLADA DAE format. .BI "\-html [" path ] Creates an HTML page for the model. +.TP +.BI "\-\-html\-parts\-width "width +Sets the width of the part pictures when creating HTML pages to \fIwidth\fR. + +.TP +.BI "\-\-html\-parts\-height "height +Sets the height of the part pictures when creating HTML pages to \fIheight\fR. + .SH ENVIRONMENT ``LEOCAD_LIB'' may be set to the path of the parts library.