Replaced includes with forward declares.

This commit is contained in:
Leonardo Zide 2020-12-15 18:47:58 -08:00
parent c2d1b5ce7c
commit dac9b599a5
10 changed files with 26 additions and 18 deletions

View file

@ -9,6 +9,7 @@
#include "lc_partselectionwidget.h"
#include "lc_shortcuts.h"
#include "view.h"
#include "camera.h"
#include "lc_previewwidget.h"
lcApplication* gApplication;

View file

@ -80,8 +80,10 @@ class lcContext;
class lcMesh;
struct lcMeshSection;
struct lcRenderMesh;
struct lcObjectSection;
class lcTexture;
class lcScene;
class lcViewSphere;
enum class lcRenderMeshState : int;
class lcFile;

View file

@ -8,6 +8,7 @@
#include "texfont.h"
#include "lc_model.h"
#include "lc_scene.h"
#include "lc_viewsphere.h"
lcGLWidget* lcGLWidget::mLastFocusedView;
std::vector<lcGLWidget*> lcGLWidget::mViews;

View file

@ -218,6 +218,7 @@ protected:
lcCursor mCursor = lcCursor::Default;
std::unique_ptr<lcScene> mScene;
std::unique_ptr<lcViewSphere> mViewSphere;
lcModel* mModel = nullptr;
lcPiece* mActiveSubmodelInstance = nullptr;

View file

@ -19,6 +19,7 @@
#include "view.h"
#include "project.h"
#include "piece.h"
#include "camera.h"
#include "group.h"
#include "pieceinf.h"
#include "lc_library.h"

View file

@ -6,6 +6,7 @@
#include "lc_model.h"
#include "camera.h"
#include "lc_library.h"
#include "lc_viewsphere.h"
#include "lc_qglwidget.h"
@ -80,8 +81,9 @@ void lcPreviewDockWidget::SetPreviewLock()
}
lcPreviewWidget::lcPreviewWidget()
: lcGLWidget(nullptr), mLoader(new Project(true)), mViewSphere(this)
: lcGLWidget(nullptr), mLoader(new Project(true))
{
mViewSphere = std::unique_ptr<lcViewSphere>(new lcViewSphere(this));
mLoader->SetActiveModel(0);
mModel = mLoader->GetActiveModel();
@ -286,7 +288,7 @@ void lcPreviewWidget::OnDraw()
DrawAxes();
if (Preferences.mDrawPreviewViewSphere)
mViewSphere.Draw();
mViewSphere->Draw();
DrawViewport();
}
@ -301,7 +303,7 @@ void lcPreviewWidget::OnLeftButtonDown()
return;
}
if (mViewSphere.OnLeftButtonDown())
if (mViewSphere->OnLeftButtonDown())
return;
lcTrackTool OverrideTool = lcTrackTool::OrbitXY;
@ -319,7 +321,8 @@ void lcPreviewWidget::OnLeftButtonUp()
{
StopTracking(mTrackButton == lcTrackButton::Left);
if (mViewSphere.OnLeftButtonUp()) {
if (mViewSphere->OnLeftButtonUp())
{
ZoomExtents();
return;
}
@ -390,9 +393,9 @@ void lcPreviewWidget::OnMouseMove()
if (mTrackButton == lcTrackButton::None)
{
if (mViewSphere.OnMouseMove())
if (mViewSphere->OnMouseMove())
{
lcTrackTool NewTrackTool = mViewSphere.IsDragging() ? lcTrackTool::OrbitXY : lcTrackTool::None;
lcTrackTool NewTrackTool = mViewSphere->IsDragging() ? lcTrackTool::OrbitXY : lcTrackTool::None;
if (NewTrackTool != mTrackTool)
{

View file

@ -2,7 +2,6 @@
#include "lc_glwidget.h"
#include "lc_scene.h"
#include "lc_viewsphere.h"
#include "lc_commands.h"
class lcQGLWidget;
@ -66,7 +65,6 @@ protected:
void OnButtonDown(lcTrackButton TrackButton);
Project* mLoader;
lcViewSphere mViewSphere;
QString mDescription;
bool mIsModel;

View file

@ -2,7 +2,7 @@
#include "lc_viewsphere.h"
#include "view.h"
#include "lc_previewwidget.h"
#include "camera.h"
#include "lc_context.h"
#include "lc_stringcache.h"
#include "lc_application.h"

View file

@ -9,13 +9,16 @@
#include "pieceinf.h"
#include "lc_synth.h"
#include "lc_scene.h"
#include "lc_context.h"
#include "lc_viewsphere.h"
lcVertexBuffer View::mRotateMoveVertexBuffer;
lcIndexBuffer View::mRotateMoveIndexBuffer;
View::View(lcModel* Model)
: lcGLWidget(Model), mViewSphere(this)
: lcGLWidget(Model)
{
mViewSphere = std::unique_ptr<lcViewSphere>(new lcViewSphere(this));
memset(mGridSettings, 0, sizeof(mGridSettings));
mDragState = lcDragState::None;
@ -731,7 +734,7 @@ void View::OnDraw()
else if (Tool == lcTool::RotateView && mTrackButton == lcTrackButton::None)
DrawRotateViewOverlay();
mViewSphere.Draw();
mViewSphere->Draw();
DrawViewport();
}
@ -2425,7 +2428,7 @@ void View::OnLeftButtonDown()
return;
}
if (mViewSphere.OnLeftButtonDown())
if (mViewSphere->OnLeftButtonDown())
return;
lcTrackTool OverrideTool = GetOverrideTrackTool(Qt::LeftButton);
@ -2443,7 +2446,7 @@ void View::OnLeftButtonUp()
{
StopTracking(mTrackButton == lcTrackButton::Left);
if (mViewSphere.OnLeftButtonUp())
if (mViewSphere->OnLeftButtonUp())
return;
}
@ -2534,9 +2537,9 @@ void View::OnMouseMove()
if (mTrackButton == lcTrackButton::None)
{
if (mViewSphere.OnMouseMove())
if (mViewSphere->OnMouseMove())
{
lcTrackTool NewTrackTool = mViewSphere.IsDragging() ? lcTrackTool::OrbitXY : lcTrackTool::None;
lcTrackTool NewTrackTool = mViewSphere->IsDragging() ? lcTrackTool::OrbitXY : lcTrackTool::None;
if (NewTrackTool != mTrackTool)
{

View file

@ -1,8 +1,7 @@
#pragma once
#include "lc_glwidget.h"
#include "camera.h"
#include "lc_viewsphere.h"
#include "lc_context.h"
class View : public lcGLWidget
{
@ -95,7 +94,6 @@ protected:
PieceInfo* mMouseDownPiece;
QImage mRenderImage;
std::pair<lcFramebuffer, lcFramebuffer> mRenderFramebuffer;
lcViewSphere mViewSphere;
lcVertexBuffer mGridBuffer;
int mGridSettings[7];