Cam simulator feature update (#15597)

* remove redundant code

* Improve lighting, add ambient occlusion

* Add cleanup code. Dialog is now deleted when cloesd.

* change back to ambient occlusion

* Fix G8x drill sequence bug.  issue #14369

* fix bad simulation artifacts under Linux and QT. Issue #14369

* fix merge issue

* fix border artifact on buttons

* support showing path lines. revise the gui.

* add option for arbitrary solids. wip

* use vectors instead of mallocs

* Handle arbitrary stock shapes + show base shape.

* Complete the base shape display feature. eliminate co-planar artifacts.

* support window scaling. upstream issue #14334

* Apply lint fixes

* some missing lints.

* Attend pylint issues

* Apply code fixes based on @kadet1090 review

* fix some clang-tidy warnings.

* CAM: Linter cleanup round 1

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
This commit is contained in:
Shai Seger
2024-08-21 23:18:52 +03:00
committed by GitHub
parent c4a506146f
commit 778107939c
42 changed files with 2744 additions and 1067 deletions

View File

@@ -22,34 +22,15 @@
#include "StockObject.h"
#include "Shader.h"
#include <stdlib.h>
#define NUM_PROFILE_POINTS 4
using namespace MillSim;
MillSim::StockObject::StockObject()
StockObject::StockObject()
{
mat4x4_identity(mModelMat);
vec3_set(center, 0, 0, 0);
}
MillSim::StockObject::~StockObject()
{
shape.FreeResources();
}
void MillSim::StockObject::render()
{
// glCallList(mDisplayListId);
// UpdateObjColor(color);
shape.Render(mModelMat, mModelMat); // model is not rotated hence both are identity matrix
}
void MillSim::StockObject::SetPosition(vec3 position)
{
mat4x4_translate(mModelMat, position[0], position[1], position[2]);
}
void MillSim::StockObject::GenerateBoxStock(float x, float y, float z, float l, float w, float h)
void StockObject::GenerateBoxStock(float x, float y, float z, float l, float w, float h)
{
int idx = 0;
SET_DUAL(mProfile, idx, y + w, z + h);
@@ -57,6 +38,7 @@ void MillSim::StockObject::GenerateBoxStock(float x, float y, float z, float l,
SET_DUAL(mProfile, idx, y, z);
SET_DUAL(mProfile, idx, y, z + h);
vec3_set(position, x, y, z);
vec3_set(center, x + l / 2, y + w / 2, z + h / 2);
vec3_set(size, l, w, h);