Widget cleanup.

This commit is contained in:
Leonardo 2020-12-04 16:52:57 -08:00
parent 7b320edc7a
commit 525df8ad21
3 changed files with 15 additions and 28 deletions

View file

@ -32,6 +32,14 @@ enum class lcCursor
Count
};
enum class lcTrackButton
{
None,
Left,
Middle,
Right
};
struct lcInputState
{
int x = 0;
@ -53,6 +61,11 @@ public:
return mCamera;
}
bool IsTracking() const
{
return mTrackButton != lcTrackButton::None;
}
void SetContext(lcContext* Context);
void MakeCurrent();
void Redraw();
@ -88,11 +101,12 @@ public:
lcInputState mInputState;
int mWidth = 1;
int mHeight = 1;
lcCursor mCursor = lcCursor::Default;
QGLWidget* mWidget = nullptr;
lcContext* mContext = nullptr;
protected:
lcCamera* mCamera = nullptr;
bool mDeleteContext = true;
lcCursor mCursor = lcCursor::Default;
lcTrackButton mTrackButton = lcTrackButton::None;
};

View file

@ -32,14 +32,6 @@ protected:
class lcPreviewWidget : public lcGLWidget
{
public:
enum class lcTrackButton
{
None,
Left,
Middle,
Right
};
enum class lcTrackTool
{
None,
@ -73,10 +65,6 @@ public:
// exclusively called from viewSphere
void SetViewpoint(const lcVector3& Position);
void StartOrbitTracking();
bool IsTracking() const
{
return mTrackButton != lcTrackButton::None;
}
bool IsModel() const
{
@ -111,7 +99,6 @@ protected:
lcScene mScene;
lcTool mTool;
lcTrackButton mTrackButton;
lcTrackTool mTrackTool;
QString mDescription;

View file

@ -6,14 +6,6 @@
#include "lc_viewsphere.h"
#include "lc_commands.h"
enum class lcTrackButton
{
None,
Left,
Middle,
Right
};
enum class lcTrackTool
{
None,
@ -95,11 +87,6 @@ public:
void BeginDrag(lcDragState DragState) override;
void EndDrag(bool Accept) override;
bool IsTracking() const
{
return mTrackButton != lcTrackButton::None;
}
void StartOrbitTracking();
void CancelTrackingOrClearSelection();
@ -161,7 +148,6 @@ protected:
lcScene mScene;
lcDragState mDragState;
lcTrackButton mTrackButton;
lcTrackTool mTrackTool;
bool mTrackToolFromOverlay;
bool mTrackUpdated;