27#ifndef vtkPolyhedronContour_h
28#define vtkPolyhedronContour_h
30#include "vtkCommonDataModelModule.h"
37#include <unordered_map>
38#include <unordered_set>
41VTK_ABI_NAMESPACE_BEGIN
90 return static_cast<int>(this->Result.IsoPolygons[polyIdx].size());
98 return this->Result.IsoVertices[this->Result.IsoPolygons[polyIdx][vertIdx]].OutputPointId;
145 std::vector<vtkIdType>& polygonsSize,
212 std::array<double, 3> Position;
219 std::vector<int> VertexTags;
222 std::vector<IsoVertex> IsoVertices;
225 std::vector<std::vector<int>> FaceIsoVertices;
229 std::vector<std::vector<int>> IsoVertexPositionInFace;
233 std::vector<std::vector<int>> IsoPolygons;
236 std::unordered_map<int64_t, int> EdgeToIsoVert;
239 std::vector<bool> Assigned;
243 this->VertexTags.clear();
244 this->IsoVertices.clear();
245 this->FaceIsoVertices.resize(nFaces);
248 this->FaceIsoVertices[i].clear();
250 this->IsoVertexPositionInFace.resize(nFaces);
253 this->IsoVertexPositionInFace[i].clear();
255 this->IsoPolygons.clear();
256 this->EdgeToIsoVert.clear();
257 this->Assigned.clear();
279 static void ClassifyVertices(TraceResult& result,
const std::vector<double>& localScalars,
280 double isoValue,
int& numInside,
int& numOutside);
289 static void FindIsoVertices(TraceResult& result,
vtkIdType nFaces,
290 const vtkIdType* localFaceStream,
const std::vector<double>& localScalars,
double isoValue);
297 static void TraceIsoPolygons(TraceResult& result);
316 static void RunLopezTraceInto(TraceResult& result,
vtkIdType nFaces,
317 const vtkIdType* localFaceStream,
const std::vector<double>& localScalars,
double isoValue);
328 void InterpolatePositionsAndInsertPoints(vtkPolyhedron* cell, vtkIncrementalPointLocator* locator,
329 vtkPointData* inPd, vtkPointData* outPd);
339 struct PolyhedronWorkspace
341 std::vector<double> LocalScalars;
342 std::vector<vtkIdType> LocalFaceStream;
343 std::unordered_map<vtkIdType, int> GlobalToLocal;
345 std::unordered_set<int64_t> LiveIsoEdgeKeys;
346 std::vector<vtkIdType> PieceSizes;
347 std::vector<vtkIdType> LocalToOutputId;
348 std::vector<vtkIdType> IsoToOutputId;
349 std::unordered_map<int64_t, vtkIdType> EdgeToOutputId;
350 std::vector<vtkIdType> CellPts;
351 std::vector<std::vector<vtkIdType>> Pieces;
352 std::vector<vtkIdType> CurrentPiece;
353 std::vector<vtkIdType> CapFace;
object to represent cell connectivity
represent and manipulate cell attribute data
Abstract class in support of both point location and point insertion.
represent and manipulate point attribute data
vtkIdType GetIsoPolygonVertex(int polyIdx, int vertIdx) const
Get iso-polygon vertex (output point ID)
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.
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.