Skip to content

Commit fa58d4d

Browse files
authored
Fix empty module name (#148)
* Found an empty module name * move config.h include before the include of ObjectFactory.h * restore namespace
1 parent 49c4591 commit fa58d4d

13 files changed

Lines changed: 51 additions & 6 deletions

BeamAdapter_test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ find_package(Threads REQUIRED)
77

88
set(SOURCE_FILES
99
BeamInterpolation_test.cpp
10+
component/controller/AdaptiveBeamController_test.cpp
1011
component/controller/InterventionalRadiologyController_test.cpp
1112
component/constraint/AdaptiveBeamSlidingConstraintTest.cpp
1213
component/forcefield/AdaptiveBeamForceFieldAndMassTest.cpp
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/******************************************************************************
2+
* BeamAdapter plugin *
3+
* (c) 2006 Inria, University of Lille, CNRS *
4+
* *
5+
* This program is free software; you can redistribute it and/or modify it *
6+
* under the terms of the GNU Lesser General Public License as published by *
7+
* the Free Software Foundation; either version 2.1 of the License, or (at *
8+
* your option) any later version. *
9+
* *
10+
* This program is distributed in the hope that it will be useful, but WITHOUT *
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
13+
* for more details. *
14+
* *
15+
* You should have received a copy of the GNU Lesser General Public License *
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17+
*******************************************************************************
18+
* Authors: see Authors.md *
19+
* *
20+
* Contact information: contact@sofa-framework.org *
21+
******************************************************************************/
22+
#include <gtest/gtest.h>
23+
#include <sofa/simulation/graph/DAGNode.h>
24+
#include <sofa/simpleapi/SimpleApi.h>
25+
#include <sofa/core/ObjectFactory.h>
26+
27+
TEST(AdaptiveBeamController, target)
28+
{
29+
const auto node = sofa::simpleapi::createNode("node");
30+
const auto controller = sofa::simpleapi::createObject(node, "AdaptiveBeamController");
31+
32+
const auto& creators = sofa::core::ObjectFactory::getInstance()->getEntry("AdaptiveBeamController").creatorMap;
33+
34+
const auto it = creators.find(sofa::defaulttype::Rigid3Types::Name());
35+
EXPECT_NE(it, creators.end());
36+
37+
EXPECT_EQ(std::string(it->second->getTarget()), std::string("BeamAdapter"));
38+
}

src/BeamAdapter/component/BeamInterpolation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#define SOFA_PLUGIN_BEAMADAPTER_BEAMINTERPOLATION_CPP
3434

3535
#include <sofa/defaulttype/RigidTypes.h>
36+
#include <BeamAdapter/config.h>
3637
#include <sofa/core/ObjectFactory.h>
3738

3839
/// This define is here to prevent the declaration of the template instances as "extern".

src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
2525
#include <sofa/component/statecontainer/MechanicalObject.h>
26+
#include <BeamAdapter/config.h>
2627
#include <sofa/core/ObjectFactory.h>
2728
#include <sofa/defaulttype/VecTypes.h>
2829

src/BeamAdapter/component/controller/AdaptiveBeamController.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,16 @@
3434
#define SOFA_PLUGIN_BEAMADAPTER_ADAPTIVEBEAMCONTROLLER_CPP
3535

3636
//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
37+
#include <BeamAdapter/config.h>
3738
#include <sofa/core/ObjectFactory.h>
3839
#include <sofa/defaulttype/VecTypes.h>
3940
#include <sofa/defaulttype/RigidTypes.h>
4041

41-
#include <BeamAdapter/config.h>
4242
#include <BeamAdapter/component/controller/AdaptiveBeamController.inl>
4343

44-
4544
namespace sofa::component::controller::_adaptivebeamcontroller_
4645
{
4746

48-
using sofa::defaulttype::Rigid3Types;
4947
using sofa::defaulttype::Rigid3Types;
5048
using core::RegisterObject;
5149

@@ -58,7 +56,7 @@ using core::RegisterObject;
5856
////////////////////////////////////////////////////////////////////////////////////////////////////
5957

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

src/BeamAdapter/component/controller/AdaptiveBeamController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <BeamAdapter/component/BeamInterpolation.h>
4444
#include <sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.h>
4545
#include <sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.h>
46+
#include <BeamAdapter/config.h>
4647

4748
////////////////////////////////////////////////////////////////////////////////////////////////////
4849
/// Declarations

src/BeamAdapter/component/controller/BeamAdapterActionController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
******************************************************************************/
2222
#define SOFA_PLUGIN_BEAMADAPTER_ACTIONCONTROLLER_CPP
2323

24+
#include <BeamAdapter/config.h>
2425
#include <sofa/core/ObjectFactory.h>
2526
#include <sofa/defaulttype/VecTypes.h>
2627
#include <sofa/defaulttype/RigidTypes.h>
2728

28-
#include <BeamAdapter/config.h>
2929
#include <BeamAdapter/component/controller/BeamAdapterActionController.inl>
3030

3131
namespace sofa::component::controller

src/BeamAdapter/component/controller/InterventionalRadiologyController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
//
3333
#define SOFA_PLUGIN_BEAMADAPTER_INTERVENTIONALRADIOCONTROLLER_CPP
3434

35+
#include <BeamAdapter/config.h>
3536
#include <sofa/core/ObjectFactory.h>
3637
#include <sofa/defaulttype/VecTypes.h>
3738
#include <sofa/defaulttype/RigidTypes.h>
3839

39-
#include <BeamAdapter/config.h>
4040
#include <BeamAdapter/component/controller/InterventionalRadiologyController.inl>
4141

4242

src/BeamAdapter/component/controller/SutureController.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
//
3333
#define SOFA_PLUGIN_BEAMADAPTER_SUTURECONTROLLER_CPP
3434

35+
#include <BeamAdapter/config.h>
3536
#include <sofa/core/ObjectFactory.h>
3637
#include <sofa/defaulttype/RigidTypes.h>
3738

src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
//////////////////////// Inclusion of headers...from wider to narrower/closer //////////////////////
3636
#include <sofa/defaulttype/RigidTypes.h>
37+
#include <BeamAdapter/config.h>
3738
#include <sofa/core/ObjectFactory.h>
3839

3940
#include <BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl>

0 commit comments

Comments
 (0)