VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Common
vtkTypedArray.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkTypedArray.h
5
6
-------------------------------------------------------------------------
7
Copyright 2008 Sandia Corporation.
8
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
the U.S. Government retains certain rights in this software.
10
-------------------------------------------------------------------------
11
12
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13
All rights reserved.
14
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15
16
This software is distributed WITHOUT ANY WARRANTY; without even
17
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18
PURPOSE. See the above copyright notice for more information.
19
20
=========================================================================*/
21
49
#ifndef __vtkTypedArray_h
50
#define __vtkTypedArray_h
51
52
#include "
vtkArray.h
"
53
#include "
vtkTypeTemplate.h
"
54
55
class
vtkArrayCoordinates
;
56
57
template
<
typename
T>
58
class
vtkTypedArray
:
public
vtkTypeTemplate
<vtkTypedArray<T>, vtkArray>
59
{
60
public
:
61
typedef
typename
vtkArray::CoordinateT
CoordinateT
;
62
typedef
typename
vtkArray::SizeT
SizeT
;
63
64
#if (defined(_MSC_VER) && _MSC_VER < 1400) || defined(__WRAP__)
65
vtkVariant
GetVariantValue
(
vtkIdType
i) {
return
this->
vtkArray::GetVariantValue
(i); }
66
vtkVariant
GetVariantValue
(
vtkIdType
i,
vtkIdType
j) {
return
this->
vtkArray::GetVariantValue
(i,j); }
67
vtkVariant
GetVariantValue
(
vtkIdType
i,
vtkIdType
j,
vtkIdType
k) {
return
this->
vtkArray::GetVariantValue
(i,j,k); }
68
void
SetVariantValue
(
vtkIdType
i,
const
vtkVariant
&
value
) { this->
vtkArray::SetVariantValue
(i, value); }
69
void
SetVariantValue
(
vtkIdType
i,
vtkIdType
j,
const
vtkVariant
&
value
) { this->
vtkArray::SetVariantValue
(i,j, value); }
70
void
SetVariantValue
(
vtkIdType
i,
vtkIdType
j,
vtkIdType
k,
const
vtkVariant
&
value
) { this->
vtkArray::SetVariantValue
(i,j,k, value); }
71
#else
72
using
vtkTypeTemplate<vtkTypedArray<T>
,
vtkArray
>
::GetVariantValue
;
73
using
vtkTypeTemplate<vtkTypedArray<T>
,
vtkArray
>
::SetVariantValue
;
74
#endif
75
76
void
PrintSelf
(ostream &os,
vtkIndent
indent);
77
78
// vtkArray API
79
virtual
vtkVariant
GetVariantValue
(
const
vtkArrayCoordinates
& coordinates);
80
virtual
vtkVariant
GetVariantValueN
(
const
SizeT
n);
81
virtual
void
SetVariantValue
(
const
vtkArrayCoordinates
& coordinates,
const
vtkVariant
&
value
);
82
virtual
void
SetVariantValueN
(
const
SizeT
n,
const
vtkVariant
&
value
);
83
virtual
void
CopyValue
(
vtkArray
*
source
,
const
vtkArrayCoordinates
& source_coordinates,
const
vtkArrayCoordinates
& target_coordinates);
84
virtual
void
CopyValue
(
vtkArray
*
source
,
const
SizeT
source_index,
const
vtkArrayCoordinates
& target_coordinates);
85
virtual
void
CopyValue
(
vtkArray
*
source
,
const
vtkArrayCoordinates
& source_coordinates,
const
SizeT
target_index);
86
88
91
virtual
const
T&
GetValue
(
CoordinateT
i) = 0;
92
virtual
const
T&
GetValue
(
CoordinateT
i,
CoordinateT
j) = 0;
93
virtual
const
T&
GetValue
(
CoordinateT
i,
CoordinateT
j,
CoordinateT
k) = 0;
94
virtual
const
T&
GetValue
(
const
vtkArrayCoordinates
& coordinates) = 0;
96
102
virtual
const
T&
GetValueN
(
const
SizeT
n) = 0;
103
105
108
virtual
void
SetValue
(
CoordinateT
i,
const
T&
value
) = 0;
109
virtual
void
SetValue
(
CoordinateT
i,
CoordinateT
j,
const
T&
value
) = 0;
110
virtual
void
SetValue
(
CoordinateT
i,
CoordinateT
j,
CoordinateT
k,
const
T&
value
) = 0;
111
virtual
void
SetValue
(
const
vtkArrayCoordinates
& coordinates,
const
T&
value
) = 0;
113
119
virtual
void
SetValueN
(
const
SizeT
n,
const
T&
value
) = 0;
120
121
protected
:
122
vtkTypedArray
() {}
123
~vtkTypedArray
() {}
124
125
private
:
126
vtkTypedArray
(
const
vtkTypedArray
&);
// Not implemented
127
void
operator=(
const
vtkTypedArray
&);
// Not implemented
128
};
129
130
#include "vtkTypedArray.txx"
131
132
#endif
133
Generated on Wed Nov 21 2012 21:33:40 for VTK by
1.8.2