~ubuntu-branches/ubuntu/karmic/paraview/karmic

« back to all changes in this revision

Viewing changes to VTK/Common/vtkUnsignedLongArray.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2008-06-15 22:04:41 UTC
  • Revision ID: james.westby@ubuntu.com-20080615220441-8us51vf6ra2umcov
Tags: upstream-3.2.2
ImportĀ upstreamĀ versionĀ 3.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Visualization Toolkit
 
4
  Module:    $RCSfile: vtkUnsignedLongArray.h,v $
 
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
=========================================================================*/
 
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.
 
20
 
 
21
#ifndef __vtkUnsignedLongArray_h
 
22
#define __vtkUnsignedLongArray_h
 
23
 
 
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
 
27
#endif
 
28
 
 
29
#include "vtkDataArray.h"
 
30
#include "vtkDataArrayTemplate.h" // Real Superclass
 
31
 
 
32
// Fake the superclass for the wrappers.
 
33
#define vtkDataArray vtkDataArrayTemplate<unsigned long>
 
34
class VTK_COMMON_EXPORT vtkUnsignedLongArray : public vtkDataArray
 
35
#undef vtkDataArray
 
36
{
 
37
public:
 
38
  static vtkUnsignedLongArray* New();
 
39
  vtkTypeRevisionMacro(vtkUnsignedLongArray,vtkDataArray);
 
40
  void PrintSelf(ostream& os, vtkIndent indent);
 
41
 
 
42
  // Description:
 
43
  // Get the data type.
 
44
  int GetDataType()
 
45
    { return VTK_UNSIGNED_LONG; }
 
46
 
 
47
  // Description:
 
48
  // Copy the tuple value into a user-provided array.
 
49
  void GetTupleValue(vtkIdType i, unsigned long* tuple)
 
50
    { this->RealSuperclass::GetTupleValue(i, tuple); }
 
51
 
 
52
  // Description:
 
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); }
 
56
 
 
57
  // Description:
 
58
  // Insert (memory allocation performed) the tuple into the ith location
 
59
  // in the array.
 
60
  void InsertTupleValue(vtkIdType i, const unsigned long* tuple)
 
61
    { this->RealSuperclass::InsertTupleValue(i, tuple); }
 
62
 
 
63
  // Description:
 
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); }
 
67
 
 
68
  // Description:
 
69
  // Get the data at a particular index.
 
70
  unsigned long GetValue(vtkIdType id)
 
71
    { return this->RealSuperclass::GetValue(id); }
 
72
 
 
73
  // Description:
 
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); }
 
78
 
 
79
  // Description:
 
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); }
 
85
 
 
86
  // Description:
 
87
  // Insert data at a specified position in the array.
 
88
  void InsertValue(vtkIdType id, unsigned long f)
 
89
    { this->RealSuperclass::InsertValue(id, f); }
 
90
 
 
91
  // Description:
 
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); }
 
95
 
 
96
  // Description:
 
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); }
 
102
 
 
103
  // Description:
 
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); }
 
108
 
 
109
  // Description:
 
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); }
 
120
 
 
121
protected:
 
122
  vtkUnsignedLongArray(vtkIdType numComp=1);
 
123
  ~vtkUnsignedLongArray();
 
124
 
 
125
private:
 
126
  //BTX
 
127
  typedef vtkDataArrayTemplate<unsigned long> RealSuperclass;
 
128
  //ETX
 
129
  vtkUnsignedLongArray(const vtkUnsignedLongArray&);  // Not implemented.
 
130
  void operator=(const vtkUnsignedLongArray&);  // Not implemented.
 
131
};
 
132
 
 
133
#endif