From 065d9d66e4febeb8e994e554adfd912157da61f3 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 5 Dec 2024 23:21:43 +0100 Subject: [PATCH] hpp-fcl -> coal --- CMakeLists.txt | 2 +- package.xml | 2 +- plugins/CMakeLists.txt | 10 +++++----- plugins/{hppfcl => coal}/CMakeLists.txt | 4 ++-- plugins/{hppfcl => coal}/node.cc | 6 +++--- plugins/{hppfcl => coal}/node.hh | 18 +++++++++--------- plugins/{hppfcl => coal}/plugin.cc | 19 +++++++++---------- plugins/{hppfcl => coal}/plugin.hh | 4 ++-- 8 files changed, 32 insertions(+), 33 deletions(-) rename plugins/{hppfcl => coal}/CMakeLists.txt (97%) rename plugins/{hppfcl => coal}/node.cc (95%) rename plugins/{hppfcl => coal}/node.hh (79%) rename plugins/{hppfcl => coal}/plugin.cc (85%) rename plugins/{hppfcl => coal}/plugin.hh (90%) diff --git a/CMakeLists.txt b/CMakeLists.txt index bde9bca..c2f1804 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ set(PACKAGE_EXTRA_MACROS "set(HPP_GUI_QTVERSION ${HPP_GUI_QTVERSION})") # Search for Boost. add_project_dependency(Boost REQUIRED COMPONENTS thread regex system) -add_project_dependency("hpp-fcl") +add_project_dependency("coal") add_project_dependency("hpp-manipulation-corba") add_optional_dependency("remoteimu") diff --git a/package.xml b/package.xml index 10fd02d..cb48076 100644 --- a/package.xml +++ b/package.xml @@ -17,7 +17,7 @@ gepetto-viewer gepetto-viewer-corba - hpp-fcl + coal hpp-corbaserver hpp-manipulation-corba diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 9c6d585..e6edcb5 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -25,9 +25,9 @@ set(BUILD_HPP_WIDGETS_PLUGIN set(BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN ${hpp-manipulation-corba_FOUND} CACHE BOOL "Build hppmanipulationwidgetsplugin") -set(BUILD_HPP_FCL_PLUGIN - ${hpp-fcl_FOUND} - CACHE BOOL "Build hppfclplugin") +set(BUILD_COAL_PLUGIN + ${coal_FOUND} + CACHE BOOL "Build coalplugin") if(hpp-corbaserver_FOUND) if(REMOTEIMU_FOUND AND BUILD_REMOTEIMU_PLUGIN) @@ -47,6 +47,6 @@ if(hpp-corbaserver_FOUND) endif(hpp-manipulation-corba_FOUND AND BUILD_HPP_MANIPULATION_WIDGETS_PLUGIN) endif(hpp-corbaserver_FOUND) -if(BUILD_HPP_FCL_PLUGIN AND hpp-fcl_FOUND) - add_subdirectory(hppfcl) +if(BUILD_COAL_PLUGIN AND coal_FOUND) + add_subdirectory(coal) endif() diff --git a/plugins/hppfcl/CMakeLists.txt b/plugins/coal/CMakeLists.txt similarity index 97% rename from plugins/hppfcl/CMakeLists.txt rename to plugins/coal/CMakeLists.txt index cde4838..a6ec712 100644 --- a/plugins/hppfcl/CMakeLists.txt +++ b/plugins/coal/CMakeLists.txt @@ -19,7 +19,7 @@ else() endif() gepetto_gui_plugin( - hppfclplugin + coalplugin ${QT4} HEADERS_NO_MOC node.hh @@ -31,7 +31,7 @@ gepetto_gui_plugin( plugin.cc node.cc LINK_DEPENDENCIES - hpp-fcl::hpp-fcl + coal::coal gepetto-viewer-corba::gepetto-viewer-corba Boost::thread Boost::regex diff --git a/plugins/hppfcl/node.cc b/plugins/coal/node.cc similarity index 95% rename from plugins/hppfcl/node.cc rename to plugins/coal/node.cc index 27bdce4..7ebf170 100644 --- a/plugins/hppfcl/node.cc +++ b/plugins/coal/node.cc @@ -16,7 +16,7 @@ // hpp-gui If not, see // . -#include +#include #include @@ -38,8 +38,8 @@ void BVHDisplay::setLevel(const int& level) { level_ = level; } -void BVHDisplay::init(hpp::fcl::SplitMethodType splitMethod) { - using namespace hpp::fcl; +void BVHDisplay::init(coal::SplitMethodType splitMethod) { + using namespace coal; BVHPtr_t bvh(new BVH_t); bvh->bv_splitter.reset(new BVSplitter(splitMethod)); diff --git a/plugins/hppfcl/node.hh b/plugins/coal/node.hh similarity index 79% rename from plugins/hppfcl/node.hh rename to plugins/coal/node.hh index 5f57079..e4dec1b 100644 --- a/plugins/hppfcl/node.hh +++ b/plugins/coal/node.hh @@ -16,12 +16,12 @@ // hpp-gui If not, see // . -#ifndef HPP_GUI_HPP_FCL_PLUGIN_NODE_HH -#define HPP_GUI_HPP_FCL_PLUGIN_NODE_HH +#ifndef HPP_GUI_COAL_PLUGIN_NODE_HH +#define HPP_GUI_COAL_PLUGIN_NODE_HH +#include +#include #include -#include -#include namespace hpp { namespace gui { @@ -39,12 +39,12 @@ class BVHDisplay : public Node { void setColor(const osgVector4& color); - void init(hpp::fcl::SplitMethodType splitMethod); + void init(coal::SplitMethodType splitMethod); private: - typedef hpp::fcl::OBB BoundingVolume; - typedef hpp::fcl::BVHModel BVH_t; - typedef hpp::fcl::shared_ptr BVHPtr_t; + typedef coal::OBB BoundingVolume; + typedef coal::BVHModel BVH_t; + typedef coal::shared_ptr BVHPtr_t; void recursiveBuildTree(const BVH_t& bvh, int ibv, std::size_t level); @@ -60,4 +60,4 @@ class BVHDisplay : public Node { } // namespace gui } // namespace hpp -#endif // HPP_GUI_HPP_FCL_PLUGIN_NODE_HH +#endif // HPP_GUI_COAL_PLUGIN_NODE_HH diff --git a/plugins/hppfcl/plugin.cc b/plugins/coal/plugin.cc similarity index 85% rename from plugins/hppfcl/plugin.cc rename to plugins/coal/plugin.cc index d967bba..d52c26f 100644 --- a/plugins/hppfcl/plugin.cc +++ b/plugins/coal/plugin.cc @@ -32,41 +32,40 @@ namespace hpp { namespace gui { using gepetto::gui::MainWindow; -void HppFclPlugin::init() { +void CoalPlugin::init() { MainWindow* main = MainWindow::instance(); main->registerSlot("addBV", this); // TODO add a way to add an action to body tree items. - QToolBar* toolBar = MainWindow::instance()->addToolBar("hpp-fcl tools"); - toolBar->setObjectName("hppfclplugin.toolbar"); + QToolBar* toolBar = MainWindow::instance()->addToolBar("coal tools"); + toolBar->setObjectName("coalplugin.toolbar"); QAction* openD = new QAction(QIcon::fromTheme("document-open"), "Load a BVH model", toolBar); toolBar->addAction(openD); connect(openD, SIGNAL(triggered()), SLOT(openDialog())); } -void HppFclPlugin::addBV(QString name, QString filename, - int splitMethod) const { +void CoalPlugin::addBV(QString name, QString filename, int splitMethod) const { std::string _name(name.toStdString()); BVHDisplayPtr_t node(new BVHDisplay(filename.toStdString(), _name)); switch (splitMethod) { default: case 0: - node->init(hpp::fcl::SPLIT_METHOD_MEAN); + node->init(coal::SPLIT_METHOD_MEAN); break; case 1: - node->init(hpp::fcl::SPLIT_METHOD_MEDIAN); + node->init(coal::SPLIT_METHOD_MEDIAN); break; case 2: - node->init(hpp::fcl::SPLIT_METHOD_BV_CENTER); + node->init(coal::SPLIT_METHOD_BV_CENTER); break; } MainWindow* main = MainWindow::instance(); main->osg()->insertNode(_name, node); } -void HppFclPlugin::openDialog() const { +void CoalPlugin::openDialog() const { bool ok; QString filename = QFileDialog::getOpenFileName(NULL, "Select a mesh file"); if (filename.isNull()) return; @@ -102,7 +101,7 @@ void HppFclPlugin::openDialog() const { } #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) -Q_EXPORT_PLUGIN2(hppfclplugin, HppFclPlugin) +Q_EXPORT_PLUGIN2(coalplugin, CoalPlugin) #endif } // namespace gui diff --git a/plugins/hppfcl/plugin.hh b/plugins/coal/plugin.hh similarity index 90% rename from plugins/hppfcl/plugin.hh rename to plugins/coal/plugin.hh index eec2c06..79c82dc 100644 --- a/plugins/hppfcl/plugin.hh +++ b/plugins/coal/plugin.hh @@ -21,7 +21,7 @@ namespace hpp { namespace gui { -class HppFclPlugin : public QObject, public gepetto::gui::PluginInterface { +class CoalPlugin : public QObject, public gepetto::gui::PluginInterface { Q_OBJECT Q_INTERFACES(gepetto::gui::PluginInterface) @@ -30,7 +30,7 @@ class HppFclPlugin : public QObject, public gepetto::gui::PluginInterface { #endif public: - QString name() const { return QString("HppFclPlugin"); } + QString name() const { return QString("CoalPlugin"); } public slots: void addBV(QString name, QString filename, int splitMethod) const;