leocad/common/lc_previewwidget.h
2020-12-17 17:59:11 -08:00

70 lines
1.3 KiB
C++

#pragma once
#include "lc_glwidget.h"
#include "lc_scene.h"
#include "lc_commands.h"
class lcPreviewWidget;
class lcPreviewDockWidget : public QMainWindow
{
Q_OBJECT
public:
explicit lcPreviewDockWidget(QMainWindow* Parent = nullptr);
bool SetCurrentPiece(const QString& PartType, int ColorCode);
void ClearPreview();
void UpdatePreview();
protected slots:
void SetPreviewLock();
protected:
QAction* mLockAction;
QToolBar* mToolBar;
QLabel* mLabel;
lcPreviewWidget* mPreview;
lcViewWidget* mViewWidget;
};
class lcPreviewWidget : public lcGLWidget
{
public:
lcPreviewWidget();
~lcPreviewWidget();
QString GetDescription() const
{
return mDescription;
}
bool IsModel() const
{
return mIsModel;
}
void ClearPreview();
void UpdatePreview();
bool SetCurrentPiece(const QString& PartType, int ColorCode);
void StartOrbitTracking();
void OnDraw() override;
void OnLeftButtonDown() override;
void OnLeftButtonUp() override;
void OnLeftButtonDoubleClick() override;
void OnMiddleButtonDown() override;
void OnMiddleButtonUp() override;
void OnRightButtonDown() override;
void OnRightButtonUp() override;
void OnMouseMove() override;
protected:
void StopTracking(bool Accept);
void OnButtonDown(lcTrackButton TrackButton);
Project* mLoader;
QString mDescription;
bool mIsModel;
};