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::NumCells
TIds NumCells
Definition: vtkStaticCellLinksTemplate.h:115
vtkStaticCellLinksTemplate::GetNumberOfCells
TIds GetNumberOfCells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
Definition: vtkStaticCellLinksTemplate.h:98
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkStaticCellLinksTemplate::vtkStaticCellLinksTemplate
vtkStaticCellLinksTemplate()
Default constructor.
Definition: vtkStaticCellLinksTemplate.h:64
vtkStaticCellLinksTemplate::Offsets
TIds * Offsets
Definition: vtkStaticCellLinksTemplate.h:119
vtkStaticCellLinksTemplate::LinksSize
TIds LinksSize
Definition: vtkStaticCellLinksTemplate.h:113
vtkStaticCellLinksTemplate
object represents upward pointers from points to list of cells using each point (template implementat...
Definition: vtkStaticCellLinksTemplate.h:58
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkStaticCellLinksTemplate::BuildLinks
virtual void BuildLinks(vtkDataSet *ds)
Build the link list array.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkStaticCellLinksTemplate::NumPts
TIds NumPts
Definition: vtkStaticCellLinksTemplate.h:114
vtkStaticCellLinksTemplate::~vtkStaticCellLinksTemplate
virtual ~vtkStaticCellLinksTemplate()
Virtual destructor, anticipating future subclassing.
Definition: vtkStaticCellLinksTemplate.h:72
vtkStaticCellLinksTemplate::Initialize
virtual void Initialize()
Make sure any previously created links are cleaned up.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:87
vtkStaticCellLinksTemplate::GetCells
const TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point.
Definition: vtkStaticCellLinksTemplate.h:106
vtkStaticCellLinksTemplate::Links
TIds * Links
Definition: vtkStaticCellLinksTemplate.h:118