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 =========================================================================*/
48 #ifndef vtkStaticCellLinksTemplate_h
49 #define vtkStaticCellLinksTemplate_h
50 
51 class vtkDataSet;
52 class vtkPolyData;
55 class vtkCellArray;
56 
57 #include "vtkAbstractCellLinks.h"
58 
59 template <typename TIds>
61 {
62 public:
64 
70 
74  void Initialize();
75 
80  void BuildLinks(vtkDataSet* ds);
81 
85  void BuildLinks(vtkPolyData* pd);
86 
90  void BuildLinks(vtkUnstructuredGrid* ugrid);
91 
96 
100  void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
101  void ThreadedBuildLinks(
102  const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
103 
105 
108  TIds GetNumberOfCells(vtkIdType ptId) { return (this->Offsets[ptId + 1] - this->Offsets[ptId]); }
109  vtkIdType GetNcells(vtkIdType ptId) { return (this->Offsets[ptId + 1] - this->Offsets[ptId]); }
111 
116  template <typename TGivenIds>
117  bool MatchesCell(TGivenIds npts, const TGivenIds* pts);
118 
122  TIds* GetCells(vtkIdType ptId) { return (this->Links + this->Offsets[ptId]); }
123 
128  void GetCells(vtkIdType npts, const vtkIdType* pts, vtkIdList* cells);
129 
134  TIds GetLinksSize() { return this->LinksSize; }
135 
140  TIds GetOffset(vtkIdType ptId) { return this->Offsets[ptId]; }
141 
143 
146  unsigned long GetActualMemorySize();
147  void DeepCopy(vtkAbstractCellLinks* src);
148  void SelectCells(vtkIdType minMaxDegree[2], unsigned char* cellSelection);
150 
152 
158 
159 protected:
160  // The various templated data members
161  TIds LinksSize;
162  TIds NumPts;
163  TIds NumCells;
164 
165  // These point to the core data structures
166  TIds* Links; // contiguous runs of cell ids
167  TIds* Offsets; // offsets for each point into the links array
168 
169  // Support for execution
170  int Type;
172 
173 private:
175  void operator=(const vtkStaticCellLinksTemplate&) = delete;
176 };
177 
178 #include "vtkStaticCellLinksTemplate.txx"
179 
180 #endif
181 // VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
vtkStaticCellLinksTemplate()
Instantiate and destructor methods.
object represents upward pointers from points to list of cells using each point (template implementat...
TIds GetNumberOfCells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
vtkTypeBool GetSequentialProcessing()
Control whether to thread or serial process.
~vtkStaticCellLinksTemplate()
Instantiate and destructor methods.
void SelectCells(vtkIdType minMaxDegree[2], unsigned char *cellSelection)
Support vtkAbstractCellLinks API.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
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.
int vtkIdType
Definition: vtkType.h:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
unsigned long GetActualMemorySize()
Support vtkAbstractCellLinks API.
void BuildLinks(vtkDataSet *ds)
Build the link list array for a general dataset.
int vtkTypeBool
Definition: vtkABI.h:69
bool MatchesCell(TGivenIds npts, const TGivenIds *pts)
Indicate whether the point ids provided defines at least one cell, or a portion of a cell...
list of point or cell ids
Definition: vtkIdList.h:33
dataset represents arbitrary combinations of all possible cell types
void SetSequentialProcessing(vtkTypeBool seq)
Control whether to thread or serial process.
vtkIdType GetNcells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
void DeepCopy(vtkAbstractCellLinks *src)
Support vtkAbstractCellLinks API.
object to represent cell connectivity
Definition: vtkCellArray.h:186
structured grid with explicit topology and geometry
TIds GetLinksSize()
Return the total number of links represented after the links have been built.
void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray *cellArray)
Specialized methods for building links from cell array.
void ThreadedBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray *cellArray)
void Initialize()
Make sure any previously created links are cleaned up.