Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions apps/camera_lidar_calibration/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <CalibCore/CameraCalibrationSolver.h>
#include <HDMapping/HDMAPPING_ConfigureInfo.hpp>
#include <RaylibWidgets/CompassRuler.h>
#include <RaylibWidgets/PlatformKeys.h>
#include <RaylibWidgets/PointPicking.h>
#include <RaylibWidgets/WindowFit.h>
#include <algorithm>
Expand Down Expand Up @@ -106,7 +107,8 @@ void AppState::setPendingImagePoint(float u, float v)
}
else
{
statusMsg = "Image point set -- Shift+click the matching point in the 3D View, or Shift+Alt+click it in the Image View";
statusMsg =
"Image point set -- Shift+click the matching point in the 3D View, or Shift+" SHORTCUT_ALT "+click it in the Image View";
}
}

Expand Down Expand Up @@ -1040,7 +1042,7 @@ void App::run()
else
{
state.pairsPath = pendingPairs;
state.statusMsg = "New pairs file " + pendingPairs + ": Ctrl+S saves the picked pairs there";
state.statusMsg = "New pairs file " + pendingPairs + ": " SHORTCUT_CTRL "+S saves the picked pairs there";
}
}

Expand Down
44 changes: 24 additions & 20 deletions apps/camera_lidar_calibration/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "imgui.h"
#include "rlImGui.h"
#include <Core/pfd_wrapper.hpp>
#include <RaylibWidgets/PlatformKeys.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
Expand Down Expand Up @@ -99,10 +100,12 @@ void UI::draw(AppState& state)

drawSensorIds(state);

// Alt/Cmd = toggle Camera RGB ↔ Intensity (works anywhere in the window).
// Cmd (Super) alongside Alt for macOS, where Option is awkward to use as
// a modifier (it composes special characters). Fires on release, unless
// Shift joined in: Shift+Alt is the Image View's LiDAR-pick chord.
// Alt/Super = toggle Camera RGB ↔ Intensity (works anywhere in the window).
// Super alongside Alt for macOS, where Option is awkward to use as a
// modifier (it composes special characters); ImGui swaps Cmd and Ctrl
// there, so Super is the physical Ctrl key and Cmd stays free for
// shortcuts. Fires on release, unless Shift joined in: Shift+Alt is the
// Image View's LiDAR-pick chord.
const bool altDown = ImGui::IsKeyDown(ImGuiKey_LeftAlt) || ImGui::IsKeyDown(ImGuiKey_RightAlt) ||
ImGui::IsKeyDown(ImGuiKey_LeftSuper) || ImGui::IsKeyDown(ImGuiKey_RightSuper);
if (altDown && io.KeyShift)
Expand Down Expand Up @@ -194,8 +197,8 @@ void UI::drawImageView(AppState& state)
const bool pickingLidar = picking && ImGui::GetIO().KeyAlt;
ImGui::TextColored(
ImVec4(1, 1, 0, 0.8f),
pickingLidar ? "LiDAR intensity image: Shift+Alt+click to pick a LiDAR point"
: picking ? "Shift+click to pick a pixel | add Alt to pick a LiDAR point"
pickingLidar ? "LiDAR intensity image: Shift+" SHORTCUT_ALT "+click to pick a LiDAR point"
: picking ? "Shift+click to pick a pixel | add " SHORTCUT_ALT " to pick a LiDAR point"
: "Scroll: zoom | Drag: pan with middle | Dbl-click: reset zoom");

ImGui::BeginChild("image_scroll", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_NoScrollWithMouse);
Expand Down Expand Up @@ -476,24 +479,24 @@ void UI::panelMenuBar(AppState& state)

if (ImGui::BeginMenu("File"))
{
if (ImGui::MenuItem("Open Image...", "Ctrl+I"))
if (ImGui::MenuItem("Open Image...", SHORTCUT_CTRL "+I"))
actionOpenImage(state);
if (ImGui::MenuItem("Open Point Cloud...", "Ctrl+O"))
if (ImGui::MenuItem("Open Point Cloud...", SHORTCUT_CTRL "+O"))
actionOpenPointCloud(state);
if (ImGui::MenuItem("Add Point Cloud...", "Ctrl+Shift+O"))
if (ImGui::MenuItem("Add Point Cloud...", SHORTCUT_CTRL "+Shift+O"))
actionAddPointCloud(state);
ImGui::Separator();
if (ImGui::MenuItem("Open Intrinsics...", "Ctrl+K"))
if (ImGui::MenuItem("Open Intrinsics...", SHORTCUT_CTRL "+K"))
actionOpenIntrinsics(state);
ImGui::Separator();
if (ImGui::MenuItem("Open Calibration...", "Ctrl+L"))
if (ImGui::MenuItem("Open Calibration...", SHORTCUT_CTRL "+L"))
actionOpenCalibration(state);
if (ImGui::MenuItem("Save Calibration...", "Ctrl+Shift+S"))
if (ImGui::MenuItem("Save Calibration...", SHORTCUT_CTRL "+Shift+S"))
actionSaveCalibration(state);
ImGui::Separator();
if (ImGui::MenuItem("Load Pairs..."))
actionLoadPairs(state);
if (ImGui::MenuItem("Save Pairs", "Ctrl+S", false, !state.pairs.empty() || !state.pairsPath.empty()))
if (ImGui::MenuItem("Save Pairs", SHORTCUT_CTRL "+S", false, !state.pairs.empty() || !state.pairsPath.empty()))
actionSavePairs(state);
if (ImGui::MenuItem("Save Pairs As...", nullptr, false, !state.pairs.empty()))
actionSavePairsAs(state);
Expand Down Expand Up @@ -607,7 +610,7 @@ void UI::panelIntrinsics(AppState& state)
drag("p1", &K.p1, 0.0001f, -1.f, 1.f, "%.5f");
drag("p2", &K.p2, 0.0001f, -1.f, 1.f, "%.5f");
helpMarker(
"Drag to adjust. Hold Ctrl+click to type a value.\nUnlike Pinhole, the displayed image is never undistorted for "
"Drag to adjust. Hold " SHORTCUT_CTRL "+click to type a value.\nUnlike Pinhole, the displayed image is never undistorted for "
"Mei -- the projection overlay and Camera RGB coloring apply this distortion to the raw image directly.");

ImGui::Text("Refine with \"Solve Extrinsics from Pairs\":");
Expand Down Expand Up @@ -636,7 +639,7 @@ void UI::panelIntrinsics(AppState& state)
drag("k3", &K.k3, 0.001f, -100.f, 100.f, "%.4f");
drag("k4", &K.k4, 0.001f, -100.f, 100.f, "%.4f");
helpMarker(
"Drag to adjust. Hold Ctrl+click to type a value.\nUnlike Pinhole, the displayed image is never undistorted for "
"Drag to adjust. Hold " SHORTCUT_CTRL "+click to type a value.\nUnlike Pinhole, the displayed image is never undistorted for "
"Fisheye -- the projection overlay and Camera RGB coloring apply this distortion to the raw image directly.");
}
else
Expand All @@ -651,7 +654,7 @@ void UI::panelIntrinsics(AppState& state)
ImGui::Text("Tangential:");
drag("p1", &K.p1, 0.0001f, -1.f, 1.f, "%.5f");
drag("p2", &K.p2, 0.0001f, -1.f, 1.f, "%.5f");
helpMarker("Drag to adjust. Hold Ctrl+click to type a value.");
helpMarker("Drag to adjust. Hold " SHORTCUT_CTRL "+click to type a value.");
}
ImGui::PopItemWidth();

Expand Down Expand Up @@ -839,7 +842,8 @@ void UI::panelVisualization(AppState& state)
void UI::panelCorrespondences(AppState& state)
{
ImGui::TextWrapped(
"Shift+click the pixel in the Image View, and the LiDAR point in the 3D View -- or Shift+Alt+click it in the Image View, "
"Shift+click the pixel in the Image View, and the LiDAR point in the 3D View -- or Shift+" SHORTCUT_ALT
"+click it in the Image View, "
"which shows the LiDAR intensity image while both are held. Picking both sides completes a pair.");

ImGui::Text("Pending pair:");
Expand Down Expand Up @@ -904,16 +908,16 @@ void UI::panelCorrespondences(AppState& state)
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
{
if (state.pairsPath.empty())
ImGui::SetTooltip("Ctrl+S; asks for a file");
ImGui::SetTooltip(SHORTCUT_CTRL "+S; asks for a file");
else
ImGui::SetTooltip("Ctrl+S, to %s", state.pairsPath.c_str());
ImGui::SetTooltip(SHORTCUT_CTRL "+S, to %s", state.pairsPath.c_str());
}
ImGui::SameLine();
if (ImGui::Button("Load pairs..."))
actionLoadPairs(state);
helpMarker(
"Or drop a saved pairs .json on the window, or pass --pairs <file.json>.\n"
"Loading replaces the current pairs. Ctrl+S saves to the last pairs file\n"
"Loading replaces the current pairs. " SHORTCUT_CTRL "+S saves to the last pairs file\n"
"loaded or saved, or the --pairs one (created if it does not exist yet).\n"
"Pixels are of the shown image (rectified or raw) -- load the same image and calibration first.");
if (!state.pairsPath.empty())
Expand Down
6 changes: 4 additions & 2 deletions apps/camera_lidar_calibration/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "App.h"
#include <CalibCore/CliArgs.h>
#include <RaylibWidgets/PlatformKeys.h>
#include <algorithm>
#include <cstdio>
#include <filesystem>
Expand Down Expand Up @@ -42,8 +43,9 @@ static void preloadByExt(App& app, const std::string& p)
static constexpr const char* kClosestToLaz = " --closest_to_laz with --camera_dir <dir>: load the image taken closest\n"
" to the middle of the --laz clouds' point times";

static constexpr const char* kPairs = " --pairs <file.json> picked pairs: loaded when the file exists; Ctrl+S saves\n"
" the pairs to it";
static constexpr const char* kPairs =
" --pairs <file.json> picked pairs: loaded when the file exists; " SHORTCUT_CTRL "+S saves\n"
" the pairs to it";

int main(int argc, char* argv[])
{
Expand Down
37 changes: 18 additions & 19 deletions apps/camera_lidar_trajectory_viewer/TrajectoryViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <RaylibWidgets/CenterOfRotationWindow.h>
#include <RaylibWidgets/CompassRuler.h>
#include <RaylibWidgets/OrbitCamera.h>
#include <RaylibWidgets/PlatformKeys.h>
#include <RaylibWidgets/PointBufferParts.h>
#include <RaylibWidgets/PointPicking.h>
#include <RaylibWidgets/ShortcutsTable.h>
Expand Down Expand Up @@ -56,11 +57,11 @@ static const std::vector<raylib_widgets::ShortcutEntry> appShortcuts = {
{ "Normal keys", "C", "Toggle compass/ruler" },
{ "", "P", "Toggle show path" },
{ "", "V", "Toggle show frustums" },
{ "", "Ctrl (tap)", "Toggle Intensity <-> RGB point color" },
{ "", "Ctrl+O", "Select session (.mjs)" },
{ "", "Ctrl+Shift+O", "Select CAMERA_0 directory" },
{ "", "Ctrl+Shift+C", "Open calibration" },
{ "", "Ctrl+S", "Export colored point cloud (LAS/LAZ)" },
{ "", SHORTCUT_CTRL " (tap)", "Toggle Intensity <-> RGB point color" },
{ "", SHORTCUT_CTRL "+O", "Select session (.mjs)" },
{ "", SHORTCUT_CTRL "+Shift+O", "Select CAMERA_0 directory" },
{ "", SHORTCUT_CTRL "+Shift+C", "Open calibration" },
{ "", SHORTCUT_CTRL "+S", "Export colored point cloud (LAS/LAZ)" },
{ "Camera", "F", "Front view" },
{ "", "B", "Back view" },
{ "", "L", "Left view" },
Expand All @@ -77,8 +78,8 @@ static const std::vector<raylib_widgets::ShortcutEntry> appShortcuts = {
{ "Mouse related", "Left click + drag", "Orbit camera (flyover: look around)" },
{ "", "Right click + drag", "Pan camera" },
{ "", "Scroll", "Zoom camera" },
{ "", "Ctrl+Right click", "Set center of rotation (ground plane)" },
{ "", "Ctrl+Middle click", "Set center of rotation (nearest trajectory point)" },
{ "", SHORTCUT_CTRL "+Right click", "Set center of rotation (ground plane)" },
{ "", SHORTCUT_CTRL "+Middle click", "Set center of rotation (nearest trajectory point)" },
{ "", "Shift+R", "Open 'Center of rotation' dialog" },
};

Expand Down Expand Up @@ -2483,14 +2484,12 @@ int main(int argc, char* argv[])
// Ctrl toggles point coloring: intensity (jet) <-> RGB
if (!ImGui::GetIO().WantCaptureKeyboard)
{
if (IsKeyPressed(KEY_LEFT_CONTROL) || IsKeyPressed(KEY_RIGHT_CONTROL))
if (raylib_widgets::isShortcutModifierPressed())
s.colorMode = (s.colorMode == 1) ? 0 : 1;

// Chords avoid colliding in meaning with step2's, and keep Ctrl+O
// and bare C/P aligned with it. Super counts as ctrlDown so macOS
// Cmd works, where it is a distinct key from Ctrl.
bool ctrlDown =
IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_CONTROL) || IsKeyDown(KEY_LEFT_SUPER) || IsKeyDown(KEY_RIGHT_SUPER);
// and bare C/P aligned with it. Ctrl here is Cmd on macOS.
bool ctrlDown = raylib_widgets::isShortcutModifierDown();
bool shiftDown = IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT);
if (ctrlDown && shiftDown && IsKeyPressed(KEY_O))
actionSelectCamera0Dir(s);
Expand Down Expand Up @@ -2770,17 +2769,17 @@ int main(int argc, char* argv[])
{
if (ImGui::BeginMenu("File"))
{
if (ImGui::MenuItem("Select Session (.mjs)...", "Ctrl+O"))
if (ImGui::MenuItem("Select Session (.mjs)...", SHORTCUT_CTRL "+O"))
actionSelectSession(s);
if (ImGui::MenuItem("Select CAMERA_0 Directory...", "Ctrl+Shift+O"))
if (ImGui::MenuItem("Select CAMERA_0 Directory...", SHORTCUT_CTRL "+Shift+O"))
actionSelectCamera0Dir(s);
ImGui::Separator();
if (ImGui::MenuItem("Open Calibration...", "Ctrl+Shift+C"))
if (ImGui::MenuItem("Open Calibration...", SHORTCUT_CTRL "+Shift+C"))
actionOpenCalibration(s);
if (ImGui::MenuItem("Open Image Mask..."))
actionOpenMask(s);
ImGui::Separator();
if (ImGui::MenuItem("Export Colored Point Cloud (LAS/LAZ)...", "Ctrl+S"))
if (ImGui::MenuItem("Export Colored Point Cloud (LAS/LAZ)...", SHORTCUT_CTRL "+S"))
actionExportColoredLAZ(s);
if (ImGui::MenuItem("Export Colored Point Cloud (E57)..."))
actionExportColoredE57(s);
Expand Down Expand Up @@ -2862,12 +2861,12 @@ int main(int argc, char* argv[])
}
if (s.lazHasRgb && s.imagesFilenamesInTime.empty())
{
if (ImGui::MenuItem("RGB (LAZ)", "Ctrl", s.colorMode == 1))
if (ImGui::MenuItem("RGB (LAZ)", SHORTCUT_CTRL, s.colorMode == 1))
s.colorMode = 1;
}
if (!s.imagesFilenamesInTime.empty())
{
if (ImGui::MenuItem(s.lazHasRgb ? "RGB (image, LAZ fallback)" : "RGB (image)", "Ctrl", s.colorMode == 1))
if (ImGui::MenuItem(s.lazHasRgb ? "RGB (image, LAZ fallback)" : "RGB (image)", SHORTCUT_CTRL, s.colorMode == 1))
s.colorMode = 1;
if (ImGui::MenuItem("Camera ID", nullptr, s.colorMode == 2))
s.colorMode = 2;
Expand Down Expand Up @@ -3349,7 +3348,7 @@ int main(int argc, char* argv[])
ImGui::SetNextItemWidth(160.f);
ImGui::SliderFloat("Speed", &s.flyoverSpeed, 0.1f, 50.f, "%.1fx", ImGuiSliderFlags_Logarithmic);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Playback rate, as a multiple of real time (Ctrl+click to type)");
ImGui::SetTooltip("Playback rate, as a multiple of real time (" SHORTCUT_CTRL "+click to type)");
ImGui::SameLine();
ImGui::SetNextItemWidth(120.f);
ImGui::SliderFloat("Smoothing", &s.flyoverSmoothingSec, 0.f, 5.f, "%.1f s");
Expand Down
10 changes: 6 additions & 4 deletions apps/lidar_odometry_step_1/lidar_odometry_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <Core/raylib_utils.hpp>
#include <Core/registration_plane_feature.h>
#include <Core/session.h>
#include <RaylibWidgets/PlatformKeys.h>

#include "toml_io.h"
#include <HDMapping/HDMAPPING_ConfigureInfo.hpp>
Expand Down Expand Up @@ -74,7 +75,7 @@ static const std::vector<ShortcutEntry> appShortcuts = { { "Help", "F1", "Show /
{ "", "Shift + scroll", "Faster zoom in perspective view" },
{ "", "Double left click", "Explore nearest trajectory point" },
{ "", "Double right click", "Return to processing head" },
{ "Camera", "Ctrl + arrows", "Rotate camera" },
{ "Camera", SHORTCUT_CTRL " + arrows", "Rotate camera" },
{ "", "Shift + arrows", "Pan camera" },
{ "", "F / B", "Front / back view" },
{ "", "L / R", "Left / right view" },
Expand All @@ -86,9 +87,9 @@ static const std::vector<ShortcutEntry> appShortcuts = { { "Help", "F1", "Show /
{ "", "C", "Show / hide compass and ruler" },
{ "", "X", "Show / hide axes" },
{ "", "1-9", "Set point size" },
{ "Data", "Ctrl + O", "Load and process data when idle" },
{ "Data", SHORTCUT_CTRL " + O", "Load and process data when idle" },
{ "Free exploration", "Shift + R", "Open rotation-center coordinates" },
{ "", "Ctrl + right/middle click", "Choose rotation center on Z=0" } };
{ "", SHORTCUT_CTRL " + right/middle click", "Choose rotation center on Z=0" } };

namespace fs = std::filesystem;

Expand Down Expand Up @@ -2559,7 +2560,8 @@ void display()
if (ImGui::Button("Load & process scanning"))
openData();
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Select folder from where to load data and start processing (Ctrl+O), or drop the folder on the window");
ImGui::SetTooltip(
"Select folder from where to load data and start processing (" SHORTCUT_CTRL "+O), or drop the folder on the window");

ImGui::SameLine();
ImGui::Dummy(ImVec2(20, 0));
Expand Down
5 changes: 3 additions & 2 deletions apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <Core/raylib_utils.hpp>
#include <Core/transformations.h>

#include <RaylibWidgets/PlatformKeys.h>
#include <RaylibWidgets/Timeline.h>

#include <Eigen/Eigen>
Expand Down Expand Up @@ -1739,7 +1740,7 @@ static void playbackBar()
ImGui::SetNextItemWidth(160.f);
ImGui::SliderFloat("Speed", &playback_speed, 0.1f, 50.f, "%.1fx", ImGuiSliderFlags_Logarithmic);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Playback rate, as a multiple of real time (Ctrl+click to type)");
ImGui::SetTooltip("Playback rate, as a multiple of real time (" SHORTCUT_CTRL "+click to type)");

ImGui::SameLine();
ImGui::Dummy(ImVec2(20, 0));
Expand Down Expand Up @@ -2039,7 +2040,7 @@ void display()
if (ImGui::Button("Open folder"))
openFolder();
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Select folder containing files for analyze (Ctrl+O), or drop folders/files on the window");
ImGui::SetTooltip("Select folder containing files for analyze (" SHORTCUT_CTRL "+O), or drop folders/files on the window");

ImGui::SameLine();

Expand Down
Loading
Loading