Skip to content

Commit

Permalink
Refactor per review
Browse files Browse the repository at this point in the history
  • Loading branch information
samoncrief committed Dec 30, 2024
1 parent 80aad2b commit 09570fd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 28 deletions.
2 changes: 1 addition & 1 deletion application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ if(F3D_PLUGIN_BUILD_ALEMBIC AND F3D_PLUGIN_BUILD_ASSIMP)
endif()

# Test bindings-list display
f3d_test(NAME TestBindingsList ARGS --bindings-list REGEXP "Any.5 Toggle Orthographic Projection")
f3d_test(NAME TestBindingsList ARGS --list-bindings REGEXP "Any.5 Toggle Orthographic Projection")

# Test rendering backends
# For some reason the sanitizer detects leaks because of EGL and OSMesa
Expand Down
4 changes: 3 additions & 1 deletion library/private/scene_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class scene_impl : public scene
*/
void SetInteractor(interactor_impl* interactor);

// Display available cameras in the log
/**
* Display available cameras in the log
*/
void PrintImporterDescription(log::VerboseLevel level);

private:
Expand Down
30 changes: 8 additions & 22 deletions library/src/scene_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,29 +141,29 @@ class scene_impl::internals
scene_impl::internals::DisplayAllInfo(this->MetaImporter, this->Window);
}

static void DisplayImporterDescription(vtkImporter* importer)
static void DisplayImporterDescription(log::VerboseLevel level, vtkImporter* importer)
{
vtkIdType availCameras = importer->GetNumberOfCameras();
if (availCameras <= 0)
{
log::debug("No camera available");
log::print(level, "No camera available");
}
else
{
log::debug("Camera(s) available are:");
log::print(level, "Camera(s) available are:");
}
for (int i = 0; i < availCameras; i++)
{
log::debug(i, ": ", importer->GetCameraName(i));
log::print(level, i, ": ", importer->GetCameraName(i));
}
log::debug("");
log::debug(importer->GetOutputsDescription(), "\n");
log::print(level, "");
log::print(level, importer->GetOutputsDescription(), "\n");
}

static void DisplayAllInfo(vtkImporter* importer, window_impl& window)
{
// Display output description
scene_impl::internals::DisplayImporterDescription(importer);
scene_impl::internals::DisplayImporterDescription(log::VerboseLevel::DEBUG, importer);

// Display coloring information
window.PrintColoringDescription(log::VerboseLevel::DEBUG);
Expand Down Expand Up @@ -341,20 +341,6 @@ void scene_impl::SetInteractor(interactor_impl* interactor)

void scene_impl::PrintImporterDescription(log::VerboseLevel level)
{
vtkIdType availCameras = this->Internals->MetaImporter->GetNumberOfCameras();
if (availCameras <= 0)
{
log::print(level, "No camera available");
}
else
{
log::print(level, "Camera(s) available are:");
}
for (int i = 0; i < availCameras; i++)
{
log::print(level, i, ": ", this->Internals->MetaImporter->GetCameraName(i));
}
log::print(level, "");
log::print(level, this->Internals->MetaImporter->GetOutputsDescription(), "\n");
scene_impl::internals::DisplayImporterDescription(level, this->Internals->MetaImporter);
}
}
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionCheatsheetConfigFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionConsoleTypingSceneInfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09570fd

Please sign in to comment.