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

Drawing editor updates #157

Merged
merged 34 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d0e17d3
Tweaking UI
mxgrey Jul 26, 2023
a5636fc
Clean up drawing creation
mxgrey Jul 26, 2023
3585ab5
Use events to start and stop editing drawings
mxgrey Jul 26, 2023
2242011
Bug: ComputedVisibility is turning out false for drawing while it is …
mxgrey Jul 27, 2023
02da9a4
Fix the switch in and out of drawing editor
mxgrey Jul 27, 2023
5936508
Tweak edit drawing buttons
mxgrey Jul 27, 2023
ab03637
Add an exit icon
mxgrey Jul 27, 2023
e75b1f0
Pick, outline, and highlight drawings
mxgrey Jul 28, 2023
b45b009
Restructure site format to remember semi-transparency preferences
mxgrey Aug 1, 2023
5bb314c
Improve aesthetics for moving layers
mxgrey Aug 1, 2023
2f7c2ba
Make a visually distinct icon for selected entities
mxgrey Aug 1, 2023
de50902
Fix drawing layer adjustment
mxgrey Aug 1, 2023
8c61b14
Fix relative and absolute path selection
mxgrey Aug 2, 2023
d44470e
Fix highlighting for changed drawings
mxgrey Aug 2, 2023
2cb7c11
Unify fiducials, features, and constraints into fiducials and fiducia…
mxgrey Aug 4, 2023
4588adf
Use site anchors for Cartesian fiducials instead of level anchors
mxgrey Aug 5, 2023
db5c165
Be able to view and select a fiducial group -- currently bugged
mxgrey Aug 5, 2023
86bf7e4
Improve the UI/UX for fiducials
mxgrey Aug 7, 2023
7845a1d
Use icons for managing fiducials
mxgrey Aug 7, 2023
7b559d9
Make floors less transparent by default
mxgrey Aug 7, 2023
79992e9
Cleanup unused scope
luca-della-vedova Aug 8, 2023
ab7cd30
Add missing fiducial loading for features
luca-della-vedova Aug 8, 2023
79662ed
Fix parenting for newly spawned measurements and fiducials
luca-della-vedova Aug 8, 2023
8a833ff
No longer use pin fiducials
mxgrey Aug 10, 2023
6e54fc8
Working on making selected locations and fiducials pop up
mxgrey Aug 10, 2023
e5a73a1
Locations and Fiducials pop up when hovered and selected
mxgrey Aug 10, 2023
aa44f41
Prevent render collisions between drawings and lift floors
mxgrey Aug 10, 2023
3bd5657
Fix fiducial and location transforms
mxgrey Aug 10, 2023
0f79062
Fix fiducial parenting
mxgrey Aug 10, 2023
2931238
Remove deprecated drawing adjustment events
mxgrey Aug 10, 2023
954db1b
Improve behavior of building alignment
mxgrey Aug 11, 2023
e2f4a6b
Implement drawing alignment for site editor
mxgrey Aug 13, 2023
ab4ced0
Add icon for drawing alignment
mxgrey Aug 13, 2023
5454eb0
Fix style
mxgrey Aug 13, 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
Binary file added assets/textures/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/alignment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 173 additions & 0 deletions assets/textures/alignment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion assets/textures/attribution.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
* [`select.png`](https://thenounproject.com/icon/select-3324735/)
* [`edit.png`](https://thenounproject.com/icon/edit-2162449/)
* [`exit.png`](https://thenounproject.com/icon/exit-1826632/)
* [`confirm.png`](https://thenounproject.com/icon/confirm-2261637/)
* [`reject.png`](https://thenounproject.com/icon/x-2289933/)
* [`empty.png`](https://thenounproject.com/icon/empty-194055/)
* [`add.png`](https://thenounproject.com/icon/plus-1809810/)
* [`search.png`](https://thenounproject.com/icon/search-3743008/)
* `trash.png`: @mxgrey

* `selected.png`: @mxgrey
* `alignment.png`: @mxgrey
Binary file added assets/textures/confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/exit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/reject.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions assets/textures/selected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion rmf_site_editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bevy_polyline = "0.4"
bevy_stl = "0.7.0"
bevy_obj = { git = "https://github.com/luca-della-vedova/bevy_obj", branch = "luca/scene_0.9", features = ["scene"]}
bevy_rapier3d = "0.20.0"
optimization_engine = "0.7.7"
smallvec = "*"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8.23"
Expand All @@ -45,6 +44,7 @@ tracing-subscriber = "0.3.1"
rfd = "0.11"
urdf-rs = "0.7"
sdformat_rs = { git = "https://github.com/open-rmf/sdf_rust_experimental", rev = "a5daef0"}
pathdiff = "*"

# only enable the 'dynamic' feature if we're not building for web or windows
[target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "windows")))'.dependencies]
Expand Down
41 changes: 41 additions & 0 deletions rmf_site_editor/src/interaction/camera_controls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ impl ProjectionMode {
}
}

pub struct ChangeProjectionMode(pub ProjectionMode);

impl ChangeProjectionMode {
pub fn to_perspective() -> ChangeProjectionMode {
ChangeProjectionMode(ProjectionMode::Perspective)
}

pub fn to_orthographic() -> ChangeProjectionMode {
ChangeProjectionMode(ProjectionMode::Orthographic)
}
}

#[derive(Debug, Clone, Reflect, Resource)]
pub struct CameraControls {
mode: ProjectionMode,
Expand Down Expand Up @@ -152,6 +164,23 @@ impl CameraControls {
self.use_perspective(!choice, cameras, visibilities, headlights_on);
}

pub fn use_mode(
&mut self,
mode: ProjectionMode,
cameras: &mut Query<&mut Camera>,
visibilities: &mut Query<&mut Visibility>,
headlights_on: bool,
) {
match mode {
ProjectionMode::Perspective => {
self.use_perspective(true, cameras, visibilities, headlights_on);
}
ProjectionMode::Orthographic => {
self.use_orthographic(true, cameras, visibilities, headlights_on);
}
}
}

pub fn mode(&self) -> ProjectionMode {
self.mode
}
Expand Down Expand Up @@ -329,10 +358,21 @@ fn camera_controls(
mut previous_mouse_location: ResMut<MouseLocation>,
mut controls: ResMut<CameraControls>,
mut cameras: Query<(&mut Projection, &mut Transform)>,
mut bevy_cameras: Query<&mut Camera>,
mut visibility: Query<&mut Visibility>,
headlight_toggle: Res<HeadlightToggle>,
picking_blockers: Res<PickingBlockers>,
mut change_mode: EventReader<ChangeProjectionMode>,
) {
if let Some(mode) = change_mode.iter().last() {
controls.use_mode(
mode.0,
&mut bevy_cameras,
&mut visibility,
headlight_toggle.0,
);
}

if headlight_toggle.is_changed() {
controls.toggle_lights(headlight_toggle.0, &mut visibility);
}
Expand Down Expand Up @@ -488,6 +528,7 @@ impl Plugin for CameraControlsPlugin {
app.insert_resource(MouseLocation::default())
.init_resource::<CameraControls>()
.init_resource::<HeadlightToggle>()
.add_event::<ChangeProjectionMode>()
.add_system(camera_controls);
}
}
Loading