VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Common
vtkVoidArray.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkVoidArray.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
=========================================================================*/
23
#ifndef __vtkVoidArray_h
24
#define __vtkVoidArray_h
25
26
#include "
vtkObject.h
"
27
28
class
VTK_COMMON_EXPORT
vtkVoidArray
:
public
vtkObject
29
{
30
public
:
32
static
vtkVoidArray
*
New
();
33
34
vtkTypeMacro(
vtkVoidArray
,
vtkObject
);
35
void
PrintSelf
(ostream& os,
vtkIndent
indent);
36
39
int
Allocate(
vtkIdType
sz,
vtkIdType
ext=1000);
40
42
void
Initialize();
43
45
int
GetDataType
() {
return
VTK_VOID
;}
46
48
int
GetDataTypeSize
() {
return
sizeof
(
void
*); }
49
51
52
void
SetNumberOfPointers
(
vtkIdType
number)
53
{this->Allocate(number); this->NumberOfPointers = number;}
55
57
58
vtkIdType
GetNumberOfPointers
()
59
{
return
this->NumberOfPointers;}
61
63
64
void
*
GetVoidPointer
(
vtkIdType
id
)
65
{
return
this->Array[id];}
67
69
70
void
SetVoidPointer
(
vtkIdType
id
,
void
* ptr)
71
{this->Array[id] = ptr;}
73
76
void
InsertVoidPointer(
vtkIdType
i,
void
* ptr);
77
80
vtkIdType
InsertNextVoidPointer(
void
* tuple);
81
83
85
void
Reset
()
86
{this->NumberOfPointers = 0;}
88
90
92
void
Squeeze
()
93
{this->ResizeAndExtend (this->NumberOfPointers);}
95
98
void
**
GetPointer
(
vtkIdType
id
) {
return
this->Array + id;}
99
103
void
** WritePointer(
vtkIdType
id
,
vtkIdType
number);
104
106
void
DeepCopy(
vtkVoidArray
*va);
107
108
protected
:
109
vtkVoidArray
();
110
~
vtkVoidArray
();
111
112
vtkIdType
NumberOfPointers
;
113
vtkIdType
Size
;
114
void
**
Array
;
// pointer to data
115
116
void
** ResizeAndExtend(
vtkIdType
sz);
// function to resize data
117
118
private
:
119
vtkVoidArray
(
const
vtkVoidArray
&);
// Not implemented.
120
void
operator=(
const
vtkVoidArray
&);
// Not implemented.
121
};
122
123
124
#endif
Generated on Fri Aug 2 2013 12:19:47 for VTK by
1.8.4