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 =========================================================================*/
47 #ifndef vtkStaticCellLinksTemplate_h
48 #define vtkStaticCellLinksTemplate_h
49 
50 class vtkDataSet;
51 class vtkPolyData;
53 class vtkCellArray;
54 
55 
56 template <typename TIds>
58 {
59 public:
61 
63  LinksSize(0), NumPts(0), NumCells(0), Links(NULL), Offsets(NULL)
64  {
65  }
67 
69 
71  {this->Initialize();}
73 
75  virtual void Initialize();
76 
78  virtual void BuildLinks(vtkDataSet *ds);
79 
81  void BuildLinks(vtkPolyData *pd);
82 
84  void BuildLinks(vtkUnstructuredGrid *ugrid);
85 
87 
89  {
90  return (this->Offsets[ptId+1] - this->Offsets[ptId]);
91  }
93 
95 
96  const TIds *GetCells(vtkIdType ptId)
97  {
98  return this->Links + this->Offsets[ptId];
99  }
101 
102 protected:
103  // The various templated data members
104  TIds LinksSize;
105  TIds NumPts;
106  TIds NumCells;
107 
108  // These point to the core data structures
109  TIds *Links; //contiguous runs of cell ids
110  TIds *Offsets; //offsets for each point into the link array
111 
112 private:
113  vtkStaticCellLinksTemplate(const vtkStaticCellLinksTemplate&); // Not implemented.
114  void operator=(const vtkStaticCellLinksTemplate&); // Not implemented.
115 
116 };
117 
118 #include "vtkStaticCellLinksTemplate.txx"
119 
120 #endif
121 // VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
object represents upward pointers from points to list of cells using each point (template implementat...
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
const TIds * GetCells(vtkIdType ptId)
int vtkIdType
Definition: vtkType.h:247
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
virtual void BuildLinks(vtkDataSet *ds)
dataset represents arbitrary combinations of all possible cell types
object to represent cell connectivity
Definition: vtkCellArray.h:49