Added --html-parts-width/height to the command line.

This commit is contained in:
Leonardo Zide 2017-12-12 22:47:03 -08:00
parent a2b9549ce8
commit 7dd36a4d0e
2 changed files with 22 additions and 0 deletions

View file

@ -141,6 +141,8 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
int ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT); int ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT);
int ImageStart = 0; int ImageStart = 0;
int ImageEnd = 0; int ImageEnd = 0;
int PartImagesWidth = -1;
int PartImagesHeight = -1;
QString ImageName; QString ImageName;
QString ModelName; QString ModelName;
QString CameraName; QString CameraName;
@ -246,6 +248,10 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
SaveHTML = true; SaveHTML = true;
ParseString(SaveHTMLName, false); 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")) else if (Param == QLatin1String("-v") || Param == QLatin1String("--version"))
{ {
printf("LeoCAD Version " LC_VERSION_TEXT "\n"); printf("LeoCAD Version " LC_VERSION_TEXT "\n");
@ -273,6 +279,8 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
printf(" -3ds, --export-3ds <outfile.3ds>: Exports the model to 3D Studio 3DS format.\n"); printf(" -3ds, --export-3ds <outfile.3ds>: Exports the model to 3D Studio 3DS format.\n");
printf(" -dae, --export-collada <outfile.dae>: Exports the model to COLLADA DAE format.\n"); printf(" -dae, --export-collada <outfile.dae>: Exports the model to COLLADA DAE format.\n");
printf(" -html, --export-html <folder>: Creates an HTML page for the model.\n"); printf(" -html, --export-html <folder>: Creates an HTML page for the model.\n");
printf(" --html-parts-width <width>: Sets the part pictures width.\n");
printf(" --html-parts-height <height>: Sets the part pictures height.\n");
printf(" -v, --version: Output version information and exit.\n"); printf(" -v, --version: Output version information and exit.\n");
printf(" -?, --help: Display this help and exit.\n"); printf(" -?, --help: Display this help and exit.\n");
printf(" \n"); printf(" \n");
@ -470,6 +478,12 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
if (!SaveHTMLName.isEmpty()) if (!SaveHTMLName.isEmpty())
Options.PathName = SaveHTMLName; Options.PathName = SaveHTMLName;
if (PartImagesWidth > 0)
Options.PartImagesWidth = PartImagesWidth;
if (PartImagesHeight > 0)
Options.PartImagesHeight = PartImagesHeight;
mProject->ExportHTML(Options); mProject->ExportHTML(Options);
} }
} }

View file

@ -110,6 +110,14 @@ Exports the model to COLLADA DAE format.
.BI "\-html [" path ] .BI "\-html [" path ]
Creates an HTML page for the model. 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 .SH ENVIRONMENT
``LEOCAD_LIB'' may be set to the path of the parts library. ``LEOCAD_LIB'' may be set to the path of the parts library.