Skip to content

Commit

Permalink
Fix empty module name (#148)
Browse files Browse the repository at this point in the history
* Found an empty module name

* move config.h include before the include of ObjectFactory.h

* restore namespace
  • Loading branch information
alxbilger authored May 13, 2024
1 parent 49c4591 commit fa58d4d
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 6 deletions.
1 change: 1 addition & 0 deletions BeamAdapter_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ find_package(Threads REQUIRED)

set(SOURCE_FILES
BeamInterpolation_test.cpp
component/controller/AdaptiveBeamController_test.cpp
component/controller/InterventionalRadiologyController_test.cpp
component/constraint/AdaptiveBeamSlidingConstraintTest.cpp
component/forcefield/AdaptiveBeamForceFieldAndMassTest.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/******************************************************************************
* BeamAdapter plugin *
* (c) 2006 Inria, University of Lille, CNRS *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: see Authors.md *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#include <gtest/gtest.h>
#include <sofa/simulation/graph/DAGNode.h>
#include <sofa/simpleapi/SimpleApi.h>
#include <sofa/core/ObjectFactory.h>

TEST(AdaptiveBeamController, target)
{
const auto node = sofa::simpleapi::createNode("node");
const auto controller = sofa::simpleapi::createObject(node, "AdaptiveBeamController");

const auto& creators = sofa::core::ObjectFactory::getInstance()->getEntry("AdaptiveBeamController").creatorMap;

const auto it = creators.find(sofa::defaulttype::Rigid3Types::Name());
EXPECT_NE(it, creators.end());

EXPECT_EQ(std::string(it->second->getTarget()), std::string("BeamAdapter"));
}
1 change: 1 addition & 0 deletions src/BeamAdapter/component/BeamInterpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define SOFA_PLUGIN_BEAMADAPTER_BEAMINTERPOLATION_CPP

#include <sofa/defaulttype/RigidTypes.h>
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>

/// This define is here to prevent the declaration of the template instances as "extern".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
#include <sofa/component/statecontainer/MechanicalObject.h>
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/VecTypes.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,16 @@
#define SOFA_PLUGIN_BEAMADAPTER_ADAPTIVEBEAMCONTROLLER_CPP

//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

#include <BeamAdapter/config.h>
#include <BeamAdapter/component/controller/AdaptiveBeamController.inl>


namespace sofa::component::controller::_adaptivebeamcontroller_
{

using sofa::defaulttype::Rigid3Types;
using sofa::defaulttype::Rigid3Types;
using core::RegisterObject;

Expand All @@ -58,7 +56,7 @@ using core::RegisterObject;
////////////////////////////////////////////////////////////////////////////////////////////////////

//TODO(dmarchal 2017-06-01): Il faut remplacer les descriptions dans RegisterObject par un vrai description
static int AdaptiveBeamControllerClass = RegisterObject("")
int AdaptiveBeamControllerClass = RegisterObject("Adaptive beam controller")
.add< AdaptiveBeamController<Rigid3Types> >()
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <BeamAdapter/component/BeamInterpolation.h>
#include <sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.h>
#include <sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.h>
#include <BeamAdapter/config.h>

////////////////////////////////////////////////////////////////////////////////////////////////////
/// Declarations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
******************************************************************************/
#define SOFA_PLUGIN_BEAMADAPTER_ACTIONCONTROLLER_CPP

#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

#include <BeamAdapter/config.h>
#include <BeamAdapter/component/controller/BeamAdapterActionController.inl>

namespace sofa::component::controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
//
#define SOFA_PLUGIN_BEAMADAPTER_INTERVENTIONALRADIOCONTROLLER_CPP

#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

#include <BeamAdapter/config.h>
#include <BeamAdapter/component/controller/InterventionalRadiologyController.inl>


Expand Down
1 change: 1 addition & 0 deletions src/BeamAdapter/component/controller/SutureController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
//
#define SOFA_PLUGIN_BEAMADAPTER_SUTURECONTROLLER_CPP

#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/RigidTypes.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
#include <sofa/defaulttype/RigidTypes.h>
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>

#include <BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
#include <sofa/defaulttype/RigidTypes.h>
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>
#include <BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl>

Expand Down
1 change: 1 addition & 0 deletions src/BeamAdapter/component/mapping/AdaptiveBeamMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
#include <sofa/core/behavior/MechanicalState.h>
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>

#include <BeamAdapter/component/mapping/AdaptiveBeamMapping.inl>
Expand Down
1 change: 1 addition & 0 deletions src/BeamAdapter/component/mapping/BeamLengthMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
#define BEAMADAPTER_BEAMLENGTHMAPPING_CPP
#include <sofa/core/behavior/MechanicalState.h>
#include <BeamAdapter/config.h>
#include <sofa/core/ObjectFactory.h>

#include <BeamAdapter/component/mapping/BeamLengthMapping.inl>
Expand Down

0 comments on commit fa58d4d

Please sign in to comment.