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(nullptr), Offsets(nullptr)
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:
120  void operator=(const vtkStaticCellLinksTemplate&) = delete;
121 
122 };
123 
124 #include "vtkStaticCellLinksTemplate.txx"
125 
126 #endif
127 // VTK-HeaderTest-Exclude: vtkStaticCellLinksTemplate.h
vtkStaticCellLinksTemplate::NumCells
TIds NumCells
Definition: vtkStaticCellLinksTemplate.h:112
vtkStaticCellLinksTemplate::GetNumberOfCells
TIds GetNumberOfCells(vtkIdType ptId)
Get the number of cells using the point specified by ptId.
Definition: vtkStaticCellLinksTemplate.h:95
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkStaticCellLinksTemplate::vtkStaticCellLinksTemplate
vtkStaticCellLinksTemplate()
Default constructor.
Definition: vtkStaticCellLinksTemplate.h:61
vtkStaticCellLinksTemplate::Offsets
TIds * Offsets
Definition: vtkStaticCellLinksTemplate.h:116
vtkStaticCellLinksTemplate::LinksSize
TIds LinksSize
Definition: vtkStaticCellLinksTemplate.h:110
vtkStaticCellLinksTemplate
object represents upward pointers from points to list of cells using each point (template implementat...
Definition: vtkStaticCellLinksTemplate.h:55
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkStaticCellLinksTemplate::BuildLinks
virtual void BuildLinks(vtkDataSet *ds)
Build the link list array.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkStaticCellLinksTemplate::NumPts
TIds NumPts
Definition: vtkStaticCellLinksTemplate.h:111
vtkStaticCellLinksTemplate::~vtkStaticCellLinksTemplate
virtual ~vtkStaticCellLinksTemplate()
Virtual destructor, anticipating future subclassing.
Definition: vtkStaticCellLinksTemplate.h:69
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:79
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:81
vtkStaticCellLinksTemplate::GetCells
const TIds * GetCells(vtkIdType ptId)
Return a list of cell ids using the point.
Definition: vtkStaticCellLinksTemplate.h:103
vtkStaticCellLinksTemplate::Links
TIds * Links
Definition: vtkStaticCellLinksTemplate.h:115