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
16 changes: 7 additions & 9 deletions src/Registration/ClosestPointRegistrationForceField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@ namespace forcefield
{

using namespace sofa::defaulttype;

// Register in the Factory
int ClosestPointRegistrationForceFieldClass = core::RegisterObject("Compute forces based on closest points from/to a target surface/point set")
.add< ClosestPointRegistrationForceField<Vec3Types> >()

;

template class SOFA_REGISTRATION_API ClosestPointRegistrationForceField<Vec3Types>;
// Register in the Factory
void registerClosestPointRegistrationForceField(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Compute forces based on closest points from/to a target surface/point set")
.add< ClosestPointRegistrationForceField<Vec3Types> >());
}



template class SOFA_REGISTRATION_API ClosestPointRegistrationForceField<Vec3Types>;

}
}
Expand Down
9 changes: 6 additions & 3 deletions src/Registration/GroupwiseRegistrationEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ namespace engine

using namespace defaulttype;

int GroupwiseRegistrationEngineClass = core::RegisterObject("Register a set of meshes of similar topology")
.add<GroupwiseRegistrationEngine< Vec3Types > >(true)

;
void registerGroupwiseRegistrationEngine(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Register a set of meshes of similar topology")
.add< GroupwiseRegistrationEngine< Vec3Types > >(true));
}

template class SOFA_REGISTRATION_API GroupwiseRegistrationEngine< Vec3Types >;


Expand Down
8 changes: 5 additions & 3 deletions src/Registration/InertiaAlign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ namespace component
using namespace sofa::type;
using namespace sofa::defaulttype;

int InertiaAlignClass = core::RegisterObject("An engine computing inertia matrix and the principal direction of a mesh.")
.add< InertiaAlign >()
;
void registerInertiaAlign(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("An engine computing inertia matrix and the principal direction of a mesh")
.add< InertiaAlign >());
}


InertiaAlign::InertiaAlign()
Expand Down
8 changes: 5 additions & 3 deletions src/Registration/IntensityProfileCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ namespace engine

using namespace defaulttype;

int IntensityProfileCreatorClass = core::RegisterObject("Create reference intensity profiles from custom values")
void registerIntensityProfileCreator(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Create reference intensity profiles from custom values")
.add<IntensityProfileCreator<ImageUC> >(true)
.add<IntensityProfileCreator<ImageUS> >()
.add<IntensityProfileCreator<ImageS> >()
.add<IntensityProfileCreator<ImageD> >()
.add<IntensityProfileCreator<ImageB> >()
;
.add<IntensityProfileCreator<ImageB> >());
}

template class SOFA_REGISTRATION_API IntensityProfileCreator<ImageUC>;
template class SOFA_REGISTRATION_API IntensityProfileCreator<ImageUS>;
Expand Down
30 changes: 15 additions & 15 deletions src/Registration/IntensityProfileRegistrationForceField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ namespace forcefield
using namespace defaulttype;

// Register in the Factory
int IntensityProfileRegistrationForceFieldClass = core::RegisterObject("Compute normal forces on a point set based on the closest intensity profile in the target image")
void registerIntensityProfileRegistrationForceField(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Compute normal forces on a point set based on the closest intensity profile in the target image")
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUC> >(true)
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUS> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageD> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageC> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageI> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUI> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageS> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageL> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUL> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageF> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageB> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUS> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageD> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageC> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageI> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUI> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageS> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageL> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageUL> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageF> >()
.add< IntensityProfileRegistrationForceField<Vec3Types,ImageB> >());
}


;

template class SOFA_REGISTRATION_API IntensityProfileRegistrationForceField<Vec3Types,ImageUC>;
template class SOFA_REGISTRATION_API IntensityProfileRegistrationForceField<Vec3Types,ImageUC>;
template class SOFA_REGISTRATION_API IntensityProfileRegistrationForceField<Vec3Types,ImageUS>;
template class SOFA_REGISTRATION_API IntensityProfileRegistrationForceField<Vec3Types,ImageD>;
template class SOFA_REGISTRATION_API IntensityProfileRegistrationForceField<Vec3Types,ImageC>;
Expand Down
8 changes: 5 additions & 3 deletions src/Registration/RegistrationContactForceField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ using namespace sofa::defaulttype;


// Register in the Factory
int RegistrationContactForceFieldClass = core::RegisterObject("Contact using attractive springs")
.add< RegistrationContactForceField<Vec3Types> >()
void registerRegistrationContactForceField(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Contact using attractive springs")
.add< RegistrationContactForceField<Vec3Types> >());
}

;

template class SOFA_REGISTRATION_API RegistrationContactForceField<Vec3Types>;

Expand Down
10 changes: 7 additions & 3 deletions src/Registration/RegistrationExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/#include "RegistrationExporter.h"
******************************************************************************/
#include "RegistrationExporter.h"

#include <sstream>
#include <iomanip>
Expand All @@ -43,8 +44,11 @@ namespace component
namespace misc
{

int RegistrationExporterClass = core::RegisterObject("Replicate loaded obj files into path, with current positions")
.add< RegistrationExporter >();
void registerRegistrationExporter(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Replicate loaded obj files into path, with current positions")
.add< RegistrationExporter >());
}

RegistrationExporter::RegistrationExporter()
: stepCounter(0)
Expand Down
10 changes: 7 additions & 3 deletions src/Registration/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef REGISTRATION_CONFIG_H
#define REGISTRATION_CONFIG_H
#pragma once

#include <sofa/config.h>

Expand All @@ -31,6 +30,7 @@
#cmakedefine01 REGISTRATION_HAVE_SOFA_GL

#cmakedefine01 REGISTRATION_HAVE_IMAGE
#cmakedefine REGISTRATION_USES_IMAGE

#ifdef SOFA_BUILD_REGISTRATION
# define SOFA_TARGET Registration
Expand All @@ -39,4 +39,8 @@
# define SOFA_REGISTRATION_API SOFA_IMPORT_DYNAMIC_LIBRARY
#endif

#endif
namespace registration
{
constexpr const char* MODULE_NAME = "@PROJECT_NAME@";
constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@";
} // namespace registration
57 changes: 45 additions & 12 deletions src/Registration/initRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,38 @@
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#include <Registration/config.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/helper/system/PluginManager.h>

namespace sofa
namespace sofa::component
{

namespace component
extern void registerInertiaAlign(sofa::core::ObjectFactory* factory);
}
namespace sofa::component::engine
{
extern void registerGroupwiseRegistrationEngine(sofa::core::ObjectFactory* factory);
#ifdef REGISTRATION_USES_IMAGE
extern void registerIntensityProfileCreator(sofa::core::ObjectFactory* factory);
#endif
}
namespace sofa::component::forcefield
{
#ifdef REGISTRATION_USES_IMAGE
extern void registerIntensityProfileRegistrationForceField(sofa::core::ObjectFactory* factory);
#endif
extern void registerClosestPointRegistrationForceField(sofa::core::ObjectFactory* factory);
}
namespace sofa::component::interactionforcefield
{
extern void registerRegistrationContactForceField(sofa::core::ObjectFactory* factory);
}
namespace sofa::component::misc
{
extern void registerRegistrationExporter(sofa::core::ObjectFactory* factory);
}

namespace registration
{
//Here are just several convenient functions to help user to know what contains the plugin

extern "C" {
Expand All @@ -35,26 +60,29 @@ namespace component
SOFA_REGISTRATION_API const char* getModuleVersion();
SOFA_REGISTRATION_API const char* getModuleLicense();
SOFA_REGISTRATION_API const char* getModuleDescription();
SOFA_REGISTRATION_API const char* getModuleComponentList();
SOFA_REGISTRATION_API void registerObjects(sofa::core::ObjectFactory* factory);
}

void initExternalModule()
{
static bool first = true;
if (first)
{
// make sure that this plugin is registered into the PluginManager
sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME);

first = false;
}
}

const char* getModuleName()
{
return "Registration";
return MODULE_NAME;
}

const char* getModuleVersion()
{
return "0.1";
return MODULE_VERSION;
}

const char* getModuleLicense()
Expand All @@ -68,12 +96,17 @@ namespace component
return "Model/image registration force fields";
}

const char* getModuleComponentList()
void registerObjects(sofa::core::ObjectFactory* factory)
{
return "ImageRegistrationLoader, IntensityProfileRegistrationForceField, RegistrationContact, RegistrationContactForceField, ClosestPointRegistrationForceField, RegistrationExporter";
sofa::component::registerInertiaAlign(factory);
sofa::component::engine::registerGroupwiseRegistrationEngine( factory);
#ifdef REGISTRATION_USES_IMAGE
sofa::component::engine::registerIntensityProfileCreator(factory);
sofa::component::forcefield::registerIntensityProfileRegistrationForceField(factory);
#endif
sofa::component::forcefield::registerClosestPointRegistrationForceField(factory);
sofa::component::interactionforcefield::registerRegistrationContactForceField(factory);
sofa::component::misc::registerRegistrationExporter(factory);
}

} // namespace registration

} // namespace sofa

} // namespace registration
Loading