Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port PrusaSlicer's Measure & Cut gizmos #2603

Merged
merged 107 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
28d0147
Introduction of classes ColorRGB and ColorRGBA to unify color data de…
enricoturri1966 Oct 20, 2023
7f0c095
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - 1st installment - Selection bound…
enricoturri1966 Oct 20, 2023
356405a
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Selection layers hints
enricoturri1966 Oct 20, 2023
f6a3421
remove GLModel from base class
Jony01 Oct 19, 2023
7e04448
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Various Gizmos updates and fixes
enricoturri1966 Oct 21, 2023
354f8e2
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Refactoring of GLModel to:
enricoturri1966 Oct 21, 2023
35899b9
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Layers editing profile's backgrou…
enricoturri1966 Oct 21, 2023
04ad26f
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Background rendering
enricoturri1966 Oct 21, 2023
7907426
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Textures rendering
enricoturri1966 Oct 21, 2023
499b9d1
Fix various memory leaks
hejllukas Oct 21, 2023
f9de4ec
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Removed Slic3r::GUI::GeometryBuff…
enricoturri1966 Oct 21, 2023
6eed220
Tech ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL - Replace GLIndexedVertexArr…
enricoturri1966 Oct 22, 2023
269fbaa
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Refactoring to simplify client co…
enricoturri1966 Oct 22, 2023
6d4e084
Fix move gizmo grabber connection render
Noisyfox Oct 22, 2023
874f39a
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Adapt GLModel::Geometry index for…
enricoturri1966 Oct 22, 2023
b7989e3
Gizmos refactoring - Removed GLModels defined into GLGizmoBase, and m…
enricoturri1966 Oct 22, 2023
baa575b
Tech ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL - Replace GLIndexedVertexArr…
enricoturri1966 Oct 22, 2023
fc1c8c2
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Removed Slic3r::GUI::GLPaintConto…
enricoturri1966 Oct 23, 2023
8107057
Tech ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL - Replace GLIndexedVertexArr…
enricoturri1966 Oct 23, 2023
12dbbf2
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Another refactoring to simplify c…
enricoturri1966 Oct 23, 2023
10243b3
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Removed OpenGL legacy calls from …
enricoturri1966 Oct 23, 2023
dde64ac
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - SLA caps rendered using GLModel
enricoturri1966 Oct 23, 2023
dd51ce3
Follow-up of fdf8b11d4cfa793d1e45d82560d4bd97d0466d40 - Fixed GLGizmo…
enricoturri1966 Oct 23, 2023
d1b0743
Removed obsolete member variable GLCanvas3D::m_color_by
enricoturri1966 Oct 23, 2023
d85bbcb
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Fixed bug in rendering gizmo rotate
enricoturri1966 Oct 23, 2023
d09dc36
Tech ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL - Replace GLIndexedVertexArr…
enricoturri1966 Oct 23, 2023
1fedcb6
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Fix in GLGizmoRotate::render_angl…
enricoturri1966 Oct 23, 2023
c5b2092
Fix a few issues in cut gizmo
Noisyfox Oct 23, 2023
e6443b5
Removed empty IMSlider_Utils.hpp
Noisyfox Oct 24, 2023
61ed614
Removed unneeded pairs glPushMatrix()/glPopMatrix()
enricoturri1966 Oct 24, 2023
d8551d7
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Use 2D vertices to render GLGizmo…
enricoturri1966 Oct 24, 2023
5fc056e
Some refactoring into GLGizmoSlaSupports::render_points()
enricoturri1966 Oct 24, 2023
9f4713e
Tech ENABLE_GLBEGIN_GLEND_SHADERS_ATTRIBUTES - Use vertex attributes …
enricoturri1966 Oct 23, 2023
71fd408
Tech ENABLE_LEGACY_OPENGL_REMOVAL - porting remaining changes
enricoturri1966 Oct 25, 2023
03daf61
Fix outline rendering
Noisyfox Oct 26, 2023
8f49be4
Fix preview shell rendering
Noisyfox Oct 26, 2023
511bfa7
Fix plate texture rendering depth issue
Noisyfox Oct 26, 2023
e211e7d
Fix mm rendering
Noisyfox Oct 26, 2023
ac001f8
Fix pick rendering depth issue
Noisyfox Oct 26, 2023
8dc82e7
Few small fixes
enricoturri1966 Oct 26, 2023
15bad7f
Tech ENABLE_GL_IMGUI_SHADERS - Render imgui using shaders
enricoturri1966 Oct 27, 2023
63272a9
Tech ENABLE_GL_SHADERS_ATTRIBUTES - Use shader's vertex attributes an…
enricoturri1966 Oct 27, 2023
96c8c11
Removed obsolete code from GCodeViewer
enricoturri1966 Oct 27, 2023
cabb8fc
Tech ENABLE_GL_SHADERS_ATTRIBUTES - Fixed rendering of default bed in…
enricoturri1966 Oct 27, 2023
7081ebd
Follow-up of 6b2fea5f8bb67a38bdcb7e3fb43c06a12a6d7798 - Fixed warnings
enricoturri1966 Oct 27, 2023
bb04475
ENABLE_GL_IMGUI_SHADERS - Fixes in ImGuiWrapper::render_draw_data()
enricoturri1966 Oct 27, 2023
1e4f16b
Tech ENABLE_GL_SHADERS_ATTRIBUTES - Added shaders for glsl version 140
enricoturri1966 Oct 27, 2023
59b7c52
Tech ENABLE_LEGACY_OPENGL_REMOVAL - Calculation of camera projection …
enricoturri1966 Oct 27, 2023
eb2b6af
Tech ENABLE_LEGACY_OPENGL_REMOVAL - Fix into GLModel::send_to_gpu()
enricoturri1966 Oct 27, 2023
0d27e08
Fix thumbnail shader
Noisyfox Oct 27, 2023
a50c5a2
Fix preview shell transparency
Noisyfox Oct 27, 2023
fe78e40
Various fixes
enricoturri1966 Oct 27, 2023
5ce3ec7
Fix draw cut line
Noisyfox Oct 27, 2023
4fb5b1f
Cherry-picked a few changes from Tech ENABLE_GL_CORE_PROFILE
enricoturri1966 Oct 27, 2023
19ad0ca
Tech ENABLE_LEGACY_OPENGL_REMOVAL - Fixed calculation of normal matri…
enricoturri1966 Oct 27, 2023
461fa63
Tech ENABLE_LEGACY_OPENGL_REMOVAL - Fixed rendering of layer editing …
enricoturri1966 Oct 27, 2023
467223b
Fix move gizmo grabber rendering
Noisyfox Oct 28, 2023
65b6856
Fix macos build
Noisyfox Oct 29, 2023
b2f94e1
Fix variable init
Noisyfox Oct 29, 2023
02f83f2
Tech ENABLE_GIZMO_GRABBER_REFACTOR - Refactoring of GLGizmoBase::Grab…
enricoturri1966 Oct 28, 2023
3577a25
Tech ENABLE_RAYCAST_PICKING - Raytraced picking of volumes
enricoturri1966 Oct 28, 2023
cd1705e
Implement plate picking
Noisyfox Oct 28, 2023
1cd421c
Tech ENABLE_RAYCAST_PICKING - Raytraced picking of gizmos - Move Gizmo
enricoturri1966 Oct 28, 2023
6a40d3a
Fix volume picking in cut gizmo
Noisyfox Oct 28, 2023
29be4cc
Tech ENABLE_RAYCAST_PICKING - Raytraced picking of Move, Rotate and S…
enricoturri1966 Oct 28, 2023
ab090bf
Tech ENABLE_RAYCAST_PICKING - Refactoring to allow for easier update …
enricoturri1966 Oct 28, 2023
1e7a91e
Tech ENABLE_RAYCAST_PICKING - Raytraced picking of Gizmo Flatten
enricoturri1966 Oct 28, 2023
f019915
Removed tech ENABLE_RENDER_PICKING_PASS
enricoturri1966 Oct 28, 2023
d2d7745
Tech ENABLE_RAYCAST_PICKING - Rendering for rectangle selection made …
enricoturri1966 Oct 29, 2023
e4ec0cf
Tech ENABLE_RAYCAST_PICKING - Method GLCanvas3D::_mouse_to_3d() modif…
enricoturri1966 Oct 29, 2023
094acdb
Tech ENABLE_RAYCAST_PICKING - Gizmo flatten: fixed update of raycaste…
enricoturri1966 Oct 29, 2023
da4a707
remove unnecessary getting of raw pointer from unique pointer
Jony01 Oct 29, 2023
158bb47
Suggestion to detect volume modification instead of check some gizmos…
Jony01 Oct 19, 2023
8e2ab66
Add virtual function to process mouse_event
Jony01 Oct 29, 2023
005b839
Do not compile sla related gizmos
Noisyfox Oct 29, 2023
30af274
Separate GizmoManager on_move into gizmo itself
Jony01 Oct 29, 2023
9dbb2df
Various gizmos refactoring
Jony01 Oct 29, 2023
049dfd3
Added method const GLVolume* Selection::get_first_volume() const to s…
enricoturri1966 Oct 30, 2023
1561d65
Sync most of the gizmos with latest PrusaSlicer
enricoturri1966 Oct 30, 2023
f72d42f
Measure: Initial porting of Measure Gizmo
enricoturri1966 Oct 31, 2023
c31e1f5
Measure: Fix measure window position
Noisyfox Oct 31, 2023
d25780a
Fix-position tooltip should also be clamped inside render area
Noisyfox Oct 31, 2023
2c00408
Measure: Update measure gizmo tooltip
Noisyfox Oct 31, 2023
4843cda
Measure: Use Orca color schema
Noisyfox Oct 31, 2023
1bfd9f6
Measure: Update measure dialog layout
Noisyfox Oct 31, 2023
ce2836a
Measure: Fix copy to clipboard encoding
Noisyfox Oct 31, 2023
18406c3
Cut: Initial porting of Cut Gizmo
enricoturri1966 Oct 31, 2023
3ec927a
Cut: Use Orca color schema and dialog layout
Noisyfox Nov 1, 2023
090a924
Cut: Fix model rendering
Noisyfox Nov 1, 2023
018b274
Text: Fix text moving grabber
Noisyfox Nov 4, 2023
28e2995
Cut: Fix crashing in programming cut. Also fixes the cut z offset.
Noisyfox Nov 5, 2023
e57f68a
Fix painter gizmos crash on macOS
Noisyfox Nov 6, 2023
483475f
Fix canvas background in dark mode
Noisyfox Nov 8, 2023
5f001c8
Merge remote-tracking branch 'origin/main' into dev/gizmo
Noisyfox Nov 8, 2023
cf5c19f
Merge remote-tracking branch 'origin/main' into dev/gizmo
Noisyfox Nov 10, 2023
7984b4d
Fix complie error after merge
Noisyfox Nov 10, 2023
ee8ea0d
Rewrite bed raycaster registering that fixes crash when creating new …
Noisyfox Nov 10, 2023
66d4b4d
Merge branch 'main' into dev/gizmo
Noisyfox Nov 10, 2023
799b096
Fix for prusa3d/PrusaSlicer#11487 - Cut Connectors Broken when assign…
YuSanka Nov 11, 2023
6510fd4
Hide raycast debug window
Noisyfox Nov 11, 2023
5669b4f
Merge branch 'main' into dev/gizmo
Noisyfox Nov 11, 2023
d6c2192
Merge branch 'main' into dev/gizmo
Noisyfox Nov 12, 2023
f6e4c48
Merge branch 'main' into dev/gizmo
Noisyfox Nov 17, 2023
67c1f40
Fixed a crash when deleting the last object with autocenter enabled (…
lukasmatena Nov 17, 2023
67fe5ee
Bring back anti-aliasing to toolbar icons (#2739)
Noisyfox Nov 18, 2023
5045642
Merge branch 'main' into dev/gizmo
Noisyfox Nov 18, 2023
df48b05
Merge branch 'main' into dev/gizmo
SoftFever Nov 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions resources/images/copy_menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions resources/images/copy_menu_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions resources/images/toolbar_measure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions resources/images/toolbar_measure_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions resources/shaders/110/background.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#version 110

uniform vec4 top_color;
uniform vec4 bottom_color;

varying vec2 tex_coord;

void main()
{
gl_FragColor = mix(bottom_color, top_color, tex_coord.y);
}
12 changes: 12 additions & 0 deletions resources/shaders/110/background.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#version 110

attribute vec3 v_position;
attribute vec2 v_tex_coord;

varying vec2 tex_coord;

void main()
{
tex_coord = v_tex_coord;
gl_Position = vec4(v_position, 1.0);
}
File renamed without changes.
11 changes: 11 additions & 0 deletions resources/shaders/110/flat.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#version 110

uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;

attribute vec3 v_position;

void main()
{
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}
15 changes: 15 additions & 0 deletions resources/shaders/110/flat_clip.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#version 110

const vec3 ZERO = vec3(0.0, 0.0, 0.0);

uniform vec4 uniform_color;

varying vec3 clipping_planes_dots;

void main()
{
if (any(lessThan(clipping_planes_dots, ZERO)))
discard;

gl_FragColor = uniform_color;
}
23 changes: 23 additions & 0 deletions resources/shaders/110/flat_clip.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#version 110

uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
uniform mat4 volume_world_matrix;

// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
uniform vec2 z_range;
// Clipping plane - general orientation. Used by the SLA gizmo.
uniform vec4 clipping_plane;

attribute vec3 v_position;

varying vec3 clipping_planes_dots;

void main()
{
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
vec4 world_pos = volume_world_matrix * vec4(v_position, 1.0);
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);

gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}
10 changes: 10 additions & 0 deletions resources/shaders/110/flat_texture.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#version 110

uniform sampler2D uniform_texture;

varying vec2 tex_coord;

void main()
{
gl_FragColor = texture2D(uniform_texture, tex_coord);
}
15 changes: 15 additions & 0 deletions resources/shaders/110/flat_texture.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#version 110

uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;

attribute vec3 v_position;
attribute vec2 v_tex_coord;

varying vec2 tex_coord;

void main()
{
tex_coord = v_tex_coord;
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}
Loading