VMTK
Loading...
Searching...
No Matches
vtkvmtkItems.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16=========================================================================*/
33
34#ifndef __vtkvmtkItems_h
35#define __vtkvmtkItems_h
36
37#include "vtkObject.h"
38#include "vtkvmtkItem.h"
39#include "vtkDataSet.h"
40//#include "vtkvmtkDifferentialGeometryWin32Header.h"
41#include "vtkvmtkWin32Header.h"
42
43class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkItems : public vtkObject
44{
45public:
46
47 vtkTypeMacro(vtkvmtkItems,vtkObject);
48
50
54 vtkSetMacro(ItemType,int);
55 vtkGetMacro(ItemType,int);
57
61 void Allocate(vtkIdType numItems, vtkIdType ext=1000);
62
66 vtkvmtkItem* GetItem(vtkIdType id) {return this->Array[id];};
67
69
73 void SetNumberOfItems(vtkIdType numberOfItems) { this->MaxId = numberOfItems - 1;};
74 vtkIdType GetNumberOfItems() {return this->MaxId + 1;};
76
80 void Squeeze();
81
85 void Reset();
86
90 void Initialize();
91
95 void ReleaseArray();
96
101 void AllocateItem(vtkIdType i, vtkIdType itemType);
102
106 void DeepCopy(vtkvmtkItems *src);
107
111 void ShallowCopy(vtkvmtkItems *src);
112
113protected:
114 vtkvmtkItems():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
116
117 virtual vtkvmtkItem* InstantiateNewItem(int itemType) = 0;
118
119 vtkvmtkItem** Array; // pointer to data
120 vtkIdType Size; // allocated size of data
121 vtkIdType MaxId; // maximum index inserted thus far
122 vtkIdType Extend; // grow array by this point
123 vtkvmtkItem** Resize(vtkIdType sz); // function to resize data
124
126
127private:
128 vtkvmtkItems(const vtkvmtkItems&); // Not implemented.
129 void operator=(const vtkvmtkItems&); // Not implemented.
130};
131
132#endif
133
Serves as the base class for constructing neighborhoods and stencils from a set of points.
Definition vtkvmtkItem.h:42
Control allocation and memory footprint of item instances.
vtkIdType Extend
vtkIdType Size
virtual vtkvmtkItem * InstantiateNewItem(int itemType)=0
vtkvmtkItem * GetItem(vtkIdType id)
void SetNumberOfItems(vtkIdType numberOfItems)
void Allocate(vtkIdType numItems, vtkIdType ext=1000)
vtkIdType GetNumberOfItems()
vtkvmtkItem ** Resize(vtkIdType sz)
vtkIdType MaxId
vtkvmtkItem ** Array