590#ifndef vtkSurfaceNets3DNonManifoldCases_h
591#define vtkSurfaceNets3DNonManifoldCases_h
593#include "vtkFiltersCoreModule.h"
594#include "vtkSetGet.h"
600VTK_ABI_NAMESPACE_BEGIN
601#define VTK_SURFACE_NETS_3D_ALWAYS_SPLIT_CASES_1_3
606#ifdef VTK_SURFACE_NETS_3D_SUPPORT_ALL_SOLVABLE_VARIATIONS_FOR_CASE_8
670#ifdef VTK_SURFACE_NETS_3D_SUPPORT_ALL_SOLVABLE_VARIATIONS_FOR_CASE_8
671 NonManifoldIndex9 = 9,
752 return EdgeCaseOffsets[edgeCase + 1] - EdgeCaseOffsets[edgeCase];
770 return NonManifoldMetadata[EdgeCaseOffsets[edgeCase] + tableIndex].NonManifoldCase;
786 return NonManifoldMetadata[EdgeCaseOffsets[edgeCase] + tableIndex].VoxelCase;
802 return NonManifoldMetadata[EdgeCaseOffsets[edgeCase] + tableIndex].IsHomogeneous;
817 constexpr uint8_t pointsPerNonManifoldCase[12] = {
831 return pointsPerNonManifoldCase[nonManifoldCase];
851 template <u
int8_t QuadId>
855 static_assert(QuadId < 12,
"QuadId must be between 0 and 11 (inclusive)");
856 return NonManifoldMetadata[EdgeCaseOffsets[edgeCase] + tableIndex].PointIndices[QuadId];
870 constexpr uint8_t subCasesPerNonManifoldCase[12] = {
884 return subCasesPerNonManifoldCase[nonManifoldCase];
897 ->
const std::array<EdgeCaseType, 4>&
899 static constexpr std::array<EdgeCaseType, 4> Empty{};
904 return NonManifoldMetadata[EdgeCaseOffsets[edgeCase] + tableIndex].SubEdgeCases;
936 static constexpr VTK_ALWAYS_INLINE
auto ComputeState(uint8_t numPoints, int8_t tableIndex)
946 return 3 + tableIndex;
984#ifdef VTK_SURFACE_NETS_3D_SUPPORT_ALL_SOLVABLE_VARIATIONS_FOR_CASE_8
992 { 3, NonManifoldIndex9 },
1010 return InfoTable[state];
1027 static VTK_ALWAYS_INLINE
auto GetManifoldSubVoxelCases(EdgeCaseType edgeCase, int8_t tableIndex)
1028 ->
const std::array<VoxelCaseType, 4>&
1030 return NonManifoldMetadata[EdgeCaseOffsets[edgeCase] + tableIndex].SubVoxelCases;
1033 static const std::array<uint16_t, 4097>& EdgeCaseOffsets;
1034 static const std::array<NonManifoldCaseMetadata, 3736>& NonManifoldMetadata;
1036VTK_ABI_NAMESPACE_END
Provides utilities to identify vtkSurfaceNets3D's edge-cases that can lead to non-manifold output geo...
static constexpr VTK_ALWAYS_INLINE auto GetNumberOfManifoldSubCases(NonManifoldCaseType nonManifoldCase) -> uint8_t
Given the non-manifold case, returns the number of manifold sub-cases.
static VTK_ALWAYS_INLINE auto IsNonManifoldCaseHomogeneous(EdgeCaseType edgeCase, int8_t tableIndex) -> NonManifoldCaseType
Given an edge case and the table index for the non-manifold case, returns whether it's homogeneous or...
static auto GetNonManifoldTableIndex(const VoxelNeighborhood< T > &voxelNeighborhood) -> int8_t
Returns the index into the non-manifold metadata table for the given voxel neighborhood,...
static constexpr uint8_t MaxTableIndex
unsigned short EdgeCaseType
static VTK_ALWAYS_INLINE auto GetNonManiFoldPointIndex(EdgeCaseType edgeCase, int8_t tableIndex) -> int8_t
Given a quad id (bits 0–3 for yz-plane quads, 4–7 for xz-plane, 8–11 for xy-plane),...
static constexpr VTK_ALWAYS_INLINE auto ComputeState(uint8_t numPoints, int8_t tableIndex) -> uint8_t
Computes a state code from a point count and table index using a variable-width linear mapping.
static VTK_ALWAYS_INLINE auto GetManifoldSubEdgeCases(EdgeCaseType edgeCase, int8_t tableIndex) -> const std::array< EdgeCaseType, 4 > &
Returns the manifold sub-edge cases for a given edge case and table index.
static constexpr VTK_ALWAYS_INLINE auto GetStateInfo(uint8_t state) -> StateInfo
Decodes both the number of duplicate points and the metadata table index from a state code in a singl...
static constexpr VTK_ALWAYS_INLINE auto GetNumberOfPoints(NonManifoldCaseType nonManifoldCase) -> uint8_t
Given the non-manifold case, returns the number of duplicate points.
static VTK_ALWAYS_INLINE auto GetNonManifoldCase(EdgeCaseType edgeCase, int8_t tableIndex) -> NonManifoldCaseType
Given an edge case and the table index for the non-manifold case, returns the corresponding non-manif...
@ NonManifoldIndexUnsolvable
unsigned char VoxelCaseType
static VTK_ALWAYS_INLINE auto GetNumberOfNonManifoldCases(EdgeCaseType edgeCase) -> uint8_t
Returns the number of non-manifold metadata entries for the given edge case.
unsigned char NonManifoldCaseType
static VTK_ALWAYS_INLINE auto GetNonManifoldBasicVoxelCase(EdgeCaseType edgeCase, int8_t tableIndex) -> VoxelCaseType
Given an edge case and the table index for the non-manifold case, returns the corresponding basic vox...
Decoded metadata for a state: number of points to generate and the corresponding non-manifold table i...
Holds the local configuration of the 8 voxels surrounding a triad point in the grid.
std::array< T, 8 > Labels