From 47b56534951f398ca1c7daa166c853f3b086d665 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Fri, 16 May 2025 15:38:07 +0200 Subject: [PATCH 1/6] Create new plugin to move code related to adaptivity --- CMakeLists.txt | 4 +- extensions/Shell.Adaptivity/CMakeLists.txt | 27 ++++++++++++ .../Shell.AdaptivityConfig.cmake.in | 12 +++++ .../src/Shell/Adaptivity/config.h.in | 15 +++++++ .../src/Shell/Adaptivity/init.cpp | 44 +++++++++++++++++++ .../src/Shell/Adaptivity/init.h | 10 +++++ 6 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 extensions/Shell.Adaptivity/CMakeLists.txt create mode 100644 extensions/Shell.Adaptivity/Shell.AdaptivityConfig.cmake.in create mode 100644 extensions/Shell.Adaptivity/src/Shell/Adaptivity/config.h.in create mode 100644 extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp create mode 100644 extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 46c2b1f..d8443f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,6 @@ sofa_find_package(Sofa.GL REQUIRED) set(README_FILE README.md) -option(SOFA-PLUGIN_SHELLS_ADAPTIVITY "Enables shells adaptivity" OFF) - # List all files set(SHELL_SRC_DIR src/Shell) set(HEADER_FILES @@ -124,3 +122,5 @@ sofa_create_package_with_targets( INCLUDE_INSTALL_DIR ${PROJECT_NAME} RELOCATABLE "plugins" ) + +sofa_add_subdirectory(plugin extensions/Shell.Adaptivity Shell.Adaptivity) diff --git a/extensions/Shell.Adaptivity/CMakeLists.txt b/extensions/Shell.Adaptivity/CMakeLists.txt new file mode 100644 index 0000000..5a1a824 --- /dev/null +++ b/extensions/Shell.Adaptivity/CMakeLists.txt @@ -0,0 +1,27 @@ +# CMakeLists.txt for Shell.Adaptivity plugin +cmake_minimum_required(VERSION 3.12) +project(Shell.Adaptivity VERSION 1.0 LANGUAGES CXX) + +find_package(Sofa.Config REQUIRED) +sofa_find_package(Shell REQUIRED) + +set(HEADER_FILES + src/Shell/Adaptivity/config.h.in + src/Shell/Adaptivity/init.h +) + +set(SOURCE_FILES + src/Shell/Adaptivity/init.cpp +) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) +target_link_libraries(${PROJECT_NAME} PUBLIC Shell) + +sofa_create_package_with_targets( + PACKAGE_NAME ${PROJECT_NAME} + PACKAGE_VERSION ${PROJECT_VERSION} + TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES + INCLUDE_SOURCE_DIR "src" + INCLUDE_INSTALL_DIR ${PROJECT_NAME} + RELOCATABLE "plugins" + ) diff --git a/extensions/Shell.Adaptivity/Shell.AdaptivityConfig.cmake.in b/extensions/Shell.Adaptivity/Shell.AdaptivityConfig.cmake.in new file mode 100644 index 0000000..c5276dc --- /dev/null +++ b/extensions/Shell.Adaptivity/Shell.AdaptivityConfig.cmake.in @@ -0,0 +1,12 @@ +# CMake package configuration file for the plugin @PROJECT_NAME@ + +@PACKAGE_GUARD@ +@PACKAGE_INIT@ + +find_package(Shell QUIET REQUIRED) + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +endif() + +check_required_components(Shell.Adaptivity) diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/config.h.in b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/config.h.in new file mode 100644 index 0000000..6f9d0dd --- /dev/null +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/config.h.in @@ -0,0 +1,15 @@ +#pragma once +#include + +#ifdef SOFA_BUILD_SHELL_ADAPTIVITY +# define SOFA_TARGET @PROJECT_NAME@ +# define SHELL_ADAPTIVITY_API SOFA_EXPORT_DYNAMIC_LIBRARY +#else +# define SHELL_ADAPTIVITY_API SOFA_IMPORT_DYNAMIC_LIBRARY +#endif + +namespace shelladaptivity +{ + constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; + constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; +} diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp new file mode 100644 index 0000000..3aa8669 --- /dev/null +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp @@ -0,0 +1,44 @@ +#include +#include + +namespace shelladaptivity +{ + +void initializePlugin() +{ + static bool first = true; + if (first) { + first = false; + // Register components here + } +} + +} + +extern "C" +{ + SHELL_ADAPTIVITY_API void initExternalModule() + { + shelladaptivity::initializePlugin(); + } + + SHELL_ADAPTIVITY_API const char* getModuleName() + { + return shelladaptivity::MODULE_NAME; + } + + SHELL_ADAPTIVITY_API const char* getModuleVersion() + { + return shelladaptivity::MODULE_VERSION; + } + + SHELL_ADAPTIVITY_API const char* getModuleLicense() + { + return "LGPL"; + } + + SHELL_ADAPTIVITY_API const char* getModuleDescription() + { + return "SOFA plugin for Shell.Adaptivity"; + } +} diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.h new file mode 100644 index 0000000..5e7886c --- /dev/null +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.h @@ -0,0 +1,10 @@ +#pragma once +#include + +namespace shelladaptivity +{ + +/** Initialize the Shell.Adaptivity plugin */ +void SHELL_ADAPTIVITY_API initializePlugin(); + +} From 545649ccfd2cff077996c0be31d98c10fffbdfe0 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Fri, 16 May 2025 15:51:48 +0200 Subject: [PATCH 2/6] move files related to adaptivity --- CMakeLists.txt | 34 ------------------- extensions/Shell.Adaptivity/CMakeLists.txt | 20 +++++++++++ .../controller/AdaptiveCuttingController.cpp | 0 .../controller/AdaptiveCuttingController.h | 0 .../controller/AdaptiveCuttingController.inl | 0 .../Adaptivity}/controller/Test2DAdapter.cpp | 0 .../Adaptivity}/controller/Test2DAdapter.h | 0 .../Adaptivity}/controller/Test2DAdapter.inl | 0 .../Adaptivity}/cutting/AdaptiveCutting.cpp | 0 .../Adaptivity}/cutting/AdaptiveCutting.h | 0 .../Adaptivity}/misc/Optimize2DSurface.cpp | 0 .../Adaptivity}/misc/Optimize2DSurface.h | 0 .../Adaptivity}/misc/Optimize2DSurface.inl | 0 .../misc/SurfaceParametrization.cpp | 0 .../Adaptivity}/misc/SurfaceParametrization.h | 0 .../misc/SurfaceParametrization.inl | 0 16 files changed, 20 insertions(+), 34 deletions(-) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/controller/AdaptiveCuttingController.cpp (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/controller/AdaptiveCuttingController.h (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/controller/AdaptiveCuttingController.inl (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/controller/Test2DAdapter.cpp (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/controller/Test2DAdapter.h (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/controller/Test2DAdapter.inl (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/cutting/AdaptiveCutting.cpp (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/cutting/AdaptiveCutting.h (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/misc/Optimize2DSurface.cpp (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/misc/Optimize2DSurface.h (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/misc/Optimize2DSurface.inl (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/misc/SurfaceParametrization.cpp (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/misc/SurfaceParametrization.h (100%) rename {src/Shell => extensions/Shell.Adaptivity/src/Shell/Adaptivity}/misc/SurfaceParametrization.inl (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8443f9..235bf84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,40 +68,6 @@ set(SOURCE_FILES ${SHELL_SRC_DIR}/shells2/mapping/BezierShellMechanicalMapping.cpp ) -if(SOFA-PLUGIN_SHELLS_ADAPTIVITY) - set(COMPILER_DEFINE "SOFA_BUILD_SHELLS_ADAPTIVITY") - - list(APPEND HEADER_FILES - ${SHELL_SRC_DIR}/controller/AdaptiveCuttingController.h - ${SHELL_SRC_DIR}/controller/AdaptiveCuttingController.inl - ${SHELL_SRC_DIR}/controller/Test2DAdapter.h - ${SHELL_SRC_DIR}/controller/Test2DAdapter.inl - ${SHELL_SRC_DIR}/misc/Optimize2DSurface.h - ${SHELL_SRC_DIR}/misc/Optimize2DSurface.inl - ${SHELL_SRC_DIR}/misc/SurfaceParametrization.h - ${SHELL_SRC_DIR}/misc/SurfaceParametrization.inl - ) - - list(APPEND SOURCE_FILES - ${SHELL_SRC_DIR}/controller/AdaptiveCuttingController.cpp - ${SHELL_SRC_DIR}/controller/Test2DAdapter.cpp - ${SHELL_SRC_DIR}/misc/Optimize2DSurface.cpp - ${SHELL_SRC_DIR}/misc/SurfaceParametrization.cpp - ) - - if(SofaGui_FOUND AND SofaOpenglVisual_FOUND) - list(APPEND HEADER_FILES - ${SHELL_SRC_DIR}/cutting/AdaptiveCutting.h - ) - - list(APPEND SOURCE_FILES - ${SHELL_SRC_DIR}/cutting/AdaptiveCutting.cpp - ) - endif() - -endif() - - # Create the plugin library add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) diff --git a/extensions/Shell.Adaptivity/CMakeLists.txt b/extensions/Shell.Adaptivity/CMakeLists.txt index 5a1a824..954cc10 100644 --- a/extensions/Shell.Adaptivity/CMakeLists.txt +++ b/extensions/Shell.Adaptivity/CMakeLists.txt @@ -8,10 +8,30 @@ sofa_find_package(Shell REQUIRED) set(HEADER_FILES src/Shell/Adaptivity/config.h.in src/Shell/Adaptivity/init.h + + src/Shell/Adaptivity/controller/AdaptiveCuttingController.h + src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl + src/Shell/Adaptivity/controller/Test2DAdapter.h + src/Shell/Adaptivity/controller/Test2DAdapter.inl + + src/Shell/Adaptivity/cutting/AdaptiveCutting.h + + src/Shell/Adaptivity/misc/Optimize2DSurface.h + src/Shell/Adaptivity/misc/Optimize2DSurface.inl + src/Shell/Adaptivity/misc/SurfaceParametrization.h + src/Shell/Adaptivity/misc/SurfaceParametrization.inl ) set(SOURCE_FILES src/Shell/Adaptivity/init.cpp + + src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp + src/Shell/Adaptivity/controller/Test2DAdapter.cpp + + src/Shell/Adaptivity/cutting/AdaptiveCutting.h + + src/Shell/Adaptivity/misc/Optimize2DSurface.cpp + src/Shell/Adaptivity/misc/SurfaceParametrization.cpp ) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) diff --git a/src/Shell/controller/AdaptiveCuttingController.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp similarity index 100% rename from src/Shell/controller/AdaptiveCuttingController.cpp rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp diff --git a/src/Shell/controller/AdaptiveCuttingController.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h similarity index 100% rename from src/Shell/controller/AdaptiveCuttingController.h rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h diff --git a/src/Shell/controller/AdaptiveCuttingController.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl similarity index 100% rename from src/Shell/controller/AdaptiveCuttingController.inl rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl diff --git a/src/Shell/controller/Test2DAdapter.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp similarity index 100% rename from src/Shell/controller/Test2DAdapter.cpp rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp diff --git a/src/Shell/controller/Test2DAdapter.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h similarity index 100% rename from src/Shell/controller/Test2DAdapter.h rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h diff --git a/src/Shell/controller/Test2DAdapter.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl similarity index 100% rename from src/Shell/controller/Test2DAdapter.inl rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl diff --git a/src/Shell/cutting/AdaptiveCutting.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp similarity index 100% rename from src/Shell/cutting/AdaptiveCutting.cpp rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp diff --git a/src/Shell/cutting/AdaptiveCutting.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.h similarity index 100% rename from src/Shell/cutting/AdaptiveCutting.h rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.h diff --git a/src/Shell/misc/Optimize2DSurface.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp similarity index 100% rename from src/Shell/misc/Optimize2DSurface.cpp rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp diff --git a/src/Shell/misc/Optimize2DSurface.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.h similarity index 100% rename from src/Shell/misc/Optimize2DSurface.h rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.h diff --git a/src/Shell/misc/Optimize2DSurface.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.inl similarity index 100% rename from src/Shell/misc/Optimize2DSurface.inl rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.inl diff --git a/src/Shell/misc/SurfaceParametrization.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.cpp similarity index 100% rename from src/Shell/misc/SurfaceParametrization.cpp rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.cpp diff --git a/src/Shell/misc/SurfaceParametrization.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.h similarity index 100% rename from src/Shell/misc/SurfaceParametrization.h rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.h diff --git a/src/Shell/misc/SurfaceParametrization.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.inl similarity index 100% rename from src/Shell/misc/SurfaceParametrization.inl rename to extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.inl From 252b6efe843919ece29bebf56542f662a6d0a0c4 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Fri, 16 May 2025 16:31:49 +0200 Subject: [PATCH 3/6] fix partially compilation --- extensions/Shell.Adaptivity/CMakeLists.txt | 6 ++- .../controller/AdaptiveCuttingController.cpp | 14 +++---- .../controller/AdaptiveCuttingController.h | 35 ++++++---------- .../controller/AdaptiveCuttingController.inl | 27 ++++++------ .../Adaptivity/controller/Test2DAdapter.cpp | 14 +++---- .../Adaptivity/controller/Test2DAdapter.h | 41 +++++++----------- .../Adaptivity/controller/Test2DAdapter.inl | 42 +++++++++---------- .../Adaptivity/cutting/AdaptiveCutting.cpp | 22 +++++----- .../Adaptivity/cutting/AdaptiveCutting.h | 26 ++++++------ .../src/Shell/Adaptivity/init.cpp | 4 +- .../Adaptivity/misc/Optimize2DSurface.cpp | 12 +++--- .../Shell/Adaptivity/misc/Optimize2DSurface.h | 18 ++++---- .../Adaptivity/misc/Optimize2DSurface.inl | 6 +-- .../misc/SurfaceParametrization.cpp | 8 ++-- .../Adaptivity/misc/SurfaceParametrization.h | 24 +++++------ .../misc/SurfaceParametrization.inl | 19 +++++---- 16 files changed, 151 insertions(+), 167 deletions(-) diff --git a/extensions/Shell.Adaptivity/CMakeLists.txt b/extensions/Shell.Adaptivity/CMakeLists.txt index 954cc10..0fce7ea 100644 --- a/extensions/Shell.Adaptivity/CMakeLists.txt +++ b/extensions/Shell.Adaptivity/CMakeLists.txt @@ -4,6 +4,8 @@ project(Shell.Adaptivity VERSION 1.0 LANGUAGES CXX) find_package(Sofa.Config REQUIRED) sofa_find_package(Shell REQUIRED) +sofa_find_package(Sofa.GUI.Component REQUIRED) +sofa_find_package(Sofa.GUI.Common REQUIRED) set(HEADER_FILES src/Shell/Adaptivity/config.h.in @@ -28,14 +30,14 @@ set(SOURCE_FILES src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp src/Shell/Adaptivity/controller/Test2DAdapter.cpp - src/Shell/Adaptivity/cutting/AdaptiveCutting.h + src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp src/Shell/Adaptivity/misc/Optimize2DSurface.cpp src/Shell/Adaptivity/misc/SurfaceParametrization.cpp ) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -target_link_libraries(${PROJECT_NAME} PUBLIC Shell) +target_link_libraries(${PROJECT_NAME} PUBLIC Shell Sofa.GUI.Component Sofa.GUI.Common) sofa_create_package_with_targets( PACKAGE_NAME ${PROJECT_NAME} diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp index 229465f..c6f907b 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include @@ -20,20 +20,20 @@ SOFA_DECL_CLASS(AdaptiveCuttingController) int AdaptiveCuttingControllerClass = core::RegisterObject( "Controller that handles the cutting method based on mesh adaptivity.") #ifdef SOFA_FLOAT -.add< AdaptiveCuttingController >(true) // default template +.add< AdaptiveCuttingController >(true) // default template #else -.add< AdaptiveCuttingController >(true) // default template +.add< AdaptiveCuttingController >(true) // default template # ifndef SOFA_DOUBLE -.add< AdaptiveCuttingController >() +.add< AdaptiveCuttingController >() # endif #endif ; #ifndef SOFA_FLOAT -template class SOFA_SHELLS_API AdaptiveCuttingController; +template class SHELL_ADAPTIVITY_API AdaptiveCuttingController; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE -template class SOFA_SHELLS_API AdaptiveCuttingController; +template class SHELL_ADAPTIVITY_API AdaptiveCuttingController; #endif //SOFA_DOUBLE } // namespace controller diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h index b1e19a9..7642be6 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h @@ -1,7 +1,7 @@ #ifndef SOFA_COMPONENT_CONTROLLER_ADAPTIVECUTTINGCONTROLLER_H #define SOFA_COMPONENT_CONTROLLER_ADAPTIVECUTTINGCONTROLLER_H -#include +#include #include #include @@ -11,14 +11,13 @@ #include #include #include -#include #include #include #include #include -#include +#include namespace sofa { @@ -33,7 +32,7 @@ namespace controller class CuttingAdapter { public: - virtual void setTrackedPoint(const collision::BodyPicked &picked) = 0; + virtual void setTrackedPoint(const sofa::gui::component::performer::BodyPicked &picked) = 0; virtual void freeTrackedPoint() = 0; virtual void addCuttingPoint() = 0; }; @@ -60,11 +59,11 @@ class AdaptiveCuttingController : public Controller, public CuttingAdapter typedef sofa::core::topology::BaseMeshTopology::Edge Edge; typedef sofa::core::topology::BaseMeshTopology::EdgesAroundVertex EdgesAroundVertex; - typedef sofa::component::topology::TriangleSetTopologyContainer::TriangleID Index; - typedef sofa::component::topology::TriangleSetTopologyContainer::Triangle Triangle; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundEdge TrianglesAroundEdge; - typedef sofa::component::topology::TriangleSetTopologyContainer::EdgesInTriangle EdgesInTriangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TriangleID Index; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::Triangle Triangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundEdge TrianglesAroundEdge; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::EdgesInTriangle EdgesInTriangle; typedef sofa::type::vector VecIndex; enum { InvalidID = sofa::core::topology::Topology::InvalidID }; @@ -76,23 +75,13 @@ class AdaptiveCuttingController : public Controller, public CuttingAdapter virtual void init(); virtual void reinit(); - virtual std::string getTemplateName() const - { - return templateName(this); - } - - static std::string templateName(const AdaptiveCuttingController* = NULL) - { - return DataTypes::Name(); - } - void onEndAnimationStep(const double dt); //void onKeyPressedEvent(core::objectmodel::KeypressedEvent *key); void draw(const core::visual::VisualParams* vparams); - void setTrackedPoint(const collision::BodyPicked &picked); + void setTrackedPoint(const sofa::gui::component::performer::BodyPicked &picked); void freeTrackedPoint() { // Detach the point m_pointId = InvalidID; @@ -113,9 +102,9 @@ class AdaptiveCuttingController : public Controller, public CuttingAdapter private: Test2DAdapter* m_adapter; - sofa::component::topology::TriangleSetTopologyContainer* m_container; - sofa::component::topology::TriangleSetGeometryAlgorithms *m_algoGeom; - sofa::component::topology::TriangleSetTopologyAlgorithms *m_algoTopo; + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer* m_container; + sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms *m_algoGeom; + sofa::component::topology::container::dynamic::TriangleSetTopologyAlgorithms *m_algoTopo; sofa::core::behavior::MechanicalState* m_state; // TODO: This should go to cutting config (maybe?) diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl index 671ad0a..2fc6d7c 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl @@ -4,14 +4,15 @@ // TODO // - protect/unprotect cut edges (m_cutEdge,m_cutList) -#include +#include #include #include -#include -#include +#include +#include #include +#include #define OTHER(x, a, b) ((x == a) ? b : a) @@ -105,7 +106,7 @@ void AdaptiveCuttingController::onEndAnimationStep(const double /*dt* if (m_gracePeriod > 0) m_gracePeriod--; const VecCoord& x0 = m_state->read( - sofa::core::ConstVecCoordId::restPosition())->getValue(); + sofa::core::vec_id::read_access::restPosition)->getValue(); // Perform the (delayed) cutting if ((m_cutList.size() > 0) && (m_cutPoints > 2) ) { @@ -161,10 +162,10 @@ void AdaptiveCuttingController::draw( return; if (!m_state) return; - const VecCoord& x = m_state->read(sofa::core::ConstVecCoordId::position())->getValue(); + const VecCoord& x = m_state->read(sofa::core::vec_id::read_access::position)->getValue(); if (m_cutList.size() > 0) { - type::vector points; + type::vector points; for (VecIndex::const_iterator i=m_cutList.begin(); i != m_cutList.end(); i++) { const Edge &e = m_container->getEdge(*i); @@ -177,7 +178,7 @@ void AdaptiveCuttingController::draw( if (m_cutEdge != InvalidID) { const Edge &e = m_container->getEdge(m_cutEdge); - type::vector points; + type::vector points; points.push_back(x[ e[0] ]); points.push_back(x[ e[1] ]); vparams->drawTool()->drawLines(points, 4, @@ -188,16 +189,16 @@ void AdaptiveCuttingController::draw( template void AdaptiveCuttingController::setTrackedPoint( - const collision::BodyPicked &picked) + const sofa::gui::component::performer::BodyPicked &picked) { if (!m_adapter) return; using namespace sofa::component::collision; //const VecCoord& x0 = m_state->read( - // sofa::core::ConstVecCoordId::restPosition())->getValue(); + // sofa::core::vec_id::read_access::restPosition)->getValue(); const VecCoord& x = m_state->read( - sofa::core::ConstVecCoordId::position())->getValue(); + sofa::core::vec_id::read_access::position)->getValue(); // Support only trianglular model! The others don't give any added value. @@ -211,7 +212,7 @@ void AdaptiveCuttingController::setTrackedPoint( Real d2 = (x[ e[1] ] - m_point).norm2(); m_pointId = (d1 < d2 ? e[0] : e[1]); } else*/ - if(dynamic_cast(picked.body)) { + if(dynamic_cast(picked.body)) { Index newId = InvalidID; Index newCutEdge = InvalidID; @@ -358,9 +359,9 @@ void AdaptiveCuttingController::addCuttingPoint() } const VecCoord& x = m_state->read( - sofa::core::ConstVecCoordId::position())->getValue(); + sofa::core::vec_id::read_access::position)->getValue(); //const VecCoord& xrest = m_state->read( - // sofa::core::ConstVecCoordId::restPosition())->getValue(); + // sofa::core::vec_id::read_access::restPosition)->getValue(); Coord oldpos = x[m_pointId]; bool bFirst = !cutting(); diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp index 526c943..f5c1428 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include @@ -19,20 +19,20 @@ SOFA_DECL_CLASS(Test2DAdapter) // Register in the Factory int Test2DAdapterClass = core::RegisterObject("Adaptive mesh improvement component for 2D triangular meshes (for testing)") #ifdef SOFA_FLOAT -.add< Test2DAdapter >(true) // default template +.add< Test2DAdapter >(true) // default template #else -.add< Test2DAdapter >(true) // default template +.add< Test2DAdapter >(true) // default template # ifndef SOFA_DOUBLE -.add< Test2DAdapter >() +.add< Test2DAdapter >() # endif #endif ; #ifndef SOFA_FLOAT -template class SOFA_SHELLS_API Test2DAdapter; +template class SHELL_ADAPTIVITY_API Test2DAdapter; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE -template class SOFA_SHELLS_API Test2DAdapter; +template class SHELL_ADAPTIVITY_API Test2DAdapter; #endif //SOFA_DOUBLE } // namespace controller diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h index 28f98bc..c97514c 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h @@ -1,25 +1,24 @@ #ifndef SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_H #define SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_H -#include +#include #include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include namespace sofa { @@ -108,11 +107,11 @@ class Test2DAdapter : public Controller typedef sofa::core::topology::BaseMeshTopology::Edge Edge; typedef sofa::core::topology::BaseMeshTopology::EdgesAroundVertex EdgesAroundVertex; - typedef sofa::component::topology::TriangleSetTopologyContainer::TriangleID Index; - typedef sofa::component::topology::TriangleSetTopologyContainer::Triangle Triangle; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundEdge TrianglesAroundEdge; - typedef sofa::component::topology::TriangleSetTopologyContainer::EdgesInTriangle EdgesInTriangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TriangleID Index; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::Triangle Triangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundEdge TrianglesAroundEdge; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::EdgesInTriangle EdgesInTriangle; typedef sofa::type::vector VecIndex; enum { InvalidID = sofa::core::topology::Topology::InvalidID }; @@ -252,14 +251,6 @@ class Test2DAdapter : public Controller virtual void init(); virtual void reinit(); - virtual std::string getTemplateName() const { - return templateName(this); - } - - static std::string templateName(const Test2DAdapter* = NULL) { - return DataTypes::Name(); - } - void draw(const core::visual::VisualParams* vparams); void onEndAnimationStep(const double dt); @@ -340,10 +331,10 @@ class Test2DAdapter : public Controller private: unsigned int stepCounter; - sofa::core::topology::TriangleSetTopologyContainer* m_container; - sofa::core::topology::TriangleSetTopologyModifier* m_modifier; - sofa::core::topology::TriangleSetGeometryAlgorithms *m_algoGeom; - sofa::core::topology::TriangleSetTopologyAlgorithms *m_algoTopo; + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer* m_container; + sofa::component::topology::container::dynamic::TriangleSetTopologyModifier* m_modifier; + sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms *m_algoGeom; + sofa::component::topology::container::dynamic::TriangleSetTopologyAlgorithms *m_algoTopo; sofa::core::behavior::MechanicalState* m_state; /// List of nodes that have to be rechecked if they are on the boundry. diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl index ef2e7da..582f548 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl @@ -38,7 +38,7 @@ #ifndef SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_INL #define SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_INL -#include +#include #include #include @@ -49,10 +49,10 @@ #include #include -#include +#include -#include -#include +#include +#include #define OTHER(x, a, b) ((x == a) ? b : a) @@ -143,7 +143,7 @@ void Test2DAdapter::TriangleInfoHandler::applyCreateFunction( adapter->m_toUpdate[t[2]] = true; // Compute initial normal - adapter->computeTriangleNormal(elem, adapter->m_state->read(sofa::core::VecCoordId::restPosition())->getValue(), tInfo.normal); + adapter->computeTriangleNormal(elem, adapter->m_state->read(sofa::core::vec_id::read_access::restPosition)->getValue(), tInfo.normal); } template @@ -319,7 +319,7 @@ void Test2DAdapter::reinit() stepCounter = 0; - m_surf.init(m_container, m_state->read(sofa::core::VecCoordId::restPosition())->getValue()); + m_surf.init(m_container, m_state->read(sofa::core::vec_id::read_access::restPosition)->getValue()); } @@ -341,7 +341,7 @@ void Test2DAdapter::onEndAnimationStep(const double /*dt*/) //stepCounter = 0; - Data* datax = m_state->write(sofa::core::VecCoordId::restPosition()); + Data* datax = m_state->write(sofa::core::vec_id::write_access::restPosition); //VecCoord& x = *datax->beginEdit(); // WARNING: Notice that we're working on a copy that is NOT updated by // external changes! @@ -507,9 +507,9 @@ void Test2DAdapter::swapEdge(Index triID) Real oldValue = m_functionals.getValue()[triID]; const VecCoord& x0 = m_state->read( - sofa::core::ConstVecCoordId::restPosition())->getValue(); + sofa::core::vec_id::read_access::restPosition)->getValue(); const VecCoord& x = m_state->read( - sofa::core::ConstVecCoordId::position())->getValue(); + sofa::core::vec_id::read_access::position)->getValue(); const Triangle &t1 = m_container->getTriangle(triID); const EdgesInTriangle &elist = m_container->getEdgesInTriangle(triID); @@ -682,8 +682,8 @@ void Test2DAdapter::relocatePoint(Index pt, Coord target, const VecCoord& x = m_state->read( bInRest - ? sofa::core::ConstVecCoordId::restPosition() - : sofa::core::ConstVecCoordId::position() + ? sofa::core::vec_id::read_access::restPosition + : sofa::core::vec_id::read_access::position )->getValue(); if ((x[pt] - target).norm() < m_precision) return; // Nothing to do @@ -762,7 +762,7 @@ void Test2DAdapter::relocatePoint(Index pt, Coord target, // Check //const VecCoord& xnew = m_state->read( - // sofa::core::ConstVecCoordId::restPosition())->getValue(); + // sofa::core::vec_id::read_access::restPosition)->getValue(); //std::cout << "requested " << target << "\tgot " << xnew[pt] << "\tdelta" // << (target - xnew[pt]).norm() << "\n"; } @@ -773,7 +773,7 @@ typename Test2DAdapter::PointInformation::NodeType Test2DAdapterread(sofa::core::ConstVecCoordId::restPosition())->getValue(); + const VecCoord& x0 = m_state->read(sofa::core::vec_id::read_access::restPosition)->getValue(); VecVec3 dirlist; // Directions of boundary edges @@ -823,7 +823,7 @@ void Test2DAdapter::projectionInit() if (!m_container) return; const VecCoord& x0= m_state->read( - sofa::core::ConstVecCoordId::restPosition())->getValue(); + sofa::core::vec_id::read_access::restPosition)->getValue(); const VecCoord& xProj = m_projectedPoints.getValue(); unsigned int nVertices = xProj.size(); @@ -885,7 +885,7 @@ void Test2DAdapter::projectionUpdate(Index pt) PointProjection proj(*m_container); const VecCoord& x0= m_state->read( - sofa::core::ConstVecCoordId::restPosition())->getValue(); + sofa::core::vec_id::read_access::restPosition)->getValue(); const VecCoord& xProj = m_projectedPoints.getValue(); @@ -981,10 +981,10 @@ void Test2DAdapter::draw(const core::visual::VisualParams* vparams) return; if (!m_state) return; - const VecCoord& x = m_state->read(sofa::core::ConstVecCoordId::position())->getValue(); + const VecCoord& x = m_state->read(sofa::core::vec_id::read_access::position)->getValue(); - type::vector boundary; - type::vector fixed; + type::vector boundary; + type::vector fixed; const type::vector &pts = pointInfo.getValue(); if (pts.size() != x.size()) return; for (Index i=0; i < x.size(); i++) { @@ -1001,9 +1001,9 @@ void Test2DAdapter::draw(const core::visual::VisualParams* vparams) if (m_pointId != InvalidID) { // Draw tracked position - type::vector vv; + type::vector vv; vv.push_back( - type::Vector3(m_point[0], m_point[1], m_point[2])); + type::Vec3(m_point[0], m_point[1], m_point[2])); vparams->drawTool()->drawPoints(vv, 6, type::RGBAColor(1.0, 1.0, 1.0, 1.0)); // Draw tracked position (projected in rest shape) @@ -1022,7 +1022,7 @@ void Test2DAdapter::draw(const core::visual::VisualParams* vparams) if (m_protectedEdges.size() > 0) { - type::vector points; + type::vector points; for (VecIndex::const_iterator i=m_protectedEdges.begin(); i != m_protectedEdges.end(); i++) { const Edge &e = m_container->getEdge(*i); diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp index 2e98793..86aeb64 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp @@ -1,10 +1,11 @@ -#include +#include +#include #include #include +#include +#include #include -#include -#include namespace sofa { @@ -33,23 +34,22 @@ namespace collision #ifndef SOFA_DOUBLE helper::Creator< InteractionPerformer::InteractionPerformerFactory, - AdaptiveCuttingPerformer > + AdaptiveCuttingPerformer > AdaptiveCuttingPerformerVec3fClass("AdaptiveCutting", true); #endif #ifndef SOFA_FLOAT -helper::Creator< - InteractionPerformer::InteractionPerformerFactory, - AdaptiveCuttingPerformer > +helper::Creator > AdaptiveCuttingPerformerVec3dClass("AdaptiveCutting", true); #endif #ifndef SOFA_DOUBLE -template class SOFA_SHELLS_API AdaptiveCuttingPerformer; -//template class SOFA_SHELLS_API AdaptiveCuttingPerformer; +template class SHELL_ADAPTIVITY_API AdaptiveCuttingPerformer; +//template class SHELL_ADAPTIVITY_API AdaptiveCuttingPerformer; #endif #ifndef SOFA_FLOAT -template class SOFA_SHELLS_API AdaptiveCuttingPerformer; -//template class SOFA_SHELLS_API AdaptiveCuttingPerformer; +template class SHELL_ADAPTIVITY_API AdaptiveCuttingPerformer; +//template class SHELL_ADAPTIVITY_API AdaptiveCuttingPerformer; #endif } // namespace collision diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.h index 4d3549c..815ad4e 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.h @@ -1,13 +1,13 @@ #ifndef SOFA_GUI_ADAPTIVECUTTING_H #define SOFA_GUI_ADAPTIVECUTTING_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace sofa { @@ -20,10 +20,10 @@ namespace component namespace configurationsetting { -class SOFA_SHELLS_API AdaptiveCuttingSetting: public MouseButtonSetting +class SHELL_ADAPTIVITY_API AdaptiveCuttingSetting: public sofa::component::setting::MouseButtonSetting { public: - SOFA_CLASS(AdaptiveCuttingSetting, MouseButtonSetting); + SOFA_CLASS(AdaptiveCuttingSetting, sofa::component::setting::MouseButtonSetting); protected: AdaptiveCuttingSetting() { } @@ -40,14 +40,14 @@ namespace collision { template -class AdaptiveCuttingPerformer: public TInteractionPerformer +class AdaptiveCuttingPerformer: public sofa::gui::component::performer::TInteractionPerformer { public: //typedef sofa::component::collision::BaseContactMapper< DataTypes > MouseContactMapper; //typedef sofa::core::behavior::MechanicalState< DataTypes > MouseContainer; //typedef sofa::core::behavior::BaseForceField MouseForceField; - AdaptiveCuttingPerformer(BaseMouseInteractor *i) : TInteractionPerformer(i) + AdaptiveCuttingPerformer(gui::component::performer::BaseMouseInteractor *i) : sofa::gui::component::performer::TInteractionPerformer(i) {} void start() { @@ -92,7 +92,7 @@ class AdaptiveCuttingPerformer: public TInteractionPerformer //} - void configure(configurationsetting::MouseButtonSetting* setting) + void configure(sofa::component::setting::MouseButtonSetting* setting) { configurationsetting::AdaptiveCuttingSetting* s = dynamic_cast(setting); if (s) @@ -112,11 +112,11 @@ class AdaptiveCuttingPerformer: public TInteractionPerformer namespace gui { -class SOFA_SHELLS_API AdaptiveCuttingOperation : public Operation +class SHELL_ADAPTIVITY_API AdaptiveCuttingOperation : public sofa::gui::common::Operation { public: - typedef component::controller::CuttingAdapter CuttingAdapter; + typedef ::sofa::component::controller::CuttingAdapter CuttingAdapter; AdaptiveCuttingOperation(sofa::component::configurationsetting::AdaptiveCuttingSetting::SPtr s = sofa::core::objectmodel::New()) : Operation(s) {} diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp index 3aa8669..93ab9e8 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/init.cpp @@ -1,4 +1,4 @@ -#include +#include #include namespace shelladaptivity @@ -34,7 +34,7 @@ extern "C" SHELL_ADAPTIVITY_API const char* getModuleLicense() { - return "LGPL"; + return ""; } SHELL_ADAPTIVITY_API const char* getModuleDescription() diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp index 3ac6588..80a60f1 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp @@ -3,19 +3,19 @@ // triangular networks. // -#include -#include +#include +#include namespace sofa { #ifndef SOFA_FLOAT -//template class SOFA_SHELLS_API Optimize2DSurface; -template class SOFA_SHELLS_API Optimize2DSurface; +//template class SHELL_ADAPTIVITY_API Optimize2DSurface; +template class SHELL_ADAPTIVITY_API Optimize2DSurface; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE -//template class SOFA_SHELLS_API Optimize2DSurface; -template class SOFA_SHELLS_API Optimize2DSurface; +//template class SHELL_ADAPTIVITY_API Optimize2DSurface; +template class SHELL_ADAPTIVITY_API Optimize2DSurface; #endif //SOFA_DOUBLE } diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.h index e8b6aa3..dcf3d12 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.h @@ -6,14 +6,14 @@ #ifndef OPTIMIZE2DFUNCTION_H #define OPTIMIZE2DFUNCTION_H -#include +#include #include #include #include -#include +#include // Return non-zero if triangle with points (a,b,c) is defined in // counter-clockwise direction. (2D case) @@ -49,11 +49,11 @@ class Optimize2DSurface typedef sofa::type::Mat<2,2, Real> Mat22; typedef sofa::type::Mat<3,3, Real> Mat33; - typedef sofa::component::topology::EdgeSetTopologyContainer::Edge Edge; - typedef sofa::component::topology::EdgeSetTopologyContainer::EdgesAroundVertex EdgesAroundVertex; - typedef sofa::component::topology::TriangleSetTopologyContainer::TriangleID Index; - typedef sofa::component::topology::TriangleSetTopologyContainer::Triangle Triangle; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; + typedef sofa::component::topology::container::dynamic::EdgeSetTopologyContainer::Edge Edge; + typedef sofa::component::topology::container::dynamic::EdgeSetTopologyContainer::EdgesAroundVertex EdgesAroundVertex; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TriangleID Index; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::Triangle Triangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; typedef sofa::type::vector VecReal; typedef sofa::type::vector VecVec2; @@ -83,7 +83,7 @@ class Optimize2DSurface * @param topology Associated triangular topology. */ void initValues(VecReal &metrics, - sofa::component::topology::TriangleSetTopologyContainer *topology); + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer *topology); /** * @brief Perform smoothing step for single point. @@ -169,7 +169,7 @@ class Optimize2DSurface private: sofa::component::controller::Test2DAdapter *m_adapter; - sofa::component::topology::TriangleSetTopologyContainer *m_topology; + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer *m_topology; SurfaceParametrization &m_surf; /// Orientation of each triangle. diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.inl index 5eafef0..40062fd 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.inl @@ -8,8 +8,8 @@ // do the latter. // -#include -#include +#include +#include #include #include @@ -25,7 +25,7 @@ namespace sofa template void Optimize2DSurface::initValues(VecReal &metrics, - sofa::component::topology::TriangleSetTopologyContainer *topology) + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer *topology) { m_topology = topology; diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.cpp index ca6eed4..96009fa 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.cpp @@ -2,17 +2,17 @@ // Class for parametrizing 3D surface in 2D domain. // -#include -#include +#include +#include namespace sofa { #ifndef SOFA_FLOAT -template class SOFA_SHELLS_API SurfaceParametrization; +template class SHELL_ADAPTIVITY_API SurfaceParametrization; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE -template class SOFA_SHELLS_API SurfaceParametrization; +template class SHELL_ADAPTIVITY_API SurfaceParametrization; #endif //SOFA_DOUBLE } diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.h index 6338d75..77f08c8 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -40,14 +40,14 @@ class SurfaceParametrization typedef sofa::type::Mat<2,2, Real> Mat22; typedef sofa::type::Mat<3,3, Real> Mat33; - typedef sofa::component::topology::TriangleSetTopologyContainer::Edge Edge; - typedef sofa::component::topology::TriangleSetTopologyContainer::TriangleID Index; - typedef sofa::component::topology::TriangleSetTopologyContainer::Triangle Triangle; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; - typedef sofa::component::topology::TriangleSetTopologyContainer::TrianglesAroundEdge TrianglesAroundEdge; - typedef sofa::component::topology::TriangleSetTopologyContainer::EdgesInTriangle EdgesInTriangle; - typedef sofa::component::topology::TriangleSetTopologyContainer::SeqEdges SeqEdges; - typedef sofa::component::topology::TriangleSetTopologyContainer::SeqTriangles SeqTriangles; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::Edge Edge; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TriangleID Index; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::Triangle Triangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundVertex TrianglesAroundVertex; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::TrianglesAroundEdge TrianglesAroundEdge; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::EdgesInTriangle EdgesInTriangle; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::SeqEdges SeqEdges; + typedef sofa::component::topology::container::dynamic::TriangleSetTopologyContainer::SeqTriangles SeqTriangles; typedef sofa::type::vector VecVec2; typedef sofa::type::vector VecVec3; @@ -65,7 +65,7 @@ class SurfaceParametrization * @param x Position of points of the surface. */ void init( - sofa::component::topology::TriangleSetTopologyContainer *_topology, + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer *_topology, const VecVec3 &x); void draw(const core::visual::VisualParams* vparams); @@ -74,7 +74,7 @@ class SurfaceParametrization * @name Hadling of topological changes (also handles point relocation). * @{ */ - void pointAdd(unsigned int pointIndex, const sofa::core::topology::Point &elem, + void pointAdd(unsigned int pointIndex, const sofa::Index &elem, const sofa::type::vector< unsigned int > &ancestors, const sofa::type::vector< double > &coeffs); void pointRemove(unsigned int pointIndex); @@ -242,7 +242,7 @@ class SurfaceParametrization }; /// Topology defining the surface. - sofa::component::topology::TriangleSetTopologyContainer *m_topology; + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer *m_topology; /// Positions in the parameter space. VecVec2 m_points; diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.inl index d4c9ac2..f072dda 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/SurfaceParametrization.inl @@ -4,9 +4,10 @@ // TODO: // -- Can we use edge swapping at all? It seems that because of a varying // metric tensor the topology can become non-conforming. +#pragma once -#include -#include +#include +#include #include @@ -15,7 +16,7 @@ namespace sofa template void SurfaceParametrization::init( - sofa::component::topology::TriangleSetTopologyContainer *topology, + sofa::component::topology::container::dynamic::TriangleSetTopologyContainer *topology, const VecVec3 &x) { m_topology = topology; @@ -289,7 +290,7 @@ void SurfaceParametrization::getAngle(const Vec2 &u, const Vec2 &v, Real & template -void SurfaceParametrization::pointAdd(unsigned int pointIndex, const sofa::core::topology::Point &/*elem*/, +void SurfaceParametrization::pointAdd(unsigned int pointIndex, const sofa::Index &/*elem*/, const sofa::type::vector< unsigned int > &ancestors, const sofa::type::vector< double > &coeffs) { @@ -378,19 +379,19 @@ void SurfaceParametrization::draw(const core::visual::VisualParams* vparam vparams->drawTool()->saveLastState(); vparams->drawTool()->disableLighting(); - std::vector< sofa::type::Vector3 > points; - sofa::type::Vec4f color(1.0, 1.0, 1.0, 1.0); + std::vector< sofa::type::Vec3 > points; + sofa::type::RGBAColor color(1.0, 1.0, 1.0, 1.0); for (int i=0; igetNbTriangles(); ++i) { const Triangle &t = m_topology->getTriangle(i); for (int j=0; j<3; j++) { - points.push_back(sofa::type::Vector3(m_points[t[j]][0], m_points[t[j]][1], 1.0f)); - points.push_back(sofa::type::Vector3(m_points[t[(j+1)%3]][0], m_points[t[(j+1)%3]][1], 1.0f)); + points.push_back(sofa::type::Vec3(m_points[t[j]][0], m_points[t[j]][1], 1.0f)); + points.push_back(sofa::type::Vec3(m_points[t[(j+1)%3]][0], m_points[t[(j+1)%3]][1], 1.0f)); } } - vparams->drawTool()->drawLines(points, 1.0, color); + vparams->drawTool()->drawLines(points, 1.0f, color); vparams->drawTool()->restoreLastState(); } From 1b149c6b6e6eda4931cf9e9d72c141e6e3b0badf Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Fri, 16 May 2025 16:42:00 +0200 Subject: [PATCH 4/6] fix compilation partially --- .../controller/AdaptiveCuttingController.cpp | 12 ++++++------ .../controller/AdaptiveCuttingController.h | 1 - .../controller/AdaptiveCuttingController.inl | 15 ++++----------- .../Shell/Adaptivity/controller/Test2DAdapter.cpp | 12 ++++++------ .../Shell/Adaptivity/controller/Test2DAdapter.h | 5 ++--- .../Shell/Adaptivity/controller/Test2DAdapter.inl | 8 +------- .../Shell/Adaptivity/cutting/AdaptiveCutting.cpp | 14 +++++++------- .../Shell/Adaptivity/misc/Optimize2DSurface.cpp | 2 +- 8 files changed, 27 insertions(+), 42 deletions(-) diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp index c6f907b..31c75f7 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -20,20 +20,20 @@ SOFA_DECL_CLASS(AdaptiveCuttingController) int AdaptiveCuttingControllerClass = core::RegisterObject( "Controller that handles the cutting method based on mesh adaptivity.") #ifdef SOFA_FLOAT -.add< AdaptiveCuttingController >(true) // default template +.add< AdaptiveCuttingController >(true) // default template #else -.add< AdaptiveCuttingController >(true) // default template +.add< AdaptiveCuttingController >(true) // default template # ifndef SOFA_DOUBLE -.add< AdaptiveCuttingController >() +.add< AdaptiveCuttingController >() # endif #endif ; #ifndef SOFA_FLOAT -template class SHELL_ADAPTIVITY_API AdaptiveCuttingController; +template class SHELL_ADAPTIVITY_API AdaptiveCuttingController; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE -template class SHELL_ADAPTIVITY_API AdaptiveCuttingController; +template class SHELL_ADAPTIVITY_API AdaptiveCuttingController; #endif //SOFA_DOUBLE } // namespace controller diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h index 7642be6..c73460d 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h @@ -104,7 +104,6 @@ class AdaptiveCuttingController : public Controller, public CuttingAdapter Test2DAdapter* m_adapter; sofa::component::topology::container::dynamic::TriangleSetTopologyContainer* m_container; sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms *m_algoGeom; - sofa::component::topology::container::dynamic::TriangleSetTopologyAlgorithms *m_algoTopo; sofa::core::behavior::MechanicalState* m_state; // TODO: This should go to cutting config (maybe?) diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl index 2fc6d7c..3cc65d4 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl @@ -4,14 +4,13 @@ // TODO // - protect/unprotect cut edges (m_cutEdge,m_cutList) -#include +#include #include #include #include #include -#include #include #define OTHER(x, a, b) ((x == a) ? b : a) @@ -76,12 +75,6 @@ void AdaptiveCuttingController::init() return; } - this->getContext()->get(m_algoTopo); - if (m_algoTopo == NULL) { - msg_error() << "Unable to find TriangleSetTopologyAlgorithms"; - return; - } - reinit(); } @@ -118,7 +111,7 @@ void AdaptiveCuttingController::onEndAnimationStep(const double /*dt* } // Then perform the incision bool bReachedBorder; - m_algoTopo->InciseAlongEdgeList(m_cutList, newList, endList, + m_algoGeom->InciseAlongEdgeList(m_cutList, newList, endList, bReachedBorder); //m_algoTopo->InciseAlongEdge(m_cutList[0], NULL); m_cutList.clear(); @@ -212,7 +205,7 @@ void AdaptiveCuttingController::setTrackedPoint( Real d2 = (x[ e[1] ] - m_point).norm2(); m_pointId = (d1 < d2 ? e[0] : e[1]); } else*/ - if(dynamic_cast(picked.body)) { + if(dynamic_cast *>(picked.body)) { Index newId = InvalidID; Index newCutEdge = InvalidID; @@ -351,7 +344,7 @@ template void AdaptiveCuttingController::addCuttingPoint() { if (!m_adapter) return; - if (!m_algoTopo || !m_algoGeom) return; + if (!m_algoGeom) return; if (m_pointId == InvalidID) { msg_error() << "BUG! Attempted cutting with no point tracked."; diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp index f5c1428..5e5f48a 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -19,20 +19,20 @@ SOFA_DECL_CLASS(Test2DAdapter) // Register in the Factory int Test2DAdapterClass = core::RegisterObject("Adaptive mesh improvement component for 2D triangular meshes (for testing)") #ifdef SOFA_FLOAT -.add< Test2DAdapter >(true) // default template +.add< Test2DAdapter >(true) // default template #else -.add< Test2DAdapter >(true) // default template +.add< Test2DAdapter >(true) // default template # ifndef SOFA_DOUBLE -.add< Test2DAdapter >() +.add< Test2DAdapter >() # endif #endif ; #ifndef SOFA_FLOAT -template class SHELL_ADAPTIVITY_API Test2DAdapter; +template class SHELL_ADAPTIVITY_API Test2DAdapter; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE -template class SHELL_ADAPTIVITY_API Test2DAdapter; +template class SHELL_ADAPTIVITY_API Test2DAdapter; #endif //SOFA_DOUBLE } // namespace controller diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h index c97514c..da027fe 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h @@ -334,7 +334,6 @@ class Test2DAdapter : public Controller sofa::component::topology::container::dynamic::TriangleSetTopologyContainer* m_container; sofa::component::topology::container::dynamic::TriangleSetTopologyModifier* m_modifier; sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms *m_algoGeom; - sofa::component::topology::container::dynamic::TriangleSetTopologyAlgorithms *m_algoTopo; sofa::core::behavior::MechanicalState* m_state; /// List of nodes that have to be rechecked if they are on the boundry. @@ -437,10 +436,10 @@ class Test2DAdapter : public Controller protected: - topology::PointData< sofa::type::vector > pointInfo; + sofa::core::topology::PointData< sofa::type::vector > pointInfo; PointInfoHandler* pointHandler; - topology::TriangleData< sofa::type::vector > triInfo; + sofa::core::topology::TriangleData< sofa::type::vector > triInfo; TriangleInfoHandler* triHandler; }; diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl index 582f548..c4dbb8a 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl @@ -38,7 +38,7 @@ #ifndef SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_INL #define SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_INL -#include +#include #include #include @@ -255,12 +255,6 @@ void Test2DAdapter::init() return; } - this->getContext()->get(m_algoTopo); - if (m_algoTopo == NULL) { - msg_error() << "Unable to find TriangleSetTopologyAlgorithms" ; - return; - } - pointInfo.createTopologicalEngine(m_container, pointHandler); pointInfo.registerTopologicalData(); diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp index 86aeb64..56dba25 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp @@ -34,12 +34,12 @@ namespace collision #ifndef SOFA_DOUBLE helper::Creator< InteractionPerformer::InteractionPerformerFactory, - AdaptiveCuttingPerformer > + AdaptiveCuttingPerformer > AdaptiveCuttingPerformerVec3fClass("AdaptiveCutting", true); #endif #ifndef SOFA_FLOAT helper::Creator > + AdaptiveCuttingPerformer > AdaptiveCuttingPerformerVec3dClass("AdaptiveCutting", true); #endif @@ -62,7 +62,7 @@ template class SHELL_ADAPTIVITY_API AdaptiveCuttingPerformer(); void AdaptiveCuttingOperation::start() @@ -90,7 +90,7 @@ void AdaptiveCuttingOperation::wait() { // Update the position in the adaptivity component if (!pickHandle) return; - sofa::component::collision::BodyPicked *picked = pickHandle->getLastPicked(); + sofa::gui::component::performer::BodyPicked *picked = pickHandle->getLastPicked(); if (!picked) return; CuttingAdapter *ca = getAdapter(); @@ -99,14 +99,14 @@ void AdaptiveCuttingOperation::wait() } } -component::controller::CuttingAdapter* AdaptiveCuttingOperation::getAdapter() +sofa::component::controller::CuttingAdapter* AdaptiveCuttingOperation::getAdapter() { if (!pickHandle) return NULL; - sofa::component::collision::BodyPicked *picked = pickHandle->getLastPicked(); + sofa::gui::component::performer::BodyPicked *picked = pickHandle->getLastPicked(); if (!picked) return NULL; - component::controller::CuttingAdapter *ca = NULL; + sofa::component::controller::CuttingAdapter *ca = NULL; if (picked->body) { if (!picked->body->getContext()) std::cout << "no context!\n"; picked->body->getContext()->get(ca); diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp index 80a60f1..39d3754 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp @@ -15,7 +15,7 @@ template class SHELL_ADAPTIVITY_API Optimize2DSurface; #endif //SOFA_FLOAT #ifndef SOFA_DOUBLE //template class SHELL_ADAPTIVITY_API Optimize2DSurface; -template class SHELL_ADAPTIVITY_API Optimize2DSurface; +template class SHELL_ADAPTIVITY_API Optimize2DSurface; #endif //SOFA_DOUBLE } From 35c8a6e7dd07642d314a42cbccadb30f9d635dda Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Mon, 19 May 2025 08:58:12 +0200 Subject: [PATCH 5/6] fix PointData and TriangleData --- .../src/Shell/Adaptivity/controller/Test2DAdapter.inl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl index c4dbb8a..e45a09b 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl @@ -255,12 +255,8 @@ void Test2DAdapter::init() return; } - pointInfo.createTopologicalEngine(m_container, pointHandler); - pointInfo.registerTopologicalData(); - - triInfo.createTopologicalEngine(m_container, triHandler); - triInfo.registerTopologicalData(); - + pointInfo.createTopologyHandler(m_container); + triInfo.createTopologyHandler(m_container); reinit(); } From b3b0bfd6321f63fd6ff3b77e5b3388577ae1e5c0 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Mon, 19 May 2025 09:12:40 +0200 Subject: [PATCH 6/6] comment code because it does not compile --- .../src/Shell/Adaptivity/controller/Test2DAdapter.inl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl index e45a09b..6a985d5 100644 --- a/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl +++ b/extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl @@ -101,7 +101,7 @@ void Test2DAdapter::PointInfoHandler::swap(unsigned int i1, unsigned int i2) { //std::cout << "pt " << __FUNCTION__ << " " << i1 << " " << i2 << std::endl; - Inherited::swap(i1, i2); + // Inherited::swap(i1, i2); // m_pointId may change if (adapter->m_pointId == i1) { @@ -164,7 +164,7 @@ void Test2DAdapter::TriangleInfoHandler::swap(unsigned int i1, unsigned int i2) { //std::cout << "tri " << __FUNCTION__ << " " << i1 << " " << i2 << std::endl; - Inherited::swap(i1, i2); + // Inherited::swap(i1, i2); if (adapter->m_pointTriId == i1) { adapter->m_pointTriId = i2; @@ -743,9 +743,9 @@ void Test2DAdapter::relocatePoint(Index pt, Coord target, tri[0], tri[1], tri[2], bInRest)); // Do the real work - m_modifier->movePointsProcess(move_ids, move_ancestors, move_coefs); - m_modifier->notifyEndingEvent(); - m_modifier->propagateTopologicalChanges(); + // m_modifier->movePointsProcess(move_ids, move_ancestors, move_coefs); + // m_modifier->notifyEndingEvent(); + // m_modifier->propagateTopologicalChanges(); //mytimer.step("Projection"); projectionUpdate(pt);