leocad/common/lc_previewwidget.h

74 lines
1.4 KiB
C
Raw Normal View History

#pragma once
#include "lc_glwidget.h"
#include "lc_scene.h"
#include "lc_viewsphere.h"
#include "lc_commands.h"
class lcQGLWidget;
2020-12-04 21:49:01 +01:00
class lcPreviewWidget;
class lcPreviewDockWidget : public QMainWindow
{
Q_OBJECT
public:
2020-12-04 21:49:01 +01:00
explicit lcPreviewDockWidget(QMainWindow* Parent = nullptr);
bool SetCurrentPiece(const QString& PartType, int ColorCode);
void ClearPreview();
void UpdatePreview();
2020-10-07 13:42:43 +02:00
protected slots:
void SetPreviewLock();
protected:
2020-10-07 13:42:43 +02:00
QAction* mLockAction;
QToolBar* mToolBar;
QLabel* mLabel;
lcPreviewWidget* mPreview;
lcQGLWidget* 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;
lcViewSphere mViewSphere;
QString mDescription;
bool mIsModel;
};