VTK  9.6.20260509
vtkPolyhedronContour Class Reference

Isosurface extraction using López polygon tracing algorithm. More...

#include <vtkPolyhedronContour.h>

Public Types

enum class  CellClassification { AllInside , AllOutside , Intersected }
 

Public Member Functions

 vtkPolyhedronContour ()=default
 
 ~vtkPolyhedronContour ()=default
 
CellClassification Execute (vtkPolyhedron *cell, vtkDataArray *scalars, double isoValue, vtkIncrementalPointLocator *locator, vtkPointData *inPd, vtkPointData *outPd)
 Execute isosurface extraction on a polyhedron cell.
 
int GetNumberOfIsoPolygons () const
 Get the number of resulting iso-polygons.
 
int GetIsoPolygonSize (int polyIdx) const
 Get iso-polygon vertex count.
 
vtkIdType GetIsoPolygonVertex (int polyIdx, int vertIdx) const
 Get iso-polygon vertex (output point ID)
 
void OutputContours (vtkCellArray *polys, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
 Output contour polygons to cell array (triangulates if needed)
 
void OutputClip (vtkPolyhedron *cell, vtkCellArray *connectivity, vtkIncrementalPointLocator *locator, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut, vtkCellArray *outFaces=nullptr, vtkCellArray *outFaceLocs=nullptr)
 Output clipped polyhedron faces to connectivity array.
 

Static Public Member Functions

static void ContourCell (vtkIdType numPointIds, const vtkIdType *pointIds, vtkCellArray *polyhedronFaces, vtkDataArray *scalars, double isoValue, bool generateTriangles, std::vector< vtkIdType > &polygonsSize, std::vector< EdgeTuple< vtkIdType, double > > &intersectedEdges)
 ContourCell for a single polyhedron.
 
static void CountClip (vtkIdType numPointIds, const vtkIdType *pointIds, vtkCellArray *polyhedronFaces, vtkDataArray *scalars, double isoValue, bool insideOut, vtkIdType &numOutputCells, vtkIdType &numOutputCellConnectivity, vtkIdType &numOutputFaces, vtkIdType &numOutputFacesConnectivity, std::vector< EdgeTuple< vtkIdType, double > > &intersectedEdges)
 Pass 1: Count clip output sizes for a single polyhedron.
 
static void EmitClip (vtkIdType numPointIds, const vtkIdType *pointIds, vtkCellArray *polyhedronFaces, vtkDataArray *scalars, double isoValue, bool insideOut, vtkDataArray *pointMap, vtkIdType numberOfKeptPoints, const vtkStaticEdgeLocatorTemplate< vtkIdType, double > &edgeLocator, vtkCellArray *outputCells, vtkCellArray *outputFaces)
 Pass 2: Emit clipped polyhedron for a single cell.
 

Detailed Description

Isosurface extraction using López polygon tracing algorithm.

Isosurface extraction for arbitrary polyhedra using polygon tracing.

Implementation of the polygon-tracing algorithm for isosurface extraction:

J. López, A. Esteban, J. Hernández, P. Gómez, R. Zamora, C. Zanzi, F. Faura, "A new isosurface extraction method on arbitrary grids", Journal of Computational Physics, Volume 444, 2021, 110579. https://doi.org/10.1016/j.jcp.2021.110579

Reference implementation (isoap library): https://doi.org/10.17632/4rcf98s74c.1

The algorithm works by:

  1. Classifying vertices as inside (scalar > isovalue) or outside
  2. Finding iso-vertices where edges cross the isosurface
  3. Tracing closed polygons through the iso-vertices using face adjacency

Key insight: Each iso-vertex has a "key face" where the edge transitions from outside→inside. Polygon tracing simply walks to the next iso-vertex on each key face until returning to the start.

Definition at line 53 of file vtkPolyhedronContour.h.

Member Enumeration Documentation

◆ CellClassification

Enumerator
AllInside 
AllOutside 
Intersected 

Definition at line 59 of file vtkPolyhedronContour.h.

Constructor & Destructor Documentation

◆ vtkPolyhedronContour()

vtkPolyhedronContour::vtkPolyhedronContour ( )
default

◆ ~vtkPolyhedronContour()

vtkPolyhedronContour::~vtkPolyhedronContour ( )
default

Member Function Documentation

◆ Execute()

CellClassification vtkPolyhedronContour::Execute ( vtkPolyhedron * cell,
vtkDataArray * scalars,
double isoValue,
vtkIncrementalPointLocator * locator,
vtkPointData * inPd,
vtkPointData * outPd )

Execute isosurface extraction on a polyhedron cell.

Parameters
cellThe polyhedron cell
scalarsScalar values at cell vertices (local indexing)
isoValueThe isosurface value
locatorPoint locator for output points
inPdInput point data for interpolation
outPdOutput point data
Returns
Cell classification (AllInside, AllOutside, or Intersected)

◆ GetNumberOfIsoPolygons()

int vtkPolyhedronContour::GetNumberOfIsoPolygons ( ) const
inline

Get the number of resulting iso-polygons.

Definition at line 83 of file vtkPolyhedronContour.h.

◆ GetIsoPolygonSize()

int vtkPolyhedronContour::GetIsoPolygonSize ( int polyIdx) const
inline

Get iso-polygon vertex count.

Definition at line 88 of file vtkPolyhedronContour.h.

◆ GetIsoPolygonVertex()

vtkIdType vtkPolyhedronContour::GetIsoPolygonVertex ( int polyIdx,
int vertIdx ) const
inline

Get iso-polygon vertex (output point ID)

Definition at line 96 of file vtkPolyhedronContour.h.

◆ OutputContours()

void vtkPolyhedronContour::OutputContours ( vtkCellArray * polys,
vtkCellData * inCd,
vtkIdType cellId,
vtkCellData * outCd )

Output contour polygons to cell array (triangulates if needed)

◆ OutputClip()

void vtkPolyhedronContour::OutputClip ( vtkPolyhedron * cell,
vtkCellArray * connectivity,
vtkIncrementalPointLocator * locator,
vtkPointData * inPd,
vtkPointData * outPd,
vtkCellData * inCd,
vtkIdType cellId,
vtkCellData * outCd,
int insideOut,
vtkCellArray * outFaces = nullptr,
vtkCellArray * outFaceLocs = nullptr )

Output clipped polyhedron faces to connectivity array.

If outFaces and outFaceLocs are provided, faces are written directly into those arrays (bypassing the embedded face-stream format). The caller is responsible for ensuring outFaces and outFaceLocs are initialized. If null, falls back to the embedded polyhedron face-stream format.

◆ ContourCell()

static void vtkPolyhedronContour::ContourCell ( vtkIdType numPointIds,
const vtkIdType * pointIds,
vtkCellArray * polyhedronFaces,
vtkDataArray * scalars,
double isoValue,
bool generateTriangles,
std::vector< vtkIdType > & polygonsSize,
std::vector< EdgeTuple< vtkIdType, double > > & intersectedEdges )
static

ContourCell for a single polyhedron.

Parameters
numPointIdsNumber of unique points in this cell
pointIdsGlobal point IDs for this cell, [numPointIds]
polyhedronFacesPolyhedron faces
scalarsScalar array (indexed by global point ID)
isoValueClip value
generateTrianglesIf true, output.PolyConn is triangle soup.
polygonsSize[out] Polygon vertex counts (num vertices per polygon, size NPolys). Make sure to clear it before adding.
intersectedEdges[out] Intersected Edges defined as (globalPtId0, globalPtId1, t). Make sure to clear it before adding.

◆ CountClip()

static void vtkPolyhedronContour::CountClip ( vtkIdType numPointIds,
const vtkIdType * pointIds,
vtkCellArray * polyhedronFaces,
vtkDataArray * scalars,
double isoValue,
bool insideOut,
vtkIdType & numOutputCells,
vtkIdType & numOutputCellConnectivity,
vtkIdType & numOutputFaces,
vtkIdType & numOutputFacesConnectivity,
std::vector< EdgeTuple< vtkIdType, double > > & intersectedEdges )
static

Pass 1: Count clip output sizes for a single polyhedron.

Parameters
numPointIdsNumber of unique points in this cell
pointIdsGlobal point IDs for this cell, [numPointIds]
polyhedronFacesPolyhedron faces
scalarsScalar array (indexed by global point ID)
isoValueClip value
insideOutIf true, retain the outside portion
numOutputCells[out] Number of output cells (0 or 1)
numOutputCellConnectivity[out] Total output points (surviving + iso-vertices)
numOutputFaces[out] Number of output faces (clipped originals + caps)
numOutputFacesConnectivity[out] Total face stream connectivity size
intersectedEdges[out] Intersected Edges defined as (globalPtId0, globalPtId1, t). Make sure to clear it before adding.

◆ EmitClip()

static void vtkPolyhedronContour::EmitClip ( vtkIdType numPointIds,
const vtkIdType * pointIds,
vtkCellArray * polyhedronFaces,
vtkDataArray * scalars,
double isoValue,
bool insideOut,
vtkDataArray * pointMap,
vtkIdType numberOfKeptPoints,
const vtkStaticEdgeLocatorTemplate< vtkIdType, double > & edgeLocator,
vtkCellArray * outputCells,
vtkCellArray * outputFaces )
static

Pass 2: Emit clipped polyhedron for a single cell.

Parameters
numPointIdsNumber of unique points in this cell
pointIdsGlobal point IDs for this cell, [numPointIds]
polyhedronFacesPolyhedron faces
scalarsScalar array (indexed by global point ID)
isoValueClip value
insideOutIf true, retain the outside portion
pointMapMap that returns the output point id of an input point Use GetIntegerTuple to access its values
numberOfKeptPointsNumber of input points that are retained in the output)
edgeLocatorEdge locator to get the edge id for a pair of point ids Use IsEdgeInserted to get the output edge id. To compute the output edge point id, add numberOfKeptPoints to it.
outputCells[out] Global point IDs of each output cell (polyhedron has only 1) Make sure to Reset it before adding anything to it.
outputFaces[out] Faces of the single output polyhedron Make sure to Reset it before adding anything to it.

The documentation for this class was generated from the following file: