caf::HexInterpolator: Add a method to access vertex weights

Add a Cmake file to make it a library
This commit is contained in:
Jacob Støren 2020-01-16 09:23:58 +01:00
parent 0d6c93d96f
commit cd6860b70f
2 changed files with 28 additions and 0 deletions

View File

@ -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})

View File

@ -213,6 +213,13 @@ public:
return interpolateInNormElm( pointInNormElm, values);
}
static std::array<double, 8> vertexWeights(const std::array<cvf::Vec3d, 8>& 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<double, 8>& values)