Skip to content

PLAT-11506#9

Open
CCPNobody wants to merge 22 commits into
mainfrom
PLAT-11506-misc-improvements
Open

PLAT-11506#9
CCPNobody wants to merge 22 commits into
mainfrom
PLAT-11506-misc-improvements

Conversation

@CCPNobody

Copy link
Copy Markdown
Member

PR Classification

UI enhancement and build system integration for Font Awesome icons, plus code cleanup and shader script improvements.

PR Summary

This PR integrates Font Awesome into the UI, updates the build system to generate icon headers, and refactors shader cache generation and effect configuration.

  • CMakeLists.txt: Integrates Font Awesome submodule, adds Python script to generate icon/font headers, and updates build dependencies.
  • fontAwesomeCreator.py: New script to generate C++ headers for Font Awesome TTF data and icon definitions.
  • uiRenderer.cpp/h: Refactors UI to use Font Awesome icons for controls, adds icon button helpers, and merges Font Awesome into ImGui fonts.
  • shaderCacheCreator.py: Refactored for better readability and robust shader input parsing.
  • graphicseffect.cpp/h: Adds a Reset method for effect reinitialization and improves pipeline management.

CCPNobody added 13 commits June 24, 2026 09:32
Added a script that takes the ttf font file and converts it into a binary header file.
It also generates defines so we can actually use it in c++ code effectively.

Added a build script to run the fontawesome generation when the script/font changes
And added a strike through button (for this is not active)
Introduced cameraFocus state to AppState for targeting specific bounding spheres. Updated camera trigger handling to use focusSphere. Enhanced the Camera menu to allow focusing on the whole model or individual meshes.
Remove global polygon mode state and UI; polygon mode is now determined per-mesh based on mesh topology. Refactor MeshRenderable and GraphicsEffect to support this, replacing SetShaderName/SetConfig with a new Reset method. Update UI to remove polygon mode selection and improve disabled state handling for missing mesh/model data.
Update Camera::GetProjection() to use a minimum far plane of 1.0f and set the near plane relative to the far plane, improving projection matrix stability and depth range handling.

PLAT-11626
Split monolithic UIRenderer into focused modules: uiGeneralWindow, uiMenubar, uiAnimationPlayback, uiCustomWidgets, and uiConsts. Moved UI logic into these components for better separation of concerns and maintainability. Introduced MenuState for UI visibility and unified file loading via cmfLoadRequest. Modernized code with improved state management, input handling, and C++ idioms. SceneRenderer no longer manages cmfContent callbacks
Copilot AI review requested due to automatic review settings July 3, 2026 11:57

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v20.1.2

Click here for the full clang-format patch
diff --git a/src/viewer/rendering/camera.cpp b/src/viewer/rendering/camera.cpp
index 7ca7d8a..160e37a 100644
--- a/src/viewer/rendering/camera.cpp
+++ b/src/viewer/rendering/camera.cpp
@@ -119 +119 @@ Matrix Camera::GetProjection() const
-	const float nearPlane = std::max( farPlane / 100.0f , centerDepth - boundingDepth );
+	const float nearPlane = std::max( farPlane / 100.0f, centerDepth - boundingDepth );

Have any feedback or feature suggestions? Share it here.

Comment thread src/viewer/rendering/camera.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the viewer UI by integrating Font Awesome icons (including build-time header generation), refactors shader cache generation for more robust parsing (including multi-usage vertex inputs), and improves effect/pipeline reconfiguration and camera focusing behavior.

Changes:

  • Integrate Font Awesome via a submodule + CMake-driven Python header generation, and update the UI to use icon-based controls.
  • Refactor shader cache generation to parse vertex declarations and support #pragma multi_usage inputs.
  • Add effect reset/recreate behavior and adjust rendering/camera state flows (pipeline reset, camera focus targeting, mesh rendering mode cleanup).

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/viewer/scripts/shaderCacheCreator.py Refactor shader cache generation; adds multi-usage vertex input parsing and cleaner code structure.
src/viewer/scripts/fontAwesomeCreator.py New generator for Font Awesome TTF binary header + icon lookup header.
src/viewer/rendering/vulkan/graphicseffect.h Adds Reset() API for reinitializing an effect with shader name + config.
src/viewer/rendering/vulkan/graphicseffect.cpp Implements pipeline recreation on config changes and effect resets.
src/viewer/rendering/uiRenderer.h Switches playback UI API to return icons (FaIcon) and includes generated Font Awesome lookup.
src/viewer/rendering/uiRenderer.cpp Adds Font Awesome font merge, icon button helpers, and UI updates (camera focus menu, playback icons, etc.).
src/viewer/rendering/uiRenderer_template_impl.h Adds disabled-state UI feedback when the model lacks requested axis data.
src/viewer/rendering/renderable/mesh.h Simplifies SetRenderingMode signature (removes polygon mode param).
src/viewer/rendering/renderable/mesh.cpp Uses GraphicsEffect::Reset, removes polygon-mode callback wiring, and derives polygon/topology from mesh topology.
src/viewer/rendering/models/primitiveEffects.cpp Migrates effect setup to Reset() for some effects; keeps existing shader name flows for axis variants.
src/viewer/rendering/camera.h Updates camera trigger handler signature to accept a focus sphere.
src/viewer/rendering/camera.cpp Uses cameraFocus to focus on sub-objects and adjusts projection near/far calculation.
src/viewer/CMakeLists.txt Adds Font Awesome header generation target + include dir; clarifies shader generation steps.
src/viewer/appState.h Removes polygon mode state; adds cameraFocus state.
src/viewer/appState.cpp Ensures cameraFocus callbacks are invoked.
.gitmodules Adds the Font Awesome submodule entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/viewer/rendering/uiRenderer.cpp Outdated
Comment thread src/viewer/rendering/uiRenderer.cpp Outdated
Comment thread src/viewer/scripts/fontAwesomeCreator.py Outdated
Comment thread src/viewer/scripts/fontAwesomeCreator.py Outdated
Comment thread src/viewer/scripts/fontAwesomeCreator.py Outdated
Comment thread src/viewer/rendering/uiRenderer.cpp Outdated
Comment thread src/viewer/rendering/uiRenderer.cpp Outdated
- Fixed formatting in Camera::GetProjection().
- Adjusted ImGui item width scoping in UIAnimationPlayback::Render().
- Improved font memory management in UIRenderer::Initialize().
- Changed icon size handling in fontAwesomeCreator.py to use floats.
@github-actions github-actions Bot dismissed their stale review July 3, 2026 12:41

outdated suggestion

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v20.1.2

Click here for the full clang-format patch
diff --git a/src/viewer/appState.cpp b/src/viewer/appState.cpp
index ab502bc..f6ad7c2 100644
--- a/src/viewer/appState.cpp
+++ b/src/viewer/appState.cpp
@@ -34 +33,0 @@ void AppState::ResetModelState()
-
diff --git a/src/viewer/application.cpp b/src/viewer/application.cpp
index 460acec..8db37e9 100644
--- a/src/viewer/application.cpp
+++ b/src/viewer/application.cpp
@@ -209 +209 @@ void Application::Run()
-			
+
diff --git a/src/viewer/main.cpp b/src/viewer/main.cpp
index 6c66d95..c48c467 100644
--- a/src/viewer/main.cpp
+++ b/src/viewer/main.cpp
@@ -25 +25 @@ int main( int argc, char** argv )
-	{	
+	{
diff --git a/src/viewer/rendering/ui/uiRenderer.cpp b/src/viewer/rendering/ui/uiRenderer.cpp
index 3ee5b36..a478586 100644
--- a/src/viewer/rendering/ui/uiRenderer.cpp
+++ b/src/viewer/rendering/ui/uiRenderer.cpp
@@ -58 +58 @@ void UIRenderer::Initialize( GLFWwindow* window, AppState& state )
-	io.Fonts->AddFontFromMemoryTTF( (void*)fa_solid_900_ttf_data, static_cast<int>(fa_solid_900_ttf_size), UiConsts::FONT_AWESOME_SIZE, &config, iconRanges );
+	io.Fonts->AddFontFromMemoryTTF( (void*)fa_solid_900_ttf_data, static_cast<int>( fa_solid_900_ttf_size ), UiConsts::FONT_AWESOME_SIZE, &config, iconRanges );

Have any feedback or feature suggestions? Share it here.

Comment thread src/viewer/appState.cpp Outdated
Comment thread src/viewer/application.cpp Outdated
Comment thread src/viewer/main.cpp Outdated
Comment thread src/viewer/rendering/ui/uiRenderer.cpp Outdated
@github-actions github-actions Bot dismissed their stale review July 3, 2026 12:42

outdated suggestion

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v20.1.2

Click here for the full clang-format patch
diff --git a/src/viewer/appState.cpp b/src/viewer/appState.cpp
index ab502bc..f6ad7c2 100644
--- a/src/viewer/appState.cpp
+++ b/src/viewer/appState.cpp
@@ -34 +33,0 @@ void AppState::ResetModelState()
-
diff --git a/src/viewer/application.cpp b/src/viewer/application.cpp
index 460acec..8db37e9 100644
--- a/src/viewer/application.cpp
+++ b/src/viewer/application.cpp
@@ -209 +209 @@ void Application::Run()
-			
+
diff --git a/src/viewer/main.cpp b/src/viewer/main.cpp
index 6c66d95..c48c467 100644
--- a/src/viewer/main.cpp
+++ b/src/viewer/main.cpp
@@ -25 +25 @@ int main( int argc, char** argv )
-	{	
+	{
diff --git a/src/viewer/rendering/ui/uiRenderer.cpp b/src/viewer/rendering/ui/uiRenderer.cpp
index 3ee5b36..a478586 100644
--- a/src/viewer/rendering/ui/uiRenderer.cpp
+++ b/src/viewer/rendering/ui/uiRenderer.cpp
@@ -58 +58 @@ void UIRenderer::Initialize( GLFWwindow* window, AppState& state )
-	io.Fonts->AddFontFromMemoryTTF( (void*)fa_solid_900_ttf_data, static_cast<int>(fa_solid_900_ttf_size), UiConsts::FONT_AWESOME_SIZE, &config, iconRanges );
+	io.Fonts->AddFontFromMemoryTTF( (void*)fa_solid_900_ttf_data, static_cast<int>( fa_solid_900_ttf_size ), UiConsts::FONT_AWESOME_SIZE, &config, iconRanges );

Have any feedback or feature suggestions? Share it here.

Comment thread src/viewer/appState.cpp Outdated
Comment thread src/viewer/application.cpp Outdated
Comment thread src/viewer/main.cpp Outdated
Comment thread src/viewer/rendering/ui/uiRenderer.cpp Outdated
@github-actions github-actions Bot dismissed their stale review July 3, 2026 12:45

outdated suggestion

Comment thread src/viewer/main.cpp Outdated
Comment thread src/viewer/scripts/shaderCacheCreator.py
Comment thread src/viewer/rendering/ui/uiMenubar.h
Comment thread src/viewer/rendering/ui/uiGeneralWindow.h Outdated
Comment thread src/viewer/rendering/ui/uiGeneralWindow.h Outdated
Comment thread src/viewer/rendering/ui/uiAnimationPlayback.cpp Outdated
Comment thread src/viewer/rendering/ui/uiConsts.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants