27#ifndef vtkPolyhedronContour_h
28#define vtkPolyhedronContour_h
30#include "vtkCommonDataModelModule.h"
38#include <unordered_map>
39#include <unordered_set>
42VTK_ABI_NAMESPACE_BEGIN
93 return static_cast<int>(this->Result.IsoPolygons[polyIdx].size());
101 return this->Result.IsoVertices[this->Result.IsoPolygons[polyIdx][vertIdx]].OutputPointId;
152 bool generateTriangles, std::vector<vtkIdType>& polygonsSize,
219 std::array<double, 3> Position;
226 std::vector<int> VertexTags;
229 std::vector<IsoVertex> IsoVertices;
232 std::vector<std::vector<int>> FaceIsoVertices;
236 std::vector<std::vector<int>> IsoVertexPositionInFace;
240 std::vector<std::vector<int>> IsoPolygons;
243 std::unordered_map<int64_t, int> EdgeToIsoVert;
246 std::vector<bool> Assigned;
250 this->VertexTags.clear();
251 this->IsoVertices.clear();
252 this->FaceIsoVertices.resize(nFaces);
255 this->FaceIsoVertices[i].clear();
257 this->IsoVertexPositionInFace.resize(nFaces);
260 this->IsoVertexPositionInFace[i].clear();
262 this->IsoPolygons.clear();
263 this->EdgeToIsoVert.clear();
264 this->Assigned.clear();
286 static void ClassifyVertices(TraceResult& result,
const std::vector<double>& localScalars,
287 double isoValue,
int& numInside,
int& numOutside);
296 static void FindIsoVertices(TraceResult& result,
vtkIdType nFaces,
297 const vtkIdType* localFaceStream,
const std::vector<double>& localScalars,
double isoValue);
304 static void TraceIsoPolygons(TraceResult& result);
323 static void RunLopezTraceInto(TraceResult& result,
vtkIdType nFaces,
324 const vtkIdType* localFaceStream,
const std::vector<double>& localScalars,
double isoValue);
335 void InterpolatePositionsAndInsertPoints(vtkPolyhedron* cell, vtkIncrementalPointLocator* locator,
336 vtkPointData* inPd, vtkPointData* outPd);
346 struct PolyhedronWorkspace
348 std::vector<double> LocalScalars;
349 std::vector<vtkIdType> LocalFaceStream;
350 std::unordered_map<vtkIdType, int> GlobalToLocal;
352 std::unordered_set<int64_t> LiveIsoEdgeKeys;
353 std::vector<vtkIdType> PieceSizes;
354 std::vector<vtkIdType> LocalToOutputId;
355 std::vector<vtkIdType> IsoToOutputId;
356 std::unordered_map<int64_t, vtkIdType> EdgeToOutputId;
357 std::vector<vtkIdType> CellPts;
358 std::vector<std::vector<vtkIdType>> Pieces;
359 std::vector<vtkIdType> CurrentPiece;
360 std::vector<vtkIdType> CapFace;
362 std::vector<std::array<double, 3>> EarCoords;
363 std::vector<int> EarPrev;
364 std::vector<int> EarNext;
365 std::vector<int> EarRing;
366 std::vector<double> EarHeapMeasure;
367 std::vector<int> EarHeapVertex;
368 std::vector<int> EarHeapSlot;
object to represent cell connectivity
represent and manipulate cell attribute data
list of point or cell ids
Abstract class in support of both point location and point insertion.
represent and manipulate point attribute data
a cell that represents an n-sided polygon
static void ContourCell(vtkIdType numPointIds, const vtkIdType *pointIds, vtkCellArray *polyhedronFaces, vtkDataArray *points, vtkDataArray *scalars, double isoValue, bool generateTriangles, std::vector< vtkIdType > &polygonsSize, std::vector< EdgeTuple< vtkIdType, double > > &intersectedEdges)
ContourCell for a single polyhedron.
vtkIdType GetIsoPolygonVertex(int polyIdx, int vertIdx) const
Get iso-polygon vertex (output point ID).
int GetNumberOfIsoPolygons() const
Get the number of resulting iso-polygons.
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.
~vtkPolyhedronContour()=default
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.
CellClassification Execute(vtkPolyhedron *cell, vtkDataArray *scalars, double isoValue, vtkIncrementalPointLocator *locator, vtkPointData *inPd, vtkPointData *outPd)
Execute isosurface extraction on a polyhedron cell.
void OutputContours(vtkCellArray *polys, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
Output contour polygons to cell array (triangulates if needed).
vtkPolyhedronContour()=default
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.
int GetIsoPolygonSize(int polyIdx) const
Get iso-polygon vertex count.
A 3D cell defined by a set of polygonal faces.
Templated on types of ids defining an edge, and any data associated with the edge.
Definition of an edge tuple.