From cd6860b70ff5a932b53ce72db059614f2e9c159b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Thu, 16 Jan 2020 09:23:58 +0100 Subject: [PATCH] caf::HexInterpolator: Add a method to access vertex weights Add a Cmake file to make it a library --- Fwk/AppFwk/cafHexInterpolator/CMakeLists.txt | 21 +++++++++++++++++++ .../cafHexInterpolator/cafHexInterpolator.h | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 Fwk/AppFwk/cafHexInterpolator/CMakeLists.txt diff --git a/Fwk/AppFwk/cafHexInterpolator/CMakeLists.txt b/Fwk/AppFwk/cafHexInterpolator/CMakeLists.txt new file mode 100644 index 0000000000..50c854478b --- /dev/null +++ b/Fwk/AppFwk/cafHexInterpolator/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required (VERSION 2.8.12) + +project (cafHexInterpolator) + +set( PROJECT_FILES + cafHexInterpolator.h +) + + +add_library( ${PROJECT_NAME} + ${PROJECT_FILES} +) + +target_include_directories(${PROJECT_NAME} + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_link_libraries( ${PROJECT_NAME} LibCore ) + +source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h b/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h index fc1662a23f..af57af35ab 100644 --- a/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h +++ b/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h @@ -213,6 +213,13 @@ public: return interpolateInNormElm( pointInNormElm, values); } + static std::array vertexWeights(const std::array& hexCorners, + const cvf::Vec3d& point ) + { + cvf::Vec3d pointInNormElm = findNormalizedCoords(hexCorners, point); + return interpolationCoeffs(pointInNormElm); + } + private: static double interpolateInNormElm( const cvf::Vec3d & pointInNormElm, const std::array& values)