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::GetActualMemorySize
unsigned long GetActualMemorySize()
Support vtkAbstractCellLinks API.
vtkStaticCellLinksTemplate::NumCells
TIds NumCells
Definition: vtkStaticCellLinksTemplate.h:134
vtkStaticCellLinksTemplate::~vtkStaticCellLinksTemplate
~vtkStaticCellLinksTemplate()
vtkStaticCellLinksTemplate::GetNumberOfCells
TIds GetNumberOfCells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
Definition: vtkStaticCellLinksTemplate.h:105
vtkStaticCellLinksTemplate::GetSequentialProcessing
vtkTypeBool GetSequentialProcessing()
Definition: vtkStaticCellLinksTemplate.h:127
vtkStaticCellLinksTemplate::Type
int Type
Definition: vtkStaticCellLinksTemplate.h:141
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkStaticCellLinksTemplate::vtkStaticCellLinksTemplate
vtkStaticCellLinksTemplate()
Instantiate and destructor methods.
vtkStaticCellLinksTemplate::Offsets
TIds * Offsets
Definition: vtkStaticCellLinksTemplate.h:138
vtkStaticCellLinksTemplate::GetCells
TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point specified by ptId.
Definition: vtkStaticCellLinksTemplate.h:112
vtkStaticCellLinksTemplate::ThreadedBuildLinks
void ThreadedBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray *cellArray)
vtkStaticCellLinksTemplate::LinksSize
TIds LinksSize
Definition: vtkStaticCellLinksTemplate.h:132
vtkStaticCellLinksTemplate
object represents upward pointers from points to list of cells using each point (template implementat...
Definition: vtkStaticCellLinksTemplate.h:57
vtkStaticCellLinksTemplate::GetNcells
vtkIdType GetNcells(vtkIdType ptId)
Definition: vtkStaticCellLinksTemplate.h:106
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:179
vtkStaticCellLinksTemplate::SetSequentialProcessing
void SetSequentialProcessing(vtkTypeBool seq)
Control whether to thread or serial process.
Definition: vtkStaticCellLinksTemplate.h:126
vtkStaticCellLinksTemplate::BuildLinks
void BuildLinks(vtkDataSet *ds)
Build the link list array for a general dataset.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkStaticCellLinksTemplate::NumPts
TIds NumPts
Definition: vtkStaticCellLinksTemplate.h:133
vtkStaticCellLinksTemplate::DeepCopy
void DeepCopy(vtkAbstractCellLinks *src)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkExplicitStructuredGrid
structured grid with explicit topology and geometry
Definition: vtkExplicitStructuredGrid.h:62
vtkStaticCellLinksTemplate::SerialBuildLinks
void SerialBuildLinks(const vtkIdType numPts, const vtkIdType numCells, vtkCellArray *cellArray)
Specialized methods for building links from cell array.
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:92
vtkStaticCellLinksTemplate::Initialize
void Initialize()
Make sure any previously created links are cleaned up.
vtkStaticCellLinksTemplate::SequentialProcessing
vtkTypeBool SequentialProcessing
Definition: vtkStaticCellLinksTemplate.h:142
vtkStaticCellLinksTemplate::Links
TIds * Links
Definition: vtkStaticCellLinksTemplate.h:137
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69