VTK  9.2.20221001
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 =========================================================================*/
48 #ifndef vtkStaticCellLinksTemplate_h
49 #define vtkStaticCellLinksTemplate_h
50 
51 #include "vtkABINamespace.h"
52 
53 VTK_ABI_NAMESPACE_BEGIN
54 class vtkDataSet;
55 class vtkPolyData;
58 class vtkCellArray;
59 VTK_ABI_NAMESPACE_END
60 
61 #include "vtkAbstractCellLinks.h"
62 
63 VTK_ABI_NAMESPACE_BEGIN
64 template <typename TIds>
66 {
67 public:
69 
75 
79  void Initialize();
80 
86 
91 
96 
101 
105  void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
107  const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
108 
110 
113  TIds GetNumberOfCells(vtkIdType ptId) { return (this->Offsets[ptId + 1] - this->Offsets[ptId]); }
114  vtkIdType GetNcells(vtkIdType ptId) { return (this->Offsets[ptId + 1] - this->Offsets[ptId]); }
116 
121  template <typename TGivenIds>
122  bool MatchesCell(TGivenIds npts, const TGivenIds* pts);
123 
127  TIds* GetCells(vtkIdType ptId) { return (this->Links + this->Offsets[ptId]); }
128 
133  void GetCells(vtkIdType npts, const vtkIdType* pts, vtkIdList* cells);
134 
139  TIds GetLinksSize() { return this->LinksSize; }
140 
145  TIds GetOffset(vtkIdType ptId) { return this->Offsets[ptId]; }
146 
148 
151  unsigned long GetActualMemorySize();
153  void SelectCells(vtkIdType minMaxDegree[2], unsigned char* cellSelection);
155 
157 
163 
164 protected:
165  // The various templated data members
166  TIds LinksSize;
167  TIds NumPts;
168  TIds NumCells;
169 
170  // These point to the core data structures
171  TIds* Links; // contiguous runs of cell ids
172  TIds* Offsets; // offsets for each point into the links array
173 
174  // Support for execution
175  int Type;
177 
178 private:
180  void operator=(const vtkStaticCellLinksTemplate&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #include "vtkStaticCellLinksTemplate.txx"
185 
186 #endif
187 // VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
object to represent cell connectivity
Definition: vtkCellArray.h:297
abstract class to specify dataset behavior
Definition: vtkDataSet.h:174
structured grid with explicit topology and geometry
list of point or cell ids
Definition: vtkIdList.h:144
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
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.
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.
TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point specified by ptId.
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition: vtkABI.h:71
int vtkIdType
Definition: vtkType.h:326