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
5 changes: 4 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
# GitHub's blame view applies this file automatically.

# clang-format mass reformat
7c667fce790efe905c8f825246c8e3ad417d9890
7c667fce790efe905c8f825246c8e3ad417d9890

# clang-format raylib_widgets
03d4c1d35d06d5ea44c831b4efe47998d65ee521
42 changes: 23 additions & 19 deletions raylib_widgets/include/RaylibWidgets/AppShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,31 @@
// ShowMainDockSpace/ImGuiHyperlink/info_window) and any other raylib_widgets
// consumer that wants the same scaffolding. Depends on raylib_widgets'
// existing imgui_raylib link only -- no Eigen/core coupling.
namespace raylib_widgets {
namespace raylib_widgets
{

// Full-window transparent host for ImGui docking. Call once per frame,
// before building any dockable panel windows. On its first call ever, splits
// off a left column and a bottom "Console" dock -- later calls just
// re-assert the dockspace.
void ShowMainDockSpace();
// Full-window transparent host for ImGui docking. Call once per frame,
// before building any dockable panel windows. On its first call ever, splits
// off a left column and a bottom "Console" dock -- later calls just
// re-assert the dockspace.
void ShowMainDockSpace();

// Clickable-looking text that opens `url` in the system browser when
// clicked (Windows: ShellExecuteA; macOS/Linux: `open`/`xdg-open`).
void ImGuiHyperlink(const char* url, ImVec4 color = ImVec4(0.2f, 0.4f, 0.8f, 1.0f));
// Clickable-looking text that opens `url` in the system browser when
// clicked (Windows: ShellExecuteA; macOS/Linux: `open`/`xdg-open`).
void ImGuiHyperlink(const char* url, ImVec4 color = ImVec4(0.2f, 0.4f, 0.8f, 1.0f));

// "About/shortcuts" window. `open` is both the visibility toggle (the call
// is a no-op while false) and gets cleared by the window's own close
// button/X. infoLines is rendered as plain text, except a blank line (blank
// line in the window) or one starting with "https://" (rendered as a
// clickable ImGuiHyperlink()); appShortcuts is rendered via
// ShowShortcutsTable(). versionString/buildDate go into a "Version: %s (%s)"
// line (pass e.g. HDMAPPING_CONFIGURE_PROJECT_VERSION and __DATE__).
void ShowInfoWindow(
bool& open, const std::vector<std::string>& infoLines, const std::vector<ShortcutEntry>& appShortcuts,
const char* versionString, const char* buildDate);
// "About/shortcuts" window. `open` is both the visibility toggle (the call
// is a no-op while false) and gets cleared by the window's own close
// button/X. infoLines is rendered as plain text, except a blank line (blank
// line in the window) or one starting with "https://" (rendered as a
// clickable ImGuiHyperlink()); appShortcuts is rendered via
// ShowShortcutsTable(). versionString/buildDate go into a "Version: %s (%s)"
// line (pass e.g. HDMAPPING_CONFIGURE_PROJECT_VERSION and __DATE__).
void ShowInfoWindow(
bool& open,
const std::vector<std::string>& infoLines,
const std::vector<ShortcutEntry>& appShortcuts,
const char* versionString,
const char* buildDate);

} // namespace raylib_widgets
40 changes: 20 additions & 20 deletions raylib_widgets/include/RaylibWidgets/CenterOfRotationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
// Eigen rotation_center to OrbitCamera's Vector3 target). Depends on raylib
// + ImGui + OrbitCamera.h only -- no Eigen, no core -- same dependency story
// as OrbitCamera.h itself.
namespace raylib_widgets {
namespace raylib_widgets
{

// Call once per frame. `open` is an edge-triggered request: the caller sets
// it true (e.g. from a keyboard shortcut or menu item) to pop the dialog;
// this function opens the ImGui popup and immediately clears `open` back to
// false (the popup then manages its own visibility until Set/Cancel). On
// "Set", starts an eased transition of camera.target to the typed X/Y/Z via
// camera.moveTargetTo().
void showCenterOfRotationWindow(bool& open, OrbitCamera& camera);
// Call once per frame. `open` is an edge-triggered request: the caller sets
// it true (e.g. from a keyboard shortcut or menu item) to pop the dialog;
// this function opens the ImGui popup and immediately clears `open` back to
// false (the popup then manages its own visibility until Set/Cancel). On
// "Set", starts an eased transition of camera.target to the typed X/Y/Z via
// camera.moveTargetTo().
void showCenterOfRotationWindow(bool& open, OrbitCamera& camera);

// Same dialog, for OrbitCamera's Euler mode instead of its azimuth/
// elevation/target mode above -- was multi_view_tls_registration's local
// cor_window(). Binds to camera.eulerGoal.rotationCenter (edited in place,
// matching cor_window()'s original behavior of editing its own persistent
// new_rotation_center field rather than a freshly-seeded copy) and calls
// camera.moveEulerRotationCenterTo() on Set. xTooltip/yTooltip/zTooltip are
// optional per-field hover tooltips (multi_view_tls_registration's original
// had these -- e.g. "Longitudinal (forward/backward)"); pass nullptr (the
// default) to skip.
void showEulerCenterOfRotationWindow(
bool& open, OrbitCamera& camera, const char* xTooltip = nullptr, const char* yTooltip = nullptr,
const char* zTooltip = nullptr);
// Same dialog, for OrbitCamera's Euler mode instead of its azimuth/
// elevation/target mode above -- was multi_view_tls_registration's local
// cor_window(). Binds to camera.eulerGoal.rotationCenter (edited in place,
// matching cor_window()'s original behavior of editing its own persistent
// new_rotation_center field rather than a freshly-seeded copy) and calls
// camera.moveEulerRotationCenterTo() on Set. xTooltip/yTooltip/zTooltip are
// optional per-field hover tooltips (multi_view_tls_registration's original
// had these -- e.g. "Longitudinal (forward/backward)"); pass nullptr (the
// default) to skip.
void showEulerCenterOfRotationWindow(
bool& open, OrbitCamera& camera, const char* xTooltip = nullptr, const char* yTooltip = nullptr, const char* zTooltip = nullptr);

} // namespace raylib_widgets
35 changes: 16 additions & 19 deletions raylib_widgets/include/RaylibWidgets/CompassRuler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,23 @@
// core -- so it stays linkable from both the core_raylib side (which already
// pulls in core/core_math) and the calib_core side (which deliberately
// doesn't) without adding coupling either way.
namespace raylib_widgets {
namespace raylib_widgets
{

struct CompassAxisLabels {
const char* x = "X";
const char* y = "Y";
const char* z = "Z";
};
struct CompassAxisLabels
{
const char* x = "X";
const char* y = "Y";
const char* z = "Z";
};

// right/up: the current camera's screen-right/up directions in world space
// (e.g. cross(forward, camUp) / cross(right, forward) for a raylib Camera3D,
// or the first two rows of a world-to-eye rotation matrix).
// zoomDistance: current camera distance/zoom, used to size the ruler.
// rulerColor: contrast color for the ruler ticks/label (axis lines are
// always drawn in RGB = X/Y/Z). Call after 3D drawing ends (2D screen-space
// overlay).
void drawCompassRuler(
Vector3 right,
Vector3 up,
float zoomDistance,
Color rulerColor,
CompassAxisLabels labels = {});
// right/up: the current camera's screen-right/up directions in world space
// (e.g. cross(forward, camUp) / cross(right, forward) for a raylib Camera3D,
// or the first two rows of a world-to-eye rotation matrix).
// zoomDistance: current camera distance/zoom, used to size the ruler.
// rulerColor: contrast color for the ruler ticks/label (axis lines are
// always drawn in RGB = X/Y/Z). Call after 3D drawing ends (2D screen-space
// overlay).
void drawCompassRuler(Vector3 right, Vector3 up, float zoomDistance, Color rulerColor, CompassAxisLabels labels = {});

} // namespace raylib_widgets
Loading
Loading