1
/*=========================================================================
3
Program: Visualization Toolkit
4
Module: $RCSfile: vtkUnsignedLongArray.h,v $
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
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.
14
=========================================================================*/
15
// .NAME vtkUnsignedLongArray - dynamic, self-adjusting array of unsigned long
16
// .SECTION Description
17
// vtkUnsignedLongArray is an array of values of type unsigned long.
18
// It provides methods for insertion and retrieval of values and will
19
// automatically resize itself to hold new data.
21
#ifndef __vtkUnsignedLongArray_h
22
#define __vtkUnsignedLongArray_h
24
// Tell the template header how to give our superclass a DLL interface.
25
#if !defined(__vtkUnsignedLongArray_cxx)
26
# define VTK_DATA_ARRAY_TEMPLATE_TYPE unsigned long
29
#include "vtkDataArray.h"
30
#include "vtkDataArrayTemplate.h" // Real Superclass
32
// Fake the superclass for the wrappers.
33
#define vtkDataArray vtkDataArrayTemplate<unsigned long>
34
class VTK_COMMON_EXPORT vtkUnsignedLongArray : public vtkDataArray
38
static vtkUnsignedLongArray* New();
39
vtkTypeRevisionMacro(vtkUnsignedLongArray,vtkDataArray);
40
void PrintSelf(ostream& os, vtkIndent indent);
45
{ return VTK_UNSIGNED_LONG; }
48
// Copy the tuple value into a user-provided array.
49
void GetTupleValue(vtkIdType i, unsigned long* tuple)
50
{ this->RealSuperclass::GetTupleValue(i, tuple); }
53
// Set the tuple value at the ith location in the array.
54
void SetTupleValue(vtkIdType i, const unsigned long* tuple)
55
{ this->RealSuperclass::SetTupleValue(i, tuple); }
58
// Insert (memory allocation performed) the tuple into the ith location
60
void InsertTupleValue(vtkIdType i, const unsigned long* tuple)
61
{ this->RealSuperclass::InsertTupleValue(i, tuple); }
64
// Insert (memory allocation performed) the tuple onto the end of the array.
65
vtkIdType InsertNextTupleValue(const unsigned long* tuple)
66
{ return this->RealSuperclass::InsertNextTupleValue(tuple); }
69
// Get the data at a particular index.
70
unsigned long GetValue(vtkIdType id)
71
{ return this->RealSuperclass::GetValue(id); }
74
// Set the data at a particular index. Does not do range checking. Make sure
75
// you use the method SetNumberOfValues() before inserting data.
76
void SetValue(vtkIdType id, unsigned long value)
77
{ this->RealSuperclass::SetValue(id, value); }
80
// Specify the number of values for this object to hold. Does an
81
// allocation as well as setting the MaxId ivar. Used in conjunction with
82
// SetValue() method for fast insertion.
83
void SetNumberOfValues(vtkIdType number)
84
{ this->RealSuperclass::SetNumberOfValues(number); }
87
// Insert data at a specified position in the array.
88
void InsertValue(vtkIdType id, unsigned long f)
89
{ this->RealSuperclass::InsertValue(id, f); }
92
// Insert data at the end of the array. Return its location in the array.
93
vtkIdType InsertNextValue(unsigned long f)
94
{ return this->RealSuperclass::InsertNextValue(f); }
97
// Get the address of a particular data index. Make sure data is allocated
98
// for the number of items requested. Set MaxId according to the number of
99
// data values requested.
100
unsigned long* WritePointer(vtkIdType id, vtkIdType number)
101
{ return this->RealSuperclass::WritePointer(id, number); }
104
// Get the address of a particular data index. Performs no checks
105
// to verify that the memory has been allocated etc.
106
unsigned long* GetPointer(vtkIdType id)
107
{ return this->RealSuperclass::GetPointer(id); }
110
// This method lets the user specify data to be held by the array. The
111
// array argument is a pointer to the data. size is the size of
112
// the array supplied by the user. Set save to 1 to keep the class
113
// from deleting the array when it cleans up or reallocates memory.
114
// The class uses the actual array provided; it does not copy the data
115
// from the suppled array.
116
void SetArray(unsigned long* array, vtkIdType size, int save)
117
{ this->RealSuperclass::SetArray(array, size, save); }
118
void SetArray(unsigned long* array, vtkIdType size, int save, int deleteMethod)
119
{ this->RealSuperclass::SetArray(array, size, save, deleteMethod); }
122
vtkUnsignedLongArray(vtkIdType numComp=1);
123
~vtkUnsignedLongArray();
127
typedef vtkDataArrayTemplate<unsigned long> RealSuperclass;
129
vtkUnsignedLongArray(const vtkUnsignedLongArray&); // Not implemented.
130
void operator=(const vtkUnsignedLongArray&); // Not implemented.