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
7 changes: 4 additions & 3 deletions SofaGLFW/src/SofaGLFW/BaseGUIEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ class BaseGUIEngine
virtual bool dispatchMouseEvents() = 0;
virtual void resetCounter() = 0;
virtual sofa::type::Vec2i getFrameBufferPixels(std::vector<uint8_t>& pixels) = 0;
virtual void openFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot) {};
virtual void loadFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot, std::string filePathName, bool reload = false) {};
virtual void contentScaleChanged(float xscale, float yscale) {}
virtual void openFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot) { SOFA_UNUSED(baseGUI); SOFA_UNUSED(groot); };
virtual void loadFile(SofaGLFWBaseGUI* baseGUI, sofa::core::sptr<sofa::simulation::Node>& groot, std::string filePathName, bool reload = false)
{ SOFA_UNUSED(baseGUI); SOFA_UNUSED(groot); SOFA_UNUSED(filePathName); SOFA_UNUSED(reload); };
virtual void contentScaleChanged(float xscale, float yscale) { SOFA_UNUSED(xscale); SOFA_UNUSED(yscale); };
};

} // namespace sofaglfw
3 changes: 2 additions & 1 deletion SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void ImGuiGUIEngine::openFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sp
void ImGuiGUIEngine::saveScreenshot(sofaglfw::SofaGLFWBaseGUI* baseGUI)
{
nfdchar_t *outPath;
std::array<nfdfilteritem_t, 1> filterItem{ {"Image", "jpg,png"} };
std::array<nfdfilteritem_t, 1> filterItem{ { {"Image", "jpg,png"} } };
const auto sceneFilename = baseGUI->getSceneFileName();
std::string baseFilename{};
if (!sceneFilename.empty())
Expand Down Expand Up @@ -922,6 +922,7 @@ bool ImGuiGUIEngine::dispatchMouseEvents()

void ImGuiGUIEngine::contentScaleChanged(float xscale, float yscale)
{
SOFA_UNUSED(xscale);
loadFont(yscale);
}

Expand Down
6 changes: 3 additions & 3 deletions SofaImGui/src/SofaImGui/windows/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace windows {
sofa::type::vector<sofa::helper::Record> _records = sofa::helper::AdvancedTimer::getRecords("Animate");
allRecords.emplace_back(std::move(_records));

while (allRecords.size() >= bufferSize)
while ((int)allRecords.size() >= bufferSize)
{
allRecords.pop_front();
}
Expand Down Expand Up @@ -126,7 +126,7 @@ namespace windows {
sofa::helper::system::thread::ctime_t t0;
for (const auto& rec : records)
{
if (timerId == rec.id)
if (timerId == (int)rec.id)
{
chart.label = rec.label;
if (rec.type == sofa::helper::Record::RBEGIN || rec.type == sofa::helper::Record::RSTEP_BEGIN || rec.type == sofa::helper::Record::RSTEP)
Expand Down Expand Up @@ -168,7 +168,7 @@ namespace windows {
ImGui::SliderInt("Frame", &selectedFrame, 0, allRecords.size());


if (selectedFrame >= 0 && selectedFrame < allRecords.size())
if (selectedFrame >= 0 && selectedFrame < (int)allRecords.size())
{
const auto records = allRecords[selectedFrame];
if (!records.empty())
Expand Down
2 changes: 1 addition & 1 deletion SofaImGui/src/SofaImGui/windows/ViewPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace windows
* @param threshold The precision threshold to determine significant movement.
* @return True if the viewport has moved beyond the threshold, false otherwise.
*/
static bool hasViewportMoved(float currentX,
[[maybe_unused]] static bool hasViewportMoved(float currentX,
float currentY,
float lastX,
float lastY,
Expand Down
Loading