Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RBComb Sample Visualizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pascal Engeler
RBComb Sample Visualizer
Commits
04d6e63e
Commit
04d6e63e
authored
1 year ago
by
Pascal Engeler
Browse files
Options
Downloads
Patches
Plain Diff
Added shortcut object state change
parent
abb97574
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gui/src/main.cpp
+37
-1
37 additions, 1 deletion
gui/src/main.cpp
with
37 additions
and
1 deletion
gui/src/main.cpp
+
37
−
1
View file @
04d6e63e
...
...
@@ -37,7 +37,7 @@ int main(int argc, char** argv) {
//Define materials
Material
mat_gold
{
glm
::
vec4
(
255.
f
/
256.
f
,
215.
f
/
256.
f
,
0.
f
,
1.
f
),
glm
::
vec4
(
0.
f
,
1.
f
,
0.
f
,
1.
f
),
glm
::
vec4
(
0.
f
,
0.
f
,
0.3
f
,
1.
f
),
glm
::
vec4
(
0.3
f
,
0.
f
,
0.0
f
,
1.
f
)
};
Material
mat_wafer
{
glm
::
vec4
(
0.561
f
,
0.51
f
,
1.0
f
,
1.
f
),
glm
::
vec4
(
0.
f
,
1.
f
,
0.
f
,
1.
f
),
glm
::
vec4
(
0.
f
,
0.
f
,
0.3
f
,
1.
f
),
glm
::
vec4
(
0.3
f
,
0.
f
,
0.0
f
,
1.
f
)
};
Material
mat_drum
{
glm
::
vec4
(
0.804
f
,
0.51
f
,
1.0
f
,
1.0
f
),
glm
::
vec4
(
0.
f
,
1.
f
,
0.
f
,
1.
f
),
glm
::
vec4
(
0.
f
,
0.
f
,
0.
3
f
,
1.
f
),
glm
::
vec4
(
0.
3
f
,
0.
f
,
0.0
f
,
1.
f
)
};
Material
mat_drum
{
glm
::
vec4
(
0.804
f
,
0.51
f
,
1.0
f
,
1.0
f
),
glm
::
vec4
(
0.
f
,
0.85
f
,
0.
f
,
1.
f
),
glm
::
vec4
(
0.
f
,
0.
f
,
0.
15
f
,
1.
f
),
glm
::
vec4
(
0.
15
f
,
0.
f
,
0.0
f
,
1.
f
)
};
//Load layers
Layer
bottom_metal
(
"Bottom Metal"
,
"C:
\\
Users
\\
Pascal
\\
repos
\\
rbcomb-sample-visualizer
\\
data_generation
\\
python
\\
models
\\
bottom_metal_single
\\
bottom_metal.obj"
,
0.0
f
,
mat_gold
);
...
...
@@ -77,6 +77,42 @@ int main(int argc, char** argv) {
//reset view and selection
camera
.
SetCameraView
(
eye
,
lookAt
,
upVector
);
}
else
if
(
InputState
::
g_click
)
{
if
(
SelectionManager
::
selectedIndex
!=
-
1
)
{
MetadataManager
::
getData
(
SelectionManager
::
selectedLayerName
,
SelectionManager
::
selectedIndex
).
status
=
0
;
//Update layer data here, and push to GPU
if
(
SelectionManager
::
selectedLayerName
==
bottom_metal
.
name
())
{
bottom_metal
.
setObjectState
(
SelectionManager
::
selectedIndex
,
0
);
}
else
if
(
SelectionManager
::
selectedLayerName
==
bottom_drums
.
name
())
{
bottom_drums
.
setObjectState
(
SelectionManager
::
selectedIndex
,
0
);
}
}
}
else
if
(
InputState
::
s_click
)
{
if
(
SelectionManager
::
selectedIndex
!=
-
1
)
{
MetadataManager
::
getData
(
SelectionManager
::
selectedLayerName
,
SelectionManager
::
selectedIndex
).
status
=
1
;
//Update layer data here, and push to GPU
if
(
SelectionManager
::
selectedLayerName
==
bottom_metal
.
name
())
{
bottom_metal
.
setObjectState
(
SelectionManager
::
selectedIndex
,
1
);
}
else
if
(
SelectionManager
::
selectedLayerName
==
bottom_drums
.
name
())
{
bottom_drums
.
setObjectState
(
SelectionManager
::
selectedIndex
,
1
);
}
}
}
else
if
(
InputState
::
b_click
)
{
if
(
SelectionManager
::
selectedIndex
!=
-
1
)
{
MetadataManager
::
getData
(
SelectionManager
::
selectedLayerName
,
SelectionManager
::
selectedIndex
).
status
=
2
;
//Update layer data here, and push to GPU
if
(
SelectionManager
::
selectedLayerName
==
bottom_metal
.
name
())
{
bottom_metal
.
setObjectState
(
SelectionManager
::
selectedIndex
,
2
);
}
else
if
(
SelectionManager
::
selectedLayerName
==
bottom_drums
.
name
())
{
bottom_drums
.
setObjectState
(
SelectionManager
::
selectedIndex
,
2
);
}
}
}
else
if
(
InputState
::
lmb_click
)
{
//select object
int
selected_index
=
bottom_metal
.
selectObject
(
InputState
::
umpos_x
,
HEIGHT
-
InputState
::
umpos_y
,
projection
,
view
,
model
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment