mirror of
https://github.com/leozide/leocad
synced 2025-01-18 22:26:44 +01:00
Sort piece insert preview with the rest of the scene.
This commit is contained in:
parent
2bd9b837dc
commit
e9cdeed008
3 changed files with 11 additions and 11 deletions
|
@ -1248,19 +1248,15 @@ void lcModel::DuplicateSelectedPieces()
|
|||
SaveCheckpoint(tr("Duplicating Pieces"));
|
||||
}
|
||||
|
||||
void lcModel::GetScene(lcScene& Scene, lcCamera* ViewCamera, bool DrawInterface, bool Highlight, lcPiece* ActiveSubmodelInstance, const lcMatrix44& ActiveSubmodelTransform) const
|
||||
void lcModel::GetScene(lcScene& Scene, lcCamera* ViewCamera, bool Highlight) const
|
||||
{
|
||||
Scene.Begin(ViewCamera->mWorldView);
|
||||
Scene.SetActiveSubmodelInstance(ActiveSubmodelInstance, ActiveSubmodelTransform);
|
||||
Scene.SetDrawInterface(DrawInterface);
|
||||
|
||||
mPieceInfo->AddRenderMesh(Scene);
|
||||
|
||||
for (lcPiece* Piece : mPieces)
|
||||
if (Piece->IsVisible(mCurrentStep))
|
||||
Piece->AddMainModelRenderMeshes(Scene, Highlight && Piece->GetStepShow() == mCurrentStep);
|
||||
|
||||
if (DrawInterface && !ActiveSubmodelInstance)
|
||||
if (Scene.GetDrawInterface() && !Scene.GetActiveSubmodelInstance())
|
||||
{
|
||||
for (lcCamera* Camera : mCameras)
|
||||
if (Camera != ViewCamera && Camera->IsVisible())
|
||||
|
@ -1270,8 +1266,6 @@ void lcModel::GetScene(lcScene& Scene, lcCamera* ViewCamera, bool DrawInterface,
|
|||
if (Light->IsVisible())
|
||||
Scene.AddInterfaceObject(Light);
|
||||
}
|
||||
|
||||
Scene.End();
|
||||
}
|
||||
|
||||
void lcModel::AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const
|
||||
|
|
|
@ -225,7 +225,7 @@ public:
|
|||
void Paste();
|
||||
void DuplicateSelectedPieces();
|
||||
|
||||
void GetScene(lcScene& Scene, lcCamera* ViewCamera, bool DrawInterface, bool Highlight, lcPiece* ActiveSubmodelInstance, const lcMatrix44& ActiveSubmodelTransform) const;
|
||||
void GetScene(lcScene& Scene, lcCamera* ViewCamera, bool Highlight) const;
|
||||
void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const;
|
||||
void DrawBackground(lcGLWidget* Widget);
|
||||
void SaveStepImages(const QString& BaseName, bool AddStepSuffix, bool Zoom, bool Highlight, int Width, int Height, lcStep Start, lcStep End);
|
||||
|
|
|
@ -805,11 +805,15 @@ void View::OnDraw()
|
|||
return;
|
||||
|
||||
const lcPreferences& Preferences = lcGetPreferences();
|
||||
const bool DrawInterface = mWidget != nullptr;
|
||||
|
||||
bool DrawInterface = mWidget != nullptr;
|
||||
mScene.SetAllowLOD(Preferences.mAllowLOD && mWidget != nullptr);
|
||||
mScene.SetActiveSubmodelInstance(mActiveSubmodelInstance, mActiveSubmodelTransform);
|
||||
mScene.SetDrawInterface(DrawInterface);
|
||||
|
||||
mModel->GetScene(mScene, mCamera, DrawInterface, mHighlight, mActiveSubmodelInstance, mActiveSubmodelTransform);
|
||||
mScene.Begin(mCamera->mWorldView);
|
||||
|
||||
mModel->GetScene(mScene, mCamera, mHighlight);
|
||||
|
||||
if (DrawInterface && mTrackTool == LC_TRACKTOOL_INSERT)
|
||||
{
|
||||
|
@ -829,6 +833,8 @@ void View::OnDraw()
|
|||
if (DrawInterface)
|
||||
mScene.SetPreTranslucentCallback([this]() { DrawGrid(); });
|
||||
|
||||
mScene.End();
|
||||
|
||||
int TotalTileRows = 1;
|
||||
int TotalTileColumns = 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue