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
2 changes: 2 additions & 0 deletions applications/projects/SceneChecking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.22)
project(SceneChecking LANGUAGES CXX)

option(SOFA_SCENECHECKING_WARNINGS_ARE_ERRORS "Consider SceneChecking warnings as errors." OFF)

find_package(Sofa.Config REQUIRED)
sofa_find_package(Sofa.Simulation.Core REQUIRED)
sofa_find_package(Sofa.Component.SceneUtility REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void SceneCheckCollisionPipelineAndModels::doPrintSummary()
{
if(!m_message.empty())
{
msg_warning(this->getName()) << m_message;
scnchecking_warning(this->getName()) << m_message;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void SceneCheckCollisionResponse::doPrintSummary()
{
if(m_checkDone && m_message.str()!= "")
{
msg_warning(this->getName()) << m_message.str();
scnchecking_warning(this->getName()) << m_message.str();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void SceneCheckDuplicatedName::doPrintSummary()
{
if(m_hasDuplicates)
{
msg_warning(this->getName()) << msgendl
scnchecking_warning(this->getName()) << msgendl
<< m_duplicatedMsg.str()
<< "Nodes with similar names at the same level in your scene can "
"crash certain operations, please rename them";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ void SceneCheckEmptyNodeName::doCheckOn(sofa::simulation::Node* node)

void SceneCheckEmptyNodeName::doPrintSummary()
{
msg_warning_when(m_nbNodesWithEmptyName > 0, getName()) << "Nodes with empty name are found in"
" the scene. This can lead to undefined behaviors. It is recommended to give a name to all Nodes.";
if (m_nbNodesWithEmptyName > 0)
{
scnchecking_warning(getName()) << "Nodes with empty name are found in"
" the scene. This can lead to undefined behaviors. It is recommended to give a name to all Nodes.";
}
}

} // namespace sofa::scenechecking
} // namespace sofa::scenechecking
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void SceneCheckMissingRequiredPlugin::printSummary(simulation::SceneLoader* scen
{
tmp << "Note that XML syntax is assumed in the suggested lines to add.";
}
msg_warning(this->getName())
scnchecking_warning(this->getName())
<< "This scene is using component defined in plugins but is not importing the required plugins." << msgendl
<< indent << "Your scene may not work on a sofa environment with different pre-loaded plugins." << msgendl
<< indent << "To fix your scene and remove this warning you just need to cut & paste the following lines at the beginning of your scene: " << msgendl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void SceneCheckUsingAlias::doPrintSummary()

if(i.first != m_componentsCreatedUsingAlias.rbegin()->first) usingAliasesWarning << msgendl;
}
msg_warning(this->getName()) << usingAliasesWarning.str();
scnchecking_warning(this->getName()) << usingAliasesWarning.str();

m_componentsCreatedUsingAlias.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ namespace sofa::scenechecking
constexpr const char* MODULE_NAME = "@PROJECT_NAME@";
constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@";
} // namespace sofa::scenechecking

#cmakedefine SOFA_SCENECHECKING_WARNINGS_ARE_ERRORS

#if defined(SOFA_SCENECHECKING_WARNINGS_ARE_ERRORS)
#define scnchecking_warning msg_error
#else
#define scnchecking_warning msg_warning
#endif
Loading