Skip to content

Commit

Permalink
Refactor paths regarding new SOFA Standard
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpaul committed Mar 25, 2024
1 parent 58034a4 commit ca30479
Show file tree
Hide file tree
Showing 24 changed files with 52 additions and 57 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_compile_options(-Wall -Wextra -Wpedantic)
find_package(Sofa.Framework REQUIRED) # Needed to use SofaCore, SofaHelper and SofaDefaultType
find_package(Sofa.Component.Topology REQUIRED) # Needed to use SofaCore, SofaHelper and SofaDefaultType
find_package(Sofa.Component.StateContainer REQUIRED) # Needed to use SofaCore, SofaHelper and SofaDefaultType
find_package(Sofa.GUI.Component REQUIRED) # Needed to use SofaCore, SofaHelper and SofaDefaultType
find_package(Threads REQUIRED)

find_package(OpenIGTLink QUIET) # Needed to use SofaCore, SofaHelper and SofaDefaultType
Expand All @@ -34,7 +35,7 @@ file(GLOB_RECURSE SOURCE_FILES

# SOFA plugin are basically libraries
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} Sofa.Framework Sofa.Component.Topology Sofa.Component.StateContainer OpenIGTLink Threads::Threads)
target_link_libraries(${PROJECT_NAME} Sofa.Framework Sofa.Component.Topology Sofa.Component.StateContainer OpenIGTLink Threads::Threads Sofa.GUI.Component)
include_directories(src)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ extern "C"
}
}

const char* getModuleName() { return "SofaSlicer"; }
const char* getModuleName() { return "SofaIGTLink"; }

const char* getModuleVersion() { return "0.0"; }

const char* getModuleLicense() { return "Private"; }

const char* getModuleDescription() { return "Sofa integration to Slicer"; }
const char* getModuleDescription() { return "Bridge from SOFA to IGTLink"; }

const char* getModuleComponentList()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once
#include <SofaIGTLink/messages/iGTLinkMessage.h>
#include <sofa/igtlink/messages/iGTLinkMessage.h>


using namespace sofa::core::objectmodel;
namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{

iGTLinkMessage::iGTLinkMessage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#include "sofa/core/objectmodel/Link.h"
#include "sofa/core/objectmodel/DataCallback.h"
#include <igtlMessageBase.h>
#include <SofaIGTLink/sockets/iGTLinkBase.h>
#include <sofa/igtlink/sockets/iGTLinkBase.h>


using namespace sofa::core::objectmodel;
namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{

class iGTLinkMessageBase : public BaseObject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include "sofa/core/ObjectFactory.h"
#include <SofaIGTLink/messages/iGTLinkPointMessage.h>
#include <sofa/igtlink/messages/iGTLinkPointMessage.h>
#include <igtlPointMessage.h>

using namespace sofa::core::objectmodel;
namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
template<class DataType>
iGTLinkPointMessage<DataType>::iGTLinkPointMessage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <SofaIGTLink/messages/iGTLinkMessage.h>
#include <sofa/igtlink/messages/iGTLinkMessage.h>

using namespace sofa::core::objectmodel;
namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
template<class DataType>
class iGTLinkPointMessage : public iGTLinkMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include "sofa/core/ObjectFactory.h"
#include <SofaIGTLink/messages/iGTLinkPolyDataMessage.h>
#include <sofa/igtlink/messages/iGTLinkPolyDataMessage.h>


using namespace sofa::core::objectmodel;
namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
template<class DataType>
iGTLinkPolyDataMessage<DataType>::iGTLinkPolyDataMessage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include <SofaIGTLink/messages/iGTLinkMessage.h>
#include <sofa/igtlink/messages/iGTLinkMessage.h>
#include <sofa/core/topology/BaseMeshTopology.h>
#include <igtlPolyDataMessage.h>

using namespace sofa::core::objectmodel;
namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
template<class DataType>
class iGTLinkPolyDataMessage : public iGTLinkMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <SofaIGTLink/sockets/iGTLinkBase.h>
#include <SofaIGTLink/messages/iGTLinkMessage.h>
#include <SofaIGTLink/sockets/iGTLinkThread.h>
#include <sofa/igtlink/sockets/iGTLinkBase.h>
#include <sofa/igtlink/messages/iGTLinkMessage.h>
#include <sofa/igtlink/sockets/iGTLinkThread.h>


namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
iGTLinkBase::iGTLinkBase()
: d_timeout(initData(&d_timeout,-1,"timeout","Timeout in milliseconds"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using namespace sofa::core::objectmodel;

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
class iGTLinkMessageBase;
class iGTLinkReceiverThread;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define SOFASLICER_IGTCLIENT_CPP

#include <sofa/core/ObjectFactory.h>
#include <SofaIGTLink/sockets/iGTLinkClient.inl>
#include <sofa/igtlink/sockets/iGTLinkClient.inl>

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{

static int iGTLinkClientClass = sofa::core::RegisterObject("iGTLink client wrapper")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

#include <igtlOSUtil.h>
#include <igtlPointMessage.h>
#include <SofaIGTLink/sockets/iGTLinkBase.h>
#include <sofa/igtlink/sockets/iGTLinkBase.h>

using namespace sofa::core::objectmodel;

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
class iGTLinkClient : public iGTLinkBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include <SofaIGTLink/sockets/iGTLinkClient.h>
#include <sofa/igtlink/sockets/iGTLinkClient.h>


namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{

iGTLinkClient::iGTLinkClient()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define SOFASLICER_IGTServer_CPP

#include <sofa/core/ObjectFactory.h>
#include <SofaIGTLink/sockets/iGTLinkServer.inl>
#include <sofa/igtlink/sockets/iGTLinkServer.inl>

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{

static int iGTLinkServerClass = sofa::core::RegisterObject("iGTLink Server wrapper")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include <igtlOSUtil.h>
#include <igtlPointMessage.h>
#include <igtlServerSocket.h>
#include <SofaIGTLink/sockets/iGTLinkBase.h>
#include <SofaIGTLink/messages/iGTLinkMessage.h>
#include <sofa/igtlink/sockets/iGTLinkBase.h>
#include <sofa/igtlink/messages/iGTLinkMessage.h>

using namespace sofa::core::objectmodel;

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
class iGTLinkServer : public iGTLinkBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once
#include <SofaIGTLink/sockets/iGTLinkServer.h>
#include <sofa/igtlink/sockets/iGTLinkServer.h>
#include <sofa/simulation/AnimateBeginEvent.h>
#include <SofaIGTLink/sockets/iGTLinkThread.h>
#include <sofa/igtlink/sockets/iGTLinkThread.h>
#include <map>


namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{

iGTLinkServer::iGTLinkServer()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <SofaIGTLink/sockets/iGTLinkBase.h>
#include <SofaIGTLink/sockets/iGTLinkThread.h>
#include <sofa/igtlink/sockets/iGTLinkBase.h>
#include <sofa/igtlink/sockets/iGTLinkThread.h>
#include <igtlPointMessage.h>
#include <igtlPolyDataMessage.h>

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include <memory>
#include <atomic>
#include <mutex>
#include <SofaIGTLink/messages/iGTLinkMessage.h>
#include <sofa/igtlink/messages/iGTLinkMessage.h>
#include <sofa/core/objectmodel/Data.h>

class iGTLinkBase;
using namespace sofa::core::objectmodel;

namespace SofaSlicer::openigtlink
namespace sofa::openigtlink
{
class iGTLinkBaseThread
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#include <SofaIGTLink/utils/EngineToMState.inl>
#include <sofa/igtlink/utils/EngineToMState.inl>
#include <sofa/core/ObjectFactory.h>

namespace sofa {

namespace registrationcst {
namespace sofa::openigtlink {

SOFA_DECL_CLASS(EngineToMState)

Expand All @@ -13,5 +11,4 @@ int EngineToMStateClass = core::RegisterObject("")

}

}

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/core/objectmodel/DataCallback.h>

namespace sofa {

namespace registrationcst {
namespace sofa::openigtlink {

template<class DataTypes>
class EngineToMState : public core::objectmodel::BaseObject {
Expand Down Expand Up @@ -45,4 +43,3 @@ public :

}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#pragma once

#include <SofaIGTLink/utils/EngineToMState.h>
#include <sofa/igtlink/utils/EngineToMState.h>
#include <sofa/core/visual/VisualParams.h>
#include <sofa/type/Quat.h>
#include <sofa/simulation/AnimateBeginEvent.h>
#include <sofa/component/statecontainer/MechanicalObject.h>


namespace sofa {

namespace registrationcst {

namespace sofa::openigtlink {

using namespace core::behavior;
using namespace sofa::type;
Expand Down Expand Up @@ -80,5 +80,5 @@ void EngineToMState<DataTypes>::handleEvent(sofa::core::objectmodel::Event *even

}

}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <SofaIGTLink/utils/UserInteractionController.inl>
#include <sofa/igtlink/utils/UserInteractionController.inl>
#include <sofa/core/ObjectFactory.h>

namespace SofaSlicer {
namespace sofa::openigtlink {

int UserInteractionControllerClass = sofa::core::RegisterObject("")
.add<UserInteractionController>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using namespace sofa::core::objectmodel;

namespace SofaSlicer {
namespace sofa::openigtlink {

class UserInteractionController : public BaseObject {
public :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <SofaIGTLink/utils/UserInteractionController.h>
#include <sofa/igtlink/utils/UserInteractionController.h>
#include <sofa/core/visual/VisualParams.h>
#include <sofa/type/Quat.h>
#include <sofa/core/ObjectFactory.h>
Expand All @@ -11,7 +11,7 @@
#include <Eigen/SVD>
#include <sofa/helper/AdvancedTimer.h>

namespace SofaSlicer {
namespace sofa::openigtlink {


UserInteractionController::UserInteractionController()
Expand Down

0 comments on commit ca30479

Please sign in to comment.