diff --git a/common/image.h b/common/image.h index c99b8a3f..4422833a 100644 --- a/common/image.h +++ b/common/image.h @@ -3,7 +3,7 @@ // Image Options #define LC_IMAGE_TRANSPARENT 0x2000 -#define LC_IMAGE_MASK 0x7000 +//#define LC_IMAGE_MASK 0x7000 enum LC_IMAGE_FORMAT { diff --git a/common/lc_basewindow.h b/common/lc_basewindow.h index 8169ec23..583a8baf 100644 --- a/common/lc_basewindow.h +++ b/common/lc_basewindow.h @@ -37,8 +37,9 @@ struct lcImageDialogOptions struct lcHTMLDialogOptions { QString PathName; - LC_IMAGE_FORMAT ImageFormat; bool TransparentImages; + bool SubModels; + bool CurrentOnly; bool SinglePage; bool IndexPage; int StepImagesWidth; diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 6f7d4dd3..b10287e5 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -2729,6 +2729,21 @@ lcModel* lcModel::GetFirstSelectedSubmodel() const return NULL; } +void lcModel::GetSubModels(lcArray SubModels) const +{ + for (int PieceIdx = 0; PieceIdx < mPieces.GetSize(); PieceIdx++) + { + lcPiece* Piece = mPieces[PieceIdx]; + + if (Piece->mPieceInfo->IsModel()) + { + lcModel* SubModel = Piece->mPieceInfo->GetModel(); + if (SubModels.FindIndex(SubModel) != -1) + SubModels.Add(SubModel); + } + } +} + bool lcModel::GetMoveRotateTransform(lcVector3& Center, lcMatrix33& RelativeRotation) const { bool Relative = gMainWindow->GetRelativeTransform(); diff --git a/common/lc_model.h b/common/lc_model.h index 0b39eb49..6ff4b471 100644 --- a/common/lc_model.h +++ b/common/lc_model.h @@ -229,6 +229,7 @@ public: bool AnyPiecesSelected() const; bool AnyObjectsSelected() const; lcModel* GetFirstSelectedSubmodel() const; + void GetSubModels(lcArray SubModels) const; bool GetMoveRotateTransform(lcVector3& Center, lcMatrix33& RelativeRotation) const; bool GetPieceFocusOrSelectionCenter(lcVector3& Center) const; lcVector3 GetSelectionOrModelCenter() const; diff --git a/common/project.cpp b/common/project.cpp index d651da55..28ac97de 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -969,7 +969,7 @@ void Project::ExportCSV() setlocale(LC_NUMERIC, OldLocale); } -void Project::CreateHTMLPieceList(QTextStream& Stream, lcModel* Model, lcStep Step, bool Images, const QString& ImageExtension) +void Project::CreateHTMLPieceList(QTextStream& Stream, lcModel* Model, lcStep Step, bool Images) { int* ColorsUsed = new int[gColorList.GetSize()]; memset(ColorsUsed, 0, sizeof(ColorsUsed[0]) * gColorList.GetSize()); @@ -1018,7 +1018,7 @@ void Project::CreateHTMLPieceList(QTextStream& Stream, lcModel* Model, lcStep St if (Add) { if (Images) - Stream << QString("\"%3\"\n").arg(pInfo->m_strName, ImageExtension, pInfo->m_strDescription); + Stream << QString("\"%2\"\n").arg(pInfo->m_strName, pInfo->m_strDescription); else Stream << QString("%1\r\n").arg(pInfo->m_strDescription); @@ -1063,8 +1063,9 @@ void Project::ExportHTML() int ImageOptions = lcGetProfileInt(LC_PROFILE_HTML_IMAGE_OPTIONS); int HTMLOptions = lcGetProfileInt(LC_PROFILE_HTML_OPTIONS); - Options.ImageFormat = (LC_IMAGE_FORMAT)(ImageOptions & ~(LC_IMAGE_MASK)); Options.TransparentImages = (ImageOptions & LC_IMAGE_TRANSPARENT) != 0; + Options.SubModels = (HTMLOptions & (LC_HTML_SUBMODELS)) != 0; + Options.CurrentOnly = (HTMLOptions & LC_HTML_CURRENT_ONLY) != 0; Options.SinglePage = (HTMLOptions & LC_HTML_SINGLEPAGE) != 0; Options.IndexPage = (HTMLOptions & LC_HTML_INDEX) != 0; Options.StepImagesWidth = lcGetProfileInt(LC_PROFILE_HTML_IMAGE_WIDTH); @@ -1082,6 +1083,10 @@ void Project::ExportHTML() HTMLOptions = 0; + if (Options.SubModels) + HTMLOptions |= LC_HTML_SUBMODELS; + if (Options.CurrentOnly) + HTMLOptions |= LC_HTML_CURRENT_ONLY; if (Options.SinglePage) HTMLOptions |= LC_HTML_SINGLEPAGE; if (Options.IndexPage) @@ -1095,12 +1100,7 @@ void Project::ExportHTML() if (Options.PartsListImages) HTMLOptions |= LC_HTML_IMAGES; - ImageOptions = Options.ImageFormat; - - if (Options.TransparentImages) - ImageOptions |= LC_IMAGE_TRANSPARENT; - - lcSetProfileInt(LC_PROFILE_HTML_IMAGE_OPTIONS, ImageOptions); + lcSetProfileInt(LC_PROFILE_HTML_IMAGE_OPTIONS, Options.TransparentImages ? LC_IMAGE_TRANSPARENT : 0); lcSetProfileInt(LC_PROFILE_HTML_OPTIONS, HTMLOptions); lcSetProfileInt(LC_PROFILE_HTML_IMAGE_WIDTH, Options.StepImagesWidth); lcSetProfileInt(LC_PROFILE_HTML_IMAGE_HEIGHT, Options.StepImagesHeight); @@ -1111,31 +1111,217 @@ void Project::ExportHTML() QDir Dir(Options.PathName); Dir.mkpath(QLatin1String(".")); - QString Title = GetTitle(); - QString BaseName = Title.left(Title.length() - QFileInfo(Title).suffix().length() - 1); - QString HTMLExtension = QLatin1String(".html"); - QString ImageExtension; + lcArray Models; - switch (Options.ImageFormat) + if (Options.CurrentOnly) + Models.Add(mActiveModel); + else if (Options.SubModels) { - case LC_IMAGE_BMP: - ImageExtension = QLatin1String(".bmp"); - break; - case LC_IMAGE_JPG: - ImageExtension = QLatin1String(".jpg"); - break; - default: - case LC_IMAGE_PNG: - ImageExtension = QLatin1String(".png"); - break; + Models.Add(mActiveModel); + mActiveModel->GetSubModels(Models); } - - lcModel* Model = mModels[0]; - lcStep LastStep = Model->GetLastStep(); + else + Models = mModels; - if (Options.SinglePage) + QString ProjectTitle = GetTitle(); + + for (int ModelIdx = 0; ModelIdx < Models.GetSize(); ModelIdx++) { - QString FileName = QFileInfo(Dir, BaseName + HTMLExtension).absoluteFilePath(); + lcModel* Model = mModels[ModelIdx]; + QString BaseName = ProjectTitle.left(ProjectTitle.length() - QFileInfo(ProjectTitle).suffix().length() - 1); + lcStep LastStep = Model->GetLastStep(); + QString PageTitle; + + if (Models.GetSize() > 1) + { + BaseName += '-' + Model->GetProperties().mName; + PageTitle = Model->GetProperties().mName; + } + else + PageTitle = ProjectTitle; + BaseName.replace('#', '_'); + + if (Options.SinglePage) + { + QString FileName = QFileInfo(Dir, BaseName + QLatin1String(".html")).absoluteFilePath(); + QFile File(FileName); + + if (!File.open(QIODevice::WriteOnly)) + { + QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); + return; + } + + QTextStream Stream(&File); + + Stream << QString::fromLatin1("\r\n\r\nInstructions for %1\r\n\r\n
\r\n
\r\n").arg(PageTitle); + + for (lcStep Step = 1; Step <= LastStep; Step++) + { + QString StepString = QString::fromLatin1("%1").arg(Step, 2, 10, QLatin1Char('0')); + Stream << QString::fromLatin1("\"Step

\r\n").arg(BaseName, StepString, StepString, QString::number(Options.StepImagesWidth), QString::number(Options.StepImagesHeight)); + + if (Options.PartsListStep) + CreateHTMLPieceList(Stream, Model, Step, Options.PartsListImages); + } + + if (Options.PartsListEnd) + CreateHTMLPieceList(Stream, Model, 0, Options.PartsListImages); + + Stream << QLatin1String("
\n


Created by LeoCAD
\r\n"); + } + else + { + if (Options.IndexPage) + { + QString FileName = QFileInfo(Dir, BaseName + QLatin1String("-index.html")).absoluteFilePath(); + QFile File(FileName); + + if (!File.open(QIODevice::WriteOnly)) + { + QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); + return; + } + + QTextStream Stream(&File); + + Stream << QString::fromLatin1("\r\n\r\nInstructions for %1\r\n\r\n
\r\n
\r\n").arg(PageTitle); + + for (lcStep Step = 1; Step <= LastStep; Step++) + Stream << QString::fromLatin1("Step %3
\r\n
").arg(BaseName, QString("%1").arg(Step, 2, 10, QLatin1Char('0')), QString::number(Step)); + + if (Options.PartsListEnd) + Stream << QString::fromLatin1("Pieces Used
\r\n").arg(BaseName); + + Stream << QLatin1String("
\r\n


Created by LeoCAD
\r\n"); + } + + for (lcStep Step = 1; Step <= LastStep; Step++) + { + QString StepString = QString::fromLatin1("%1").arg(Step, 2, 10, QLatin1Char('0')); + QString FileName = QFileInfo(Dir, QString("%1-%2.html").arg(BaseName, StepString)).absoluteFilePath(); + QFile File(FileName); + + if (!File.open(QIODevice::WriteOnly)) + { + QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); + return; + } + + QTextStream Stream(&File); + + Stream << QString::fromLatin1("\r\n\r\n%1 - Step %2\r\n\r\n
\r\n
\r\n").arg(PageTitle, QString::number(Step)); + Stream << QString::fromLatin1("\"Step

\r\n").arg(BaseName, StepString, StepString, QString::number(Options.StepImagesWidth), QString::number(Options.StepImagesHeight)); + + if (Options.PartsListStep) + CreateHTMLPieceList(Stream, Model, Step, Options.PartsListImages); + + Stream << QLatin1String("
\r\n


"); + if (Step != 1) + Stream << QString::fromLatin1("Previous ").arg(BaseName, QString("%1").arg(Step - 1, 2, 10, QLatin1Char('0'))); + + if (Options.IndexPage) + Stream << QString::fromLatin1("Index ").arg(BaseName); + + if (Step != LastStep) + Stream << QString::fromLatin1("Next").arg(BaseName, QString("%1").arg(Step + 1, 2, 10, QLatin1Char('0'))); + else if (Options.PartsListEnd) + Stream << QString::fromLatin1("Pieces Used").arg(BaseName); + + Stream << QLatin1String("
\r\n"); + } + + if (Options.PartsListEnd) + { + QString FileName = QFileInfo(Dir, BaseName + QLatin1String("-pieces.html")).absoluteFilePath(); + QFile File(FileName); + + if (!File.open(QIODevice::WriteOnly)) + { + QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); + return; + } + + QTextStream Stream(&File); + + Stream << QString::fromLatin1("\r\n\r\nPieces used by %1\r\n\r\n
\r\n
\n").arg(PageTitle); + + CreateHTMLPieceList(Stream, Model, 0, Options.PartsListImages); + + Stream << QLatin1String("
\n


"); + Stream << QString::fromLatin1("Previous ").arg(BaseName, QString("%1").arg(LastStep, 2, 10, QLatin1Char('0'))); + + if (Options.IndexPage) + Stream << QString::fromLatin1("Index ").arg(BaseName); + + Stream << QLatin1String("
\r\n"); + } + } + + QString StepImageBaseName = QFileInfo(Dir, BaseName + QLatin1String("-%1.png")).absoluteFilePath(); + Model->SaveStepImages(StepImageBaseName, Options.StepImagesWidth, Options.StepImagesHeight, 1, LastStep); + + if (Options.PartsListImages) + { + gMainWindow->mPreviewWidget->MakeCurrent(); + lcContext* Context = gMainWindow->mPreviewWidget->mContext; + int Width = Options.PartImagesWidth; + int Height = Options.PartImagesHeight; + + if (!Context->BeginRenderToTexture(Width, Height)) + { + QMessageBox::warning(gMainWindow, tr("LeoCAD"), tr("Error creating images.")); + return; + } + + float aspect = (float)Width / (float)Height; + Context->SetViewport(0, 0, Width, Height); + + lcArray PartsList; + Model->GetPartsList(gDefaultColor, PartsList); + + lcMatrix44 ProjectionMatrix = lcMatrix44Perspective(30.0f, aspect, 1.0f, 2500.0f); + lcMatrix44 ViewMatrix; + + Context->SetDefaultState(); + Context->SetProjectionMatrix(ProjectionMatrix); + Context->SetProgram(LC_PROGRAM_SIMPLE); + + for (int PieceIdx = 0; PieceIdx < PartsList.GetSize(); PieceIdx++) + { + PieceInfo* Info = PartsList[PieceIdx].Info; + + glClearColor(1.0f, 1.0f, 1.0f, 0.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + lcVector3 CameraPosition(-100.0f, -100.0f, 75.0f); + Info->ZoomExtents(ProjectionMatrix, ViewMatrix, CameraPosition); + + lcScene Scene; + Scene.Begin(ViewMatrix); + + Info->AddRenderMeshes(Scene, lcMatrix44Identity(), Options.PartImagesColor, false, false); + + Scene.End(); + + Context->SetViewMatrix(ViewMatrix); + Context->DrawOpaqueMeshes(Scene.mOpaqueMeshes); + Context->DrawTranslucentMeshes(Scene.mTranslucentMeshes); + + Context->UnbindMesh(); // context remove + + QString FileName = QFileInfo(Dir, QLatin1String(Info->m_strName) + QLatin1String(".png")).absoluteFilePath(); + if (!Context->SaveRenderToTextureImage(FileName, Width, Height)) + break; + } + Context->EndRenderToTexture(); + } + } + + if (Models.GetSize() > 1) + { + QString BaseName = ProjectTitle.left(ProjectTitle.length() - QFileInfo(ProjectTitle).suffix().length() - 1); + QString FileName = QFileInfo(Dir, BaseName + QLatin1String("-index.html")).absoluteFilePath(); QFile File(FileName); if (!File.open(QIODevice::WriteOnly)) @@ -1146,168 +1332,24 @@ void Project::ExportHTML() QTextStream Stream(&File); - Stream << QString("\r\n\r\nInstructions for %1\r\n\r\n
\r\n
\r\n").arg(Title); + Stream << QString::fromLatin1("\r\n\r\nInstructions for %1\r\n\r\n
\r\n
\r\n").arg(ProjectTitle); - for (lcStep Step = 1; Step <= LastStep; Step++) + for (int ModelIdx = 0; ModelIdx < Models.GetSize(); ModelIdx++) { - QString StepString = QString("%1").arg(Step, 2, 10, QLatin1Char('0')); - Stream << QString("\"Step

\r\n").arg(BaseName, StepString, ImageExtension, StepString, QString::number(Options.StepImagesWidth), QString::number(Options.StepImagesHeight)); + lcModel* Model = Models[ModelIdx]; + QString BaseName = ProjectTitle.left(ProjectTitle.length() - QFileInfo(ProjectTitle).suffix().length() - 1) + '-' + Model->GetProperties().mName; + BaseName.replace('#', '_'); - if (Options.PartsListStep) - CreateHTMLPieceList(Stream, Model, Step, Options.PartsListImages, ImageExtension); + if (Options.SinglePage) + FileName = BaseName + QLatin1String(".html"); + else + FileName = BaseName + QLatin1String("-index.html"); + + Stream << QString::fromLatin1("

%2").arg(FileName, Model->GetProperties().mName); } - if (Options.PartsListEnd) - CreateHTMLPieceList(Stream, Model, 0, Options.PartsListImages, ImageExtension); - Stream << QLatin1String("

\n


Created by LeoCAD
\r\n"); } - else - { - if (Options.IndexPage) - { - QString FileName = QFileInfo(Dir, BaseName + QLatin1String("-index") + HTMLExtension).absoluteFilePath(); - QFile File(FileName); - - if (!File.open(QIODevice::WriteOnly)) - { - QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); - return; - } - - QTextStream Stream(&File); - - Stream << QString("\r\n\r\nInstructions for %1\r\n\r\n
\r\n
\r\n").arg(Title); - - for (lcStep Step = 1; Step <= LastStep; Step++) - Stream << QString("Step %3
\r\n
").arg(BaseName, QString("%1").arg(Step, 2, 10, QLatin1Char('0')), QString::number(Step)); - - if (Options.PartsListEnd) - Stream << QString("Pieces Used
\r\n").arg(BaseName); - - Stream << QLatin1String("
\r\n


Created by LeoCAD
\r\n"); - } - - for (lcStep Step = 1; Step <= LastStep; Step++) - { - QString StepString = QString("%1").arg(Step, 2, 10, QLatin1Char('0')); - QString FileName = QFileInfo(Dir, BaseName + QLatin1String("-") + StepString + HTMLExtension).absoluteFilePath(); - QFile File(FileName); - - if (!File.open(QIODevice::WriteOnly)) - { - QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); - return; - } - - QTextStream Stream(&File); - - Stream << QString("\r\n\r\n%1 - Step %2\r\n\r\n
\r\n
\r\n").arg(Title, QString::number(Step)); - Stream << QString("\"Step

\r\n").arg(BaseName, StepString, ImageExtension, StepString, QString::number(Options.StepImagesWidth), QString::number(Options.StepImagesHeight)); - - if (Options.PartsListStep) - CreateHTMLPieceList(Stream, Model, Step, Options.PartsListImages, ImageExtension); - - Stream << QLatin1String("
\r\n


"); - if (Step != 1) - Stream << QString("Previous ").arg(BaseName, QString("%1").arg(Step - 1, 2, 10, QLatin1Char('0'))); - - if (Options.IndexPage) - Stream << QString("Index ").arg(BaseName); - - if (Step != LastStep) - Stream << QString("Next").arg(BaseName, QString("%1").arg(Step + 1, 2, 10, QLatin1Char('0'))); - else if (Options.PartsListEnd) - Stream << QString("Pieces Used").arg(BaseName); - - Stream << QLatin1String("
\r\n"); - } - - if (Options.PartsListEnd) - { - QString FileName = QFileInfo(Dir, BaseName + QLatin1String("-pieces") + HTMLExtension).absoluteFilePath(); - QFile File(FileName); - - if (!File.open(QIODevice::WriteOnly)) - { - QMessageBox::warning(gMainWindow, tr("Error"), tr("Error writing to file '%1':\n%2").arg(FileName, File.errorString())); - return; - } - - QTextStream Stream(&File); - - Stream << QString("\r\n\r\nPieces used by %1\r\n\r\n
\r\n
\n").arg(Title); - - CreateHTMLPieceList(Stream, Model, 0, Options.PartsListImages, ImageExtension); - - Stream << QLatin1String("
\n


"); - Stream << QString("Previous ").arg(BaseName, QString("%1").arg(LastStep, 2, 10, QLatin1Char('0'))); - - if (Options.IndexPage) - Stream << QString("Index ").arg(BaseName); - - Stream << QLatin1String("
\r\n"); - } - } - - QString StepImageBaseName = QFileInfo(Dir, BaseName + QLatin1String("-%1") + ImageExtension).absoluteFilePath(); - Model->SaveStepImages(StepImageBaseName, Options.StepImagesWidth, Options.StepImagesHeight, 1, LastStep); - - if (Options.PartsListImages) - { - gMainWindow->mPreviewWidget->MakeCurrent(); - lcContext* Context = gMainWindow->mPreviewWidget->mContext; - int Width = Options.PartImagesWidth; - int Height = Options.PartImagesHeight; - - if (!Context->BeginRenderToTexture(Width, Height)) - { - QMessageBox::warning(gMainWindow, tr("LeoCAD"), tr("Error creating images.")); - return; - } - - float aspect = (float)Width/(float)Height; - Context->SetViewport(0, 0, Width, Height); - - lcArray PartsList; - Model->GetPartsList(gDefaultColor, PartsList); - - lcMatrix44 ProjectionMatrix = lcMatrix44Perspective(30.0f, aspect, 1.0f, 2500.0f); - lcMatrix44 ViewMatrix; - - Context->SetDefaultState(); - Context->SetProjectionMatrix(ProjectionMatrix); - Context->SetProgram(LC_PROGRAM_SIMPLE); - - for (int PieceIdx = 0; PieceIdx < PartsList.GetSize(); PieceIdx++) - { - PieceInfo* Info = PartsList[PieceIdx].Info; - - glClearColor(1.0f, 1.0f, 1.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - lcVector3 CameraPosition(-100.0f, -100.0f, 75.0f); - Info->ZoomExtents(ProjectionMatrix, ViewMatrix, CameraPosition); - - lcScene Scene; - Scene.Begin(ViewMatrix); - - Info->AddRenderMeshes(Scene, lcMatrix44Identity(), Options.PartImagesColor, false, false); - - Scene.End(); - - Context->SetViewMatrix(ViewMatrix); - Context->DrawOpaqueMeshes(Scene.mOpaqueMeshes); - Context->DrawTranslucentMeshes(Scene.mTranslucentMeshes); - - Context->UnbindMesh(); // context remove - - QString FileName = QFileInfo(Dir, Info->m_strName + ImageExtension).absoluteFilePath(); - if (!Context->SaveRenderToTextureImage(FileName, Width, Height)) - break; - } - Context->EndRenderToTexture(); - } } void Project::ExportPOVRay() diff --git a/common/project.h b/common/project.h index cee08452..7d4d3925 100644 --- a/common/project.h +++ b/common/project.h @@ -10,14 +10,14 @@ #define LC_SCENE_BG_TILE 0x040 // Tile bg image #define LC_SCENE_GRADIENT 0x100 // Draw gradient -#define LC_HTML_SINGLEPAGE 0x01 -#define LC_HTML_INDEX 0x02 -#define LC_HTML_IMAGES 0x04 -#define LC_HTML_LISTEND 0x08 -#define LC_HTML_LISTSTEP 0x10 -#define LC_HTML_HIGHLIGHT 0x20 -//#define LC_HTML_HTMLEXT 0x40 -//#define LC_HTML_LISTID 0x80 +#define LC_HTML_SINGLEPAGE 0x01 +#define LC_HTML_INDEX 0x02 +#define LC_HTML_IMAGES 0x04 +#define LC_HTML_LISTEND 0x08 +#define LC_HTML_LISTSTEP 0x10 +#define LC_HTML_HIGHLIGHT 0x20 +#define LC_HTML_SUBMODELS 0x40 +#define LC_HTML_CURRENT_ONLY 0x80 enum LC_MOUSE_TRACK { @@ -70,7 +70,7 @@ public: protected: QString GetExportFileName(const QString& FileName, const QString& DefaultExtension, const QString& DialogTitle, const QString& DialogFilter) const; void GetModelParts(lcArray& ModelParts); - void CreateHTMLPieceList(QTextStream& Stream, lcModel* Model, lcStep Step, bool Images, const QString& ImageExtension); + void CreateHTMLPieceList(QTextStream& Stream, lcModel* Model, lcStep Step, bool Images); bool mModified; QString mFileName; diff --git a/qt/lc_qhtmldialog.cpp b/qt/lc_qhtmldialog.cpp index 4f4028e7..7f524694 100644 --- a/qt/lc_qhtmldialog.cpp +++ b/qt/lc_qhtmldialog.cpp @@ -17,7 +17,14 @@ lcQHTMLDialog::lcQHTMLDialog(QWidget *parent, void *data) : options = (lcHTMLDialogOptions*)data; ui->outputFolder->setText(QDir::toNativeSeparators(options->PathName)); - ui->imageFormat->setCurrentIndex(options->ImageFormat); + + if (options->CurrentOnly) + ui->currentModelOnly->setChecked(true); + else if (options->SubModels) + ui->currentModelSubmodels->setChecked(true); + else + ui->allModels->setChecked(true); + ui->transparentImages->setChecked(options->TransparentImages); ui->singlePage->setChecked(options->SinglePage); ui->oneStepPerPage->setChecked(!options->SinglePage); @@ -49,7 +56,8 @@ void lcQHTMLDialog::accept() } options->PathName = pathName; - options->ImageFormat = (LC_IMAGE_FORMAT)ui->imageFormat->currentIndex(); + options->SubModels = ui->currentModelSubmodels->isChecked(); + options->CurrentOnly = ui->currentModelOnly->isChecked(); options->TransparentImages = ui->transparentImages->isChecked(); options->SinglePage = ui->singlePage->isChecked(); options->IndexPage = ui->indexPage->isChecked(); diff --git a/qt/lc_qhtmldialog.ui b/qt/lc_qhtmldialog.ui index b11557d1..cd02479f 100644 --- a/qt/lc_qhtmldialog.ui +++ b/qt/lc_qhtmldialog.ui @@ -7,34 +7,43 @@ 0 0 400 - 553 + 617 + + + 0 + 0 + + HTML Options + + + 0 + 0 + + General - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Output folder: - - - outputFolder - - - - + + + + + + Output folder: + + + outputFolder + + + @@ -47,37 +56,41 @@ - - - - Image format: - - - - + Transparent image background - - - - - BMP - - - - - JPEG - - - - - PNG - - + + + + + + + Models + + + + + + All Models + + + + + + + Current Model and Submodels + + + + + + + Current Model Only + @@ -86,20 +99,27 @@ - Layout + Steps - Single page + Single Page - One step per page + One Step per Page + + + + + + + Index page @@ -113,16 +133,6 @@ - - - - Height: - - - stepHeight - - - @@ -133,6 +143,16 @@ + + + + Height: + + + stepHeight + + + @@ -143,13 +163,6 @@ - - - - Index page - - - @@ -294,11 +307,12 @@ - buttonBox outputFolder outputFolderBrowse - imageFormat transparentImages + allModels + currentModelSubmodels + currentModelOnly singlePage oneStepPerPage indexPage @@ -308,6 +322,7 @@ partsAfterEachStep partsAtTheEnd partImages + partColor partImagesWidth partImagesHeight