VTK  9.2.6
vtkStaticCellLinksTemplate.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkStaticCellLinksTemplate.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
45#ifndef vtkStaticCellLinksTemplate_h
46#define vtkStaticCellLinksTemplate_h
47
48class vtkDataSet;
49class vtkPolyData;
52class vtkCellArray;
53
55
56template <typename TIds>
58{
59public:
61
67
71 void Initialize();
72
78
83
88
93
97 void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
99 const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
100
102
105 TIds GetNumberOfCells(vtkIdType ptId) { return (this->Offsets[ptId + 1] - this->Offsets[ptId]); }
106 vtkIdType GetNcells(vtkIdType ptId) { return (this->Offsets[ptId + 1] - this->Offsets[ptId]); }
108
113 template <typename TGivenIds>
114 bool MatchesCell(TGivenIds npts, const TGivenIds* pts);
115
119 TIds* GetCells(vtkIdType ptId) { return (this->Links + this->Offsets[ptId]); }
120
125 void GetCells(vtkIdType npts, const vtkIdType* pts, vtkIdList* cells);
126
131 TIds GetLinksSize() { return this->LinksSize; }
132
137 TIds GetOffset(vtkIdType ptId) { return this->Offsets[ptId]; }
138
140
143 unsigned long GetActualMemorySize();
145 void SelectCells(vtkIdType minMaxDegree[2], unsigned char* cellSelection);
147
149
155
156protected:
157 // The various templated data members
159 TIds NumPts;
161
162 // These point to the core data structures
163 TIds* Links; // contiguous runs of cell ids
164 TIds* Offsets; // offsets for each point into the links array
165
166 // Support for execution
167 int Type;
169
170private:
172 void operator=(const vtkStaticCellLinksTemplate&) = delete;
173};
174
175#include "vtkStaticCellLinksTemplate.txx"
176
177#endif
178// VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
object to represent cell connectivity
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
structured grid with explicit topology and geometry
list of point or cell ids
Definition vtkIdList.h:31
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
object represents upward pointers from points to list of cells using each point (template implementat...
TIds GetLinksSize()
Return the total number of links represented after the links have been built.
vtkStaticCellLinksTemplate()
Instantiate and destructor methods.
void BuildLinks(vtkUnstructuredGrid *ugrid)
Build the link list array for vtkUnstructuredGrid.
vtkIdType GetNcells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
void Initialize()
Make sure any previously created links are cleaned up.
void BuildLinks(vtkExplicitStructuredGrid *esgrid)
Build the link list array for vtkExplicitStructuredGrid.
TIds GetNumberOfCells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point specified by ptId.
void ThreadedBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray *cellArray)
void BuildLinks(vtkDataSet *ds)
Build the link list array for a general dataset.
~vtkStaticCellLinksTemplate()
Instantiate and destructor methods.
void BuildLinks(vtkPolyData *pd)
Build the link list array for vtkPolyData.
void SetSequentialProcessing(vtkTypeBool seq)
Control whether to thread or serial process.
unsigned long GetActualMemorySize()
Support vtkAbstractCellLinks API.
bool MatchesCell(TGivenIds npts, const TGivenIds *pts)
Indicate whether the point ids provided defines at least one cell, or a portion of a cell.
void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray *cellArray)
Specialized methods for building links from cell array.
void GetCells(vtkIdType npts, const vtkIdType *pts, vtkIdList *cells)
Given point ids that define a cell, find the cells that contains all of these point ids.
void DeepCopy(vtkAbstractCellLinks *src)
Support vtkAbstractCellLinks API.
vtkTypeBool GetSequentialProcessing()
Control whether to thread or serial process.
void SelectCells(vtkIdType minMaxDegree[2], unsigned char *cellSelection)
Support vtkAbstractCellLinks API.
TIds GetOffset(vtkIdType ptId)
Obtain the offsets into the internal links array.
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition vtkABI.h:69
int vtkIdType
Definition vtkType.h:332