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
51class vtkDataSet;
52class vtkPolyData;
54class vtkCellArray;
55
56
57template <typename TIds>
59{
60public:
65 LinksSize(0), NumPts(0), NumCells(0), Links(NULL), Offsets(NULL)
66 {
67 }
68
73 {this->Initialize();}
74
78 virtual void Initialize();
79
83 virtual void BuildLinks(vtkDataSet *ds);
84
89
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
111protected:
112 // The various templated data members
114 TIds NumPts;
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
121private:
122 vtkStaticCellLinksTemplate(const vtkStaticCellLinksTemplate&) VTK_DELETE_FUNCTION;
123 void operator=(const vtkStaticCellLinksTemplate&) VTK_DELETE_FUNCTION;
124
125};
126
127#include "vtkStaticCellLinksTemplate.txx"
128
129#endif
130// VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
object to represent cell connectivity
Definition: vtkCellArray.h:51
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
object represents upward pointers from points to list of cells using each point (template implementat...
vtkStaticCellLinksTemplate()
Default constructor.
void BuildLinks(vtkUnstructuredGrid *ugrid)
Build the link list array for vtkUnstructuredGrid.
TIds GetNumberOfCells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
virtual void BuildLinks(vtkDataSet *ds)
Build the link list array.
void BuildLinks(vtkPolyData *pd)
Build the link list array for vtkPolyData.
virtual void Initialize()
Make sure any previously created links are cleaned up.
const TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point.
virtual ~vtkStaticCellLinksTemplate()
Virtual destructor, anticipating future subclassing.
dataset represents arbitrary combinations of all possible cell types
int vtkIdType
Definition: vtkType.h:287