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 =========================================================================*/
45 #ifndef vtkStaticCellLinksTemplate_h
46 #define vtkStaticCellLinksTemplate_h
47 
48 class vtkDataSet;
49 class vtkPolyData;
51 class vtkCellArray;
52 
53 
54 template <typename TIds>
56 {
57 public:
62  LinksSize(0), NumPts(0), NumCells(0), Links(NULL), Offsets(NULL)
63  {
64  }
65 
70  {this->Initialize();}
71 
75  virtual void Initialize();
76 
80  virtual void BuildLinks(vtkDataSet *ds);
81 
85  void BuildLinks(vtkPolyData *pd);
86 
90  void BuildLinks(vtkUnstructuredGrid *ugrid);
91 
96  {
97  return (this->Offsets[ptId+1] - this->Offsets[ptId]);
98  }
99 
103  const TIds *GetCells(vtkIdType ptId)
104  {
105  return this->Links + this->Offsets[ptId];
106  }
107 
108 protected:
109  // The various templated data members
110  TIds LinksSize;
111  TIds NumPts;
112  TIds NumCells;
113 
114  // These point to the core data structures
115  TIds *Links; //contiguous runs of cell ids
116  TIds *Offsets; //offsets for each point into the link array
117 
118 private:
119  vtkStaticCellLinksTemplate(const vtkStaticCellLinksTemplate&) VTK_DELETE_FUNCTION;
120  void operator=(const vtkStaticCellLinksTemplate&) VTK_DELETE_FUNCTION;
121 
122 };
123 
124 #include "vtkStaticCellLinksTemplate.txx"
125 
126 #endif
127 // 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:56
const TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point.
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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:44