VTK  9.0.1
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 
48 class vtkDataSet;
49 class vtkPolyData;
52 class vtkCellArray;
53 
54 #include "vtkAbstractCellLinks.h"
55 
56 template <typename TIds>
58 {
59 public:
61 
67 
71  void Initialize();
72 
77  void BuildLinks(vtkDataSet* ds);
78 
82  void BuildLinks(vtkPolyData* pd);
83 
87  void BuildLinks(vtkUnstructuredGrid* ugrid);
88 
93 
97  void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray* cellArray);
98  void ThreadedBuildLinks(
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 
112  TIds* GetCells(vtkIdType ptId) { return (this->Links + this->Offsets[ptId]); }
113 
115 
118  unsigned long GetActualMemorySize();
119  void DeepCopy(vtkAbstractCellLinks* src);
121 
123 
129 
130 protected:
131  // The various templated data members
132  TIds LinksSize;
133  TIds NumPts;
134  TIds NumCells;
135 
136  // These point to the core data structures
137  TIds* Links; // contiguous runs of cell ids
138  TIds* Offsets; // offsets for each point into the links array
139 
140  // Support for execution
141  int Type;
143 
144 private:
146  void operator=(const vtkStaticCellLinksTemplate&) = delete;
147 };
148 
149 #include "vtkStaticCellLinksTemplate.txx"
150 
151 #endif
152 // 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.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point specified by ptId.
int vtkIdType
Definition: vtkType.h:338
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
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
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:179
structured grid with explicit topology and geometry
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.