mirror of
https://github.com/leozide/leocad.git
synced 2026-07-28 04:07:11 +00:00
Replace automatic 'on_' naming convention with explicit connect() calls in constructors. Functions renamed to use Pascal case without underscore separators. Slots moved from public to private where appropriate. Changes made to 8 dialog files: - lc_modellistdialog.h/cpp: Renamed 9 slot functions - lc_partpalettedialog.h/cpp: Renamed 7 slot functions - lc_qhtmldialog.h/cpp: Renamed 1 slot function - lc_qimagedialog.h/cpp: Renamed 1 slot function - lc_qpreferencesdialog.h/cpp: Renamed 40 slot functions - lc_qselectdialog.h/cpp: Renamed 4 slot functions - lc_renderdialog.h/cpp: Renamed 1 slot function - lc_setsdatabasedialog.h/cpp: Renamed 1 slot function Total: 64 slot functions refactored Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
122 lines
2.1 KiB
C++
122 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#ifndef LC_DISABLE_RENDER_DIALOG
|
|
|
|
#include <QDialog>
|
|
|
|
namespace Ui {
|
|
class lcRenderDialog;
|
|
}
|
|
|
|
class lcRenderProcess : public QProcess
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit lcRenderProcess(QObject* parent = nullptr)
|
|
: QProcess(parent)
|
|
{
|
|
}
|
|
~lcRenderProcess();
|
|
};
|
|
|
|
class lcRenderPreviewWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
lcRenderPreviewWidget(QWidget* Parent)
|
|
: QWidget(Parent)
|
|
{
|
|
}
|
|
|
|
void SetImage(QImage Image)
|
|
{
|
|
mImage = Image;
|
|
mScaledImage = QImage();
|
|
update();
|
|
}
|
|
|
|
protected:
|
|
void resizeEvent(QResizeEvent* Event) override;
|
|
void paintEvent(QPaintEvent* PaintEvent) override;
|
|
|
|
QImage mImage;
|
|
QImage mScaledImage;
|
|
};
|
|
|
|
enum class lcRenderDialogMode
|
|
{
|
|
RenderPOVRay,
|
|
RenderBlender,
|
|
OpenInBlender
|
|
};
|
|
|
|
enum class lcPOVRayRenderQuality
|
|
{
|
|
Low,
|
|
Medium,
|
|
High
|
|
};
|
|
|
|
class lcRenderDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit lcRenderDialog(QWidget* Parent, lcRenderDialogMode Mode);
|
|
virtual ~lcRenderDialog();
|
|
|
|
public slots:
|
|
void reject() override;
|
|
|
|
private slots:
|
|
void OutputBrowseButtonClicked();
|
|
void Update();
|
|
|
|
protected slots:
|
|
void RenderButtonClicked();
|
|
void SettingsButtonClicked();
|
|
void LogButtonClicked();
|
|
void ReadStdOut();
|
|
void WriteStdOut();
|
|
|
|
protected:
|
|
QString GetStdOutFileName() const;
|
|
QString GetStdErrFileName() const;
|
|
QString GetPOVFileName() const;
|
|
QString ReadStdErr(bool& Error) const;
|
|
void RenderPOVRay();
|
|
void RenderBlender();
|
|
void CloseProcess();
|
|
bool PromptCancel();
|
|
void ShowResult();
|
|
|
|
QTimer mUpdateTimer;
|
|
QElapsedTimer mRenderTime;
|
|
QFile mOutputFile;
|
|
void* mOutputBuffer = nullptr;
|
|
QImage mImage;
|
|
QStringList mStdErrList;
|
|
QStringList mStdOutList;
|
|
QPushButton* mRenderButton = nullptr;
|
|
QPushButton* mSettingsButton = nullptr;
|
|
QPushButton* mLogButton = nullptr;
|
|
lcRenderProcess* mProcess = nullptr;
|
|
|
|
int mWidth = 1280;
|
|
int mHeight = 720;
|
|
lcPOVRayRenderQuality mQuality = lcPOVRayRenderQuality::High;
|
|
int mPreviewWidth;
|
|
int mPreviewHeight;
|
|
lcRenderDialogMode mDialogMode;
|
|
int mBlendProgValue;
|
|
int mBlendProgMax;
|
|
double mScale;
|
|
QString mDataPath;
|
|
|
|
Ui::lcRenderDialog* ui;
|
|
};
|
|
|
|
#endif // LC_DISABLE_RENDER_DIALOG
|