VTK
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;
54 class vtkCellArray;
55 
56 
57 template <typename TIds>
59 {
60 public:
65  LinksSize(0), NumPts(0), NumCells(0), Links(nullptr), Offsets(nullptr)
66  {
67  }
68 
73  {this->Initialize();}
74 
78  virtual void Initialize();
79 
83  virtual void BuildLinks(vtkDataSet *ds);
84 
88  void BuildLinks(vtkPolyData *pd);
89 
93  void BuildLinks(vtkUnstructuredGrid *ugrid);
94 
99  {
100  return (this->Offsets[ptId+1] - this->Offsets[ptId]);
101  }
102 
106  const TIds *GetCells(vtkIdType ptId)
107  {
108  return this->Links + this->Offsets[ptId];
109  }
110 
111 protected:
112  // The various templated data members
113  TIds LinksSize;
114  TIds NumPts;
115  TIds NumCells;
116 
117  // These point to the core data structures
118  TIds *Links; //contiguous runs of cell ids
119  TIds *Offsets; //offsets for each point into the link array
120 
121 private:
123  void operator=(const vtkStaticCellLinksTemplate&) = delete;
124 
125 };
126 
127 #include "vtkStaticCellLinksTemplate.txx"
128 
129 #endif
130 // VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
vtkStaticCellLinksTemplate()
Default constructor.
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.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
const TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point.
int vtkIdType
Definition: vtkType.h:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
virtual void BuildLinks(vtkDataSet *ds)
Build the link list array.
virtual void Initialize()
Make sure any previously created links are cleaned up.
dataset represents arbitrary combinations of all possible cell types
virtual ~vtkStaticCellLinksTemplate()
Virtual destructor, anticipating future subclassing.
object to represent cell connectivity
Definition: vtkCellArray.h:50