VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Parallel
vtkCachingInterpolatedVelocityField.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkCachingInterpolatedVelocityField.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
=========================================================================*/
43
#ifndef __vtkTInterpolatedVelocityField_h
44
#define __vtkTInterpolatedVelocityField_h
45
46
#include "
vtkFunctionSet.h
"
47
#include "
vtkSmartPointer.h
"
// this is allowed
48
//BTX
49
#include <vtkstd/vector>
// we need them
50
//ETX
51
52
class
vtkDataSet
;
53
class
vtkDataArray
;
54
class
vtkPointData
;
55
class
vtkGenericCell
;
56
class
vtkAbstractCellLocator
;
57
//BTX
58
//---------------------------------------------------------------------------
59
class
IVFDataSetInfo
;
60
//---------------------------------------------------------------------------
61
class
IVFCacheList
:
public
vtkstd::vector
< IVFDataSetInfo > {};
62
//---------------------------------------------------------------------------
63
//ETX
64
class
VTK_PARALLEL_EXPORT
vtkCachingInterpolatedVelocityField
:
public
vtkFunctionSet
65
{
66
public
:
67
vtkTypeMacro(
vtkCachingInterpolatedVelocityField
,
vtkFunctionSet
);
68
virtual
void
PrintSelf
(ostream& os,
vtkIndent
indent);
69
72
static
vtkCachingInterpolatedVelocityField
*
New
();
73
75
77
virtual
int
FunctionValues
(
double
* x,
double
* f);
78
virtual
int
InsideTest(
double
* x);
80
82
virtual
void
SetDataSet(
int
I,
vtkDataSet
* dataset,
bool
staticdataset,
vtkAbstractCellLocator
*locator);
83
85
88
vtkGetStringMacro(VectorsSelection);
89
void
SelectVectors(
const
char
*fieldName)
90
{this->SetVectorsSelection(fieldName);}
92
94
void
SetLastCellInfo(
vtkIdType
c,
int
datasetindex);
95
98
void
ClearLastCellInfo();
99
101
104
int
GetLastWeights(
double
* w);
105
int
GetLastLocalCoordinates(
double
pcoords[3]);
107
109
110
vtkGetMacro(CellCacheHit,
int
);
111
vtkGetMacro(DataSetCacheHit,
int
);
112
vtkGetMacro(CacheMiss,
int
);
114
115
protected
:
116
vtkCachingInterpolatedVelocityField
();
117
~
vtkCachingInterpolatedVelocityField
();
118
119
vtkGenericCell
*
TempCell
;
120
int
CellCacheHit
;
121
int
DataSetCacheHit
;
122
int
CacheMiss
;
123
int
LastCacheIndex
;
124
int
LastCellId
;
125
IVFDataSetInfo
*
Cache
;
126
IVFCacheList
CacheList
;
127
char
*
VectorsSelection
;
128
//BTX
129
vtkstd::vector<double>
Weights
;
130
//ETX
131
132
vtkSetStringMacro(VectorsSelection);
133
134
// private versions which work on the passed dataset/cache
135
// these do the real computation
136
int
FunctionValues
(
IVFDataSetInfo
*cache,
double
*x,
double
*f);
137
int
InsideTest(
IVFDataSetInfo
*cache,
double
* x);
138
139
//BTX
140
friend
class
vtkTemporalInterpolatedVelocityField
;
142
146
void
FastCompute(
IVFDataSetInfo
*cache,
double
f[3]);
147
bool
InterpolatePoint
(
vtkPointData
*outPD,
vtkIdType
outIndex);
148
vtkGenericCell
*GetLastCell();
149
//ETX
151
152
private
:
153
vtkCachingInterpolatedVelocityField
(
const
vtkCachingInterpolatedVelocityField
&);
// Not implemented.
154
void
operator=(
const
vtkCachingInterpolatedVelocityField
&);
// Not implemented.
155
};
156
157
//---------------------------------------------------------------------------
158
160
// IVFDataSetInfo
162
#ifndef DOXYGEN_SHOULD_SKIP_THIS
163
//
164
//BTX
165
//
166
class
IVFDataSetInfo
167
{
168
public
:
169
vtkSmartPointer<vtkDataSet>
DataSet
;
170
vtkSmartPointer<vtkAbstractCellLocator>
BSPTree
;
171
vtkSmartPointer<vtkGenericCell>
Cell
;
172
double
PCoords
[3];
173
float
*
VelocityFloat
;
174
double
*
VelocityDouble
;
175
double
Tolerance
;
176
bool
StaticDataSet
;
177
IVFDataSetInfo
();
178
IVFDataSetInfo
(
const
IVFDataSetInfo
&ivfci);
179
IVFDataSetInfo
&
operator=
(
const
IVFDataSetInfo
&ivfci);
180
void
SetDataSet
(
vtkDataSet
*
data
,
char
*velocity,
bool
staticdataset,
vtkAbstractCellLocator
*locator);
181
//
182
static
const
double
TOLERANCE_SCALE
;
183
};
184
185
//
186
//ETX
187
//
188
189
#endif
/* DOXYGEN_SHOULD_SKIP_THIS */
190
191
#endif
Generated on Thu Mar 13 2014 08:10:24 for VTK by
1.8.1.2