From 9b31d56711ef093a46cbfccb53416016bf247b75 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Thu, 16 Jul 2026 11:58:04 +0200 Subject: [PATCH 1/2] Refactorize includes to fix compilation --- CMakeLists.txt | 56 ++++++++++--------- .../SofaImplicitField/MarchingCube.cpp | 0 .../SofaImplicitField/MarchingCube.h | 0 .../components}/engine/FieldToSurfaceMesh.cpp | 0 .../components}/engine/FieldToSurfaceMesh.h | 0 .../components}/geometry/BottleField.cpp | 0 .../components}/geometry/BottleField.h | 0 .../geometry/DiscreteGridField.cpp | 0 .../components}/geometry/DiscreteGridField.h | 0 .../components}/geometry/ScalarField.cpp | 3 +- .../components}/geometry/ScalarField.h | 0 .../components}/geometry/SphericalField.cpp | 0 .../components}/geometry/SphericalField.h | 0 .../components}/geometry/StarShapedField.cpp | 2 +- .../components}/geometry/StarShapedField.h | 0 .../mapping/ImplicitSurfaceMapping.cpp | 0 .../mapping/ImplicitSurfaceMapping.h | 0 .../mapping/ImplicitSurfaceMapping.inl | 2 +- .../SofaImplicitField/config.h.in | 0 .../deprecated}/ImplicitSurfaceContainer.h | 0 .../deprecated}/ImplicitSurfaceMapping.h | 0 .../deprecated}/ImplicitSurfaceMapping.inl | 0 .../InterpolatedImplicitSurface.cpp | 0 .../deprecated}/InterpolatedImplicitSurface.h | 0 .../deprecated}/SphereSurface.cpp | 0 .../deprecated}/SphereSurface.h | 0 .../initSofaImplicitField.cpp | 0 .../SofaImplicitField/initSofaImplicitField.h | 0 28 files changed, 34 insertions(+), 29 deletions(-) rename MarchingCube.cpp => src/SofaImplicitField/MarchingCube.cpp (100%) rename MarchingCube.h => src/SofaImplicitField/MarchingCube.h (100%) rename {components => src/SofaImplicitField/components}/engine/FieldToSurfaceMesh.cpp (100%) rename {components => src/SofaImplicitField/components}/engine/FieldToSurfaceMesh.h (100%) rename {components => src/SofaImplicitField/components}/geometry/BottleField.cpp (100%) rename {components => src/SofaImplicitField/components}/geometry/BottleField.h (100%) rename {components => src/SofaImplicitField/components}/geometry/DiscreteGridField.cpp (100%) rename {components => src/SofaImplicitField/components}/geometry/DiscreteGridField.h (100%) rename {components => src/SofaImplicitField/components}/geometry/ScalarField.cpp (99%) rename {components => src/SofaImplicitField/components}/geometry/ScalarField.h (100%) rename {components => src/SofaImplicitField/components}/geometry/SphericalField.cpp (100%) rename {components => src/SofaImplicitField/components}/geometry/SphericalField.h (100%) rename {components => src/SofaImplicitField/components}/geometry/StarShapedField.cpp (99%) rename {components => src/SofaImplicitField/components}/geometry/StarShapedField.h (100%) rename {components => src/SofaImplicitField/components}/mapping/ImplicitSurfaceMapping.cpp (100%) rename {components => src/SofaImplicitField/components}/mapping/ImplicitSurfaceMapping.h (100%) rename {components => src/SofaImplicitField/components}/mapping/ImplicitSurfaceMapping.inl (98%) rename config.h.in => src/SofaImplicitField/config.h.in (100%) rename {deprecated => src/SofaImplicitField/deprecated}/ImplicitSurfaceContainer.h (100%) rename {deprecated => src/SofaImplicitField/deprecated}/ImplicitSurfaceMapping.h (100%) rename {deprecated => src/SofaImplicitField/deprecated}/ImplicitSurfaceMapping.inl (100%) rename {deprecated => src/SofaImplicitField/deprecated}/InterpolatedImplicitSurface.cpp (100%) rename {deprecated => src/SofaImplicitField/deprecated}/InterpolatedImplicitSurface.h (100%) rename {deprecated => src/SofaImplicitField/deprecated}/SphereSurface.cpp (100%) rename {deprecated => src/SofaImplicitField/deprecated}/SphereSurface.h (100%) rename initSofaImplicitField.cpp => src/SofaImplicitField/initSofaImplicitField.cpp (100%) rename initSofaImplicitField.h => src/SofaImplicitField/initSofaImplicitField.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7d8e5d..02f508f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,41 +7,43 @@ if(NOT TARGET Sofa.Framework) endif() sofa_find_package(Sofa.Component.Topology.Container.Constant REQUIRED) +set(SOFAIMPLICITFIELD_SRC "src/${PROJECT_NAME}") + set(HEADER_FILES - config.h.in - initSofaImplicitField.h - MarchingCube.h + ${SOFAIMPLICITFIELD_SRC}/config.h.in + ${SOFAIMPLICITFIELD_SRC}/initSofaImplicitField.h + ${SOFAIMPLICITFIELD_SRC}/MarchingCube.h # This is backward compatibility - deprecated/SphereSurface.h - deprecated/ImplicitSurfaceContainer.h # This is a backward compatibility file toward ScalarField - deprecated/InterpolatedImplicitSurface.h # This is a backward compatibility file toward DiscreteGridField + ${SOFAIMPLICITFIELD_SRC}/deprecated/SphereSurface.h + ${SOFAIMPLICITFIELD_SRC}/deprecated/ImplicitSurfaceContainer.h # This is a backward compatibility file toward ScalarField + ${SOFAIMPLICITFIELD_SRC}/deprecated/InterpolatedImplicitSurface.h # This is a backward compatibility file toward DiscreteGridField - components/engine/FieldToSurfaceMesh.h - components/geometry/BottleField.h - components/geometry/DiscreteGridField.h - components/geometry/SphericalField.h - components/geometry/ScalarField.h - components/geometry/StarShapedField.h - components/mapping/ImplicitSurfaceMapping.h - components/mapping/ImplicitSurfaceMapping.inl + ${SOFAIMPLICITFIELD_SRC}/components/engine/FieldToSurfaceMesh.h + ${SOFAIMPLICITFIELD_SRC}/components/geometry/BottleField.h + ${SOFAIMPLICITFIELD_SRC}/components/geometry/DiscreteGridField.h + ${SOFAIMPLICITFIELD_SRC}/components/geometry/SphericalField.h + ${SOFAIMPLICITFIELD_SRC}/components/geometry/ScalarField.h + ${SOFAIMPLICITFIELD_SRC}/components/geometry/StarShapedField.h + ${SOFAIMPLICITFIELD_SRC}/components/mapping/ImplicitSurfaceMapping.h + ${SOFAIMPLICITFIELD_SRC}/components/mapping/ImplicitSurfaceMapping.inl ) set(SOURCE_FILES - initSofaImplicitField.cpp - MarchingCube.cpp + ${SOFAIMPLICITFIELD_SRC}/initSofaImplicitField.cpp + ${SOFAIMPLICITFIELD_SRC}/MarchingCube.cpp ## This is a backward compatibility.. - deprecated/SphereSurface.cpp - deprecated/InterpolatedImplicitSurface.cpp - - components/engine/FieldToSurfaceMesh.cpp - components/geometry/BottleField.cpp - components/geometry/ScalarField.cpp - components/geometry/DiscreteGridField.cpp - components/geometry/SphericalField.cpp - components/geometry/StarShapedField.cpp - components/mapping/ImplicitSurfaceMapping.cpp + ${SOFAIMPLICITFIELD_SRC}/deprecated/SphereSurface.cpp + ${SOFAIMPLICITFIELD_SRC}/deprecated/InterpolatedImplicitSurface.cpp + + ${SOFAIMPLICITFIELD_SRC}/components/engine/FieldToSurfaceMesh.cpp + ${SOFAIMPLICITFIELD_SRC}/components/geometry/BottleField.cpp + ${SOFAIMPLICITFIELD_SRC}/components/geometry/ScalarField.cpp + ${SOFAIMPLICITFIELD_SRC}/components/geometry/DiscreteGridField.cpp + ${SOFAIMPLICITFIELD_SRC}/components/geometry/SphericalField.cpp + ${SOFAIMPLICITFIELD_SRC}/components/geometry/StarShapedField.cpp + ${SOFAIMPLICITFIELD_SRC}/components/mapping/ImplicitSurfaceMapping.cpp ) set(EXTRA_FILES @@ -65,5 +67,7 @@ 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/MarchingCube.cpp b/src/SofaImplicitField/MarchingCube.cpp similarity index 100% rename from MarchingCube.cpp rename to src/SofaImplicitField/MarchingCube.cpp diff --git a/MarchingCube.h b/src/SofaImplicitField/MarchingCube.h similarity index 100% rename from MarchingCube.h rename to src/SofaImplicitField/MarchingCube.h diff --git a/components/engine/FieldToSurfaceMesh.cpp b/src/SofaImplicitField/components/engine/FieldToSurfaceMesh.cpp similarity index 100% rename from components/engine/FieldToSurfaceMesh.cpp rename to src/SofaImplicitField/components/engine/FieldToSurfaceMesh.cpp diff --git a/components/engine/FieldToSurfaceMesh.h b/src/SofaImplicitField/components/engine/FieldToSurfaceMesh.h similarity index 100% rename from components/engine/FieldToSurfaceMesh.h rename to src/SofaImplicitField/components/engine/FieldToSurfaceMesh.h diff --git a/components/geometry/BottleField.cpp b/src/SofaImplicitField/components/geometry/BottleField.cpp similarity index 100% rename from components/geometry/BottleField.cpp rename to src/SofaImplicitField/components/geometry/BottleField.cpp diff --git a/components/geometry/BottleField.h b/src/SofaImplicitField/components/geometry/BottleField.h similarity index 100% rename from components/geometry/BottleField.h rename to src/SofaImplicitField/components/geometry/BottleField.h diff --git a/components/geometry/DiscreteGridField.cpp b/src/SofaImplicitField/components/geometry/DiscreteGridField.cpp similarity index 100% rename from components/geometry/DiscreteGridField.cpp rename to src/SofaImplicitField/components/geometry/DiscreteGridField.cpp diff --git a/components/geometry/DiscreteGridField.h b/src/SofaImplicitField/components/geometry/DiscreteGridField.h similarity index 100% rename from components/geometry/DiscreteGridField.h rename to src/SofaImplicitField/components/geometry/DiscreteGridField.h diff --git a/components/geometry/ScalarField.cpp b/src/SofaImplicitField/components/geometry/ScalarField.cpp similarity index 99% rename from components/geometry/ScalarField.cpp rename to src/SofaImplicitField/components/geometry/ScalarField.cpp index 9c0323b..9f66a0e 100644 --- a/components/geometry/ScalarField.cpp +++ b/src/SofaImplicitField/components/geometry/ScalarField.cpp @@ -27,7 +27,8 @@ #include -#include "ScalarField.h" +#include + namespace sofa { diff --git a/components/geometry/ScalarField.h b/src/SofaImplicitField/components/geometry/ScalarField.h similarity index 100% rename from components/geometry/ScalarField.h rename to src/SofaImplicitField/components/geometry/ScalarField.h diff --git a/components/geometry/SphericalField.cpp b/src/SofaImplicitField/components/geometry/SphericalField.cpp similarity index 100% rename from components/geometry/SphericalField.cpp rename to src/SofaImplicitField/components/geometry/SphericalField.cpp diff --git a/components/geometry/SphericalField.h b/src/SofaImplicitField/components/geometry/SphericalField.h similarity index 100% rename from components/geometry/SphericalField.h rename to src/SofaImplicitField/components/geometry/SphericalField.h diff --git a/components/geometry/StarShapedField.cpp b/src/SofaImplicitField/components/geometry/StarShapedField.cpp similarity index 99% rename from components/geometry/StarShapedField.cpp rename to src/SofaImplicitField/components/geometry/StarShapedField.cpp index f41b2d7..806a322 100644 --- a/components/geometry/StarShapedField.cpp +++ b/src/SofaImplicitField/components/geometry/StarShapedField.cpp @@ -23,7 +23,7 @@ #include using sofa::core::RegisterObject ; -#include "StarShapedField.h" +#include namespace sofa::component::geometry::_StarShapedField_ { diff --git a/components/geometry/StarShapedField.h b/src/SofaImplicitField/components/geometry/StarShapedField.h similarity index 100% rename from components/geometry/StarShapedField.h rename to src/SofaImplicitField/components/geometry/StarShapedField.h diff --git a/components/mapping/ImplicitSurfaceMapping.cpp b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.cpp similarity index 100% rename from components/mapping/ImplicitSurfaceMapping.cpp rename to src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.cpp diff --git a/components/mapping/ImplicitSurfaceMapping.h b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.h similarity index 100% rename from components/mapping/ImplicitSurfaceMapping.h rename to src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.h diff --git a/components/mapping/ImplicitSurfaceMapping.inl b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl similarity index 98% rename from components/mapping/ImplicitSurfaceMapping.inl rename to src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl index 267b73e..e86f254 100644 --- a/components/mapping/ImplicitSurfaceMapping.inl +++ b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl @@ -21,7 +21,7 @@ ******************************************************************************/ #pragma once -#include "ImplicitSurfaceMapping.h" +#include #include #include #include diff --git a/config.h.in b/src/SofaImplicitField/config.h.in similarity index 100% rename from config.h.in rename to src/SofaImplicitField/config.h.in diff --git a/deprecated/ImplicitSurfaceContainer.h b/src/SofaImplicitField/deprecated/ImplicitSurfaceContainer.h similarity index 100% rename from deprecated/ImplicitSurfaceContainer.h rename to src/SofaImplicitField/deprecated/ImplicitSurfaceContainer.h diff --git a/deprecated/ImplicitSurfaceMapping.h b/src/SofaImplicitField/deprecated/ImplicitSurfaceMapping.h similarity index 100% rename from deprecated/ImplicitSurfaceMapping.h rename to src/SofaImplicitField/deprecated/ImplicitSurfaceMapping.h diff --git a/deprecated/ImplicitSurfaceMapping.inl b/src/SofaImplicitField/deprecated/ImplicitSurfaceMapping.inl similarity index 100% rename from deprecated/ImplicitSurfaceMapping.inl rename to src/SofaImplicitField/deprecated/ImplicitSurfaceMapping.inl diff --git a/deprecated/InterpolatedImplicitSurface.cpp b/src/SofaImplicitField/deprecated/InterpolatedImplicitSurface.cpp similarity index 100% rename from deprecated/InterpolatedImplicitSurface.cpp rename to src/SofaImplicitField/deprecated/InterpolatedImplicitSurface.cpp diff --git a/deprecated/InterpolatedImplicitSurface.h b/src/SofaImplicitField/deprecated/InterpolatedImplicitSurface.h similarity index 100% rename from deprecated/InterpolatedImplicitSurface.h rename to src/SofaImplicitField/deprecated/InterpolatedImplicitSurface.h diff --git a/deprecated/SphereSurface.cpp b/src/SofaImplicitField/deprecated/SphereSurface.cpp similarity index 100% rename from deprecated/SphereSurface.cpp rename to src/SofaImplicitField/deprecated/SphereSurface.cpp diff --git a/deprecated/SphereSurface.h b/src/SofaImplicitField/deprecated/SphereSurface.h similarity index 100% rename from deprecated/SphereSurface.h rename to src/SofaImplicitField/deprecated/SphereSurface.h diff --git a/initSofaImplicitField.cpp b/src/SofaImplicitField/initSofaImplicitField.cpp similarity index 100% rename from initSofaImplicitField.cpp rename to src/SofaImplicitField/initSofaImplicitField.cpp diff --git a/initSofaImplicitField.h b/src/SofaImplicitField/initSofaImplicitField.h similarity index 100% rename from initSofaImplicitField.h rename to src/SofaImplicitField/initSofaImplicitField.h From cfff5aa07110c1350b3dcfad38d5791deae159c6 Mon Sep 17 00:00:00 2001 From: bakpaul Date: Thu, 16 Jul 2026 15:51:08 +0200 Subject: [PATCH 2/2] Fix compilation --- src/SofaImplicitField/components/geometry/BottleField.cpp | 2 +- src/SofaImplicitField/components/geometry/BottleField.h | 2 +- src/SofaImplicitField/components/geometry/DiscreteGridField.cpp | 2 +- src/SofaImplicitField/components/geometry/ScalarField.cpp | 2 +- src/SofaImplicitField/components/geometry/SphericalField.cpp | 2 +- src/SofaImplicitField/components/geometry/SphericalField.h | 2 +- src/SofaImplicitField/components/geometry/StarShapedField.cpp | 2 +- src/SofaImplicitField/components/geometry/StarShapedField.h | 2 +- .../components/mapping/ImplicitSurfaceMapping.cpp | 2 +- .../components/mapping/ImplicitSurfaceMapping.inl | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/SofaImplicitField/components/geometry/BottleField.cpp b/src/SofaImplicitField/components/geometry/BottleField.cpp index 2ed50eb..11b9bb1 100644 --- a/src/SofaImplicitField/components/geometry/BottleField.cpp +++ b/src/SofaImplicitField/components/geometry/BottleField.cpp @@ -23,7 +23,7 @@ #include using sofa::core::RegisterObject ; -#include "BottleField.h" +#include namespace sofa::component::geometry::_BottleField_ { diff --git a/src/SofaImplicitField/components/geometry/BottleField.h b/src/SofaImplicitField/components/geometry/BottleField.h index 1f62df0..01249e4 100644 --- a/src/SofaImplicitField/components/geometry/BottleField.h +++ b/src/SofaImplicitField/components/geometry/BottleField.h @@ -21,7 +21,7 @@ ******************************************************************************/ #pragma once -#include "ScalarField.h" +#include #include namespace sofa::component::geometry { diff --git a/src/SofaImplicitField/components/geometry/DiscreteGridField.cpp b/src/SofaImplicitField/components/geometry/DiscreteGridField.cpp index fa6949c..83327db 100644 --- a/src/SofaImplicitField/components/geometry/DiscreteGridField.cpp +++ b/src/SofaImplicitField/components/geometry/DiscreteGridField.cpp @@ -24,7 +24,7 @@ #include using sofa::core::RegisterObject ; -#include "DiscreteGridField.h" +#include namespace sofa::component::geometry::_discretegrid_ diff --git a/src/SofaImplicitField/components/geometry/ScalarField.cpp b/src/SofaImplicitField/components/geometry/ScalarField.cpp index 9f66a0e..9dcae38 100644 --- a/src/SofaImplicitField/components/geometry/ScalarField.cpp +++ b/src/SofaImplicitField/components/geometry/ScalarField.cpp @@ -27,7 +27,7 @@ #include -#include +#include namespace sofa { diff --git a/src/SofaImplicitField/components/geometry/SphericalField.cpp b/src/SofaImplicitField/components/geometry/SphericalField.cpp index 14b0c52..9f492ab 100644 --- a/src/SofaImplicitField/components/geometry/SphericalField.cpp +++ b/src/SofaImplicitField/components/geometry/SphericalField.cpp @@ -23,7 +23,7 @@ #include using sofa::core::RegisterObject ; -#include "SphericalField.h" +#include namespace sofa::component::geometry::_sphericalfield_ { diff --git a/src/SofaImplicitField/components/geometry/SphericalField.h b/src/SofaImplicitField/components/geometry/SphericalField.h index 6880a14..c77df18 100644 --- a/src/SofaImplicitField/components/geometry/SphericalField.h +++ b/src/SofaImplicitField/components/geometry/SphericalField.h @@ -22,7 +22,7 @@ #ifndef SOFA_IMPLICIT_SPHERICALFIELD_H #define SOFA_IMPLICIT_SPHERICALFIELD_H -#include "ScalarField.h" +#include namespace sofa { diff --git a/src/SofaImplicitField/components/geometry/StarShapedField.cpp b/src/SofaImplicitField/components/geometry/StarShapedField.cpp index 806a322..412c571 100644 --- a/src/SofaImplicitField/components/geometry/StarShapedField.cpp +++ b/src/SofaImplicitField/components/geometry/StarShapedField.cpp @@ -23,7 +23,7 @@ #include using sofa::core::RegisterObject ; -#include +#include namespace sofa::component::geometry::_StarShapedField_ { diff --git a/src/SofaImplicitField/components/geometry/StarShapedField.h b/src/SofaImplicitField/components/geometry/StarShapedField.h index 1d0aebb..3295bb6 100644 --- a/src/SofaImplicitField/components/geometry/StarShapedField.h +++ b/src/SofaImplicitField/components/geometry/StarShapedField.h @@ -21,7 +21,7 @@ ******************************************************************************/ #pragma once -#include "ScalarField.h" +#include #include namespace sofa::component::geometry diff --git a/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.cpp b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.cpp index 9609e65..bf0697a 100644 --- a/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.cpp +++ b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.cpp @@ -22,7 +22,7 @@ #define SOFA_COMPONENT_MAPPING_IMPLICITSURFACEMAPPING_CPP #include #include -#include "ImplicitSurfaceMapping.inl" +#include namespace sofaimplicitfield::mapping { diff --git a/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl index e86f254..0dbb49b 100644 --- a/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl +++ b/src/SofaImplicitField/components/mapping/ImplicitSurfaceMapping.inl @@ -21,7 +21,7 @@ ******************************************************************************/ #pragma once -#include +#include #include #include #include