VTK  9.1.0
vtkPeriodicDataArray.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPeriodicDataArray.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=========================================================================*/
15
29#ifndef vtkPeriodicDataArray_h
30#define vtkPeriodicDataArray_h
31
32#include "vtkAOSDataArrayTemplate.h" // Template
33#include "vtkGenericDataArray.h" // Parent
34
35template <class Scalar>
36class vtkPeriodicDataArray : public vtkGenericDataArray<vtkPeriodicDataArray<Scalar>, Scalar>
37{
39
40public:
42 typedef typename Superclass::ValueType ValueType;
43
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50
54 void Initialize() override;
55
59 void GetTuples(vtkIdList* ptIds, vtkAbstractArray* output) override;
60
64 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
65
69 void Squeeze() override;
70
75
80
84 void LookupValue(vtkVariant value, vtkIdList* ids) override;
85
90
94 void ClearLookup() override;
95
100 double* GetTuple(vtkIdType i) override;
101
105 void GetTuple(vtkIdType i, double* tuple) override;
106
111
115 void LookupTypedValue(Scalar value, vtkIdList* ids) override;
116
123
130
134 void GetTypedTuple(vtkIdType idx, Scalar* t) const;
135
141 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const;
142
146 unsigned long GetActualMemorySize() const override;
147
152
156 vtkTypeBool Resize(vtkIdType numTuples) override;
157
161 void SetNumberOfTuples(vtkIdType number) override;
162
167
171 void SetTuple(vtkIdType i, const float* source) override;
172
176 void SetTuple(vtkIdType i, const double* source) override;
177
182
186 void InsertTuple(vtkIdType i, const float* source) override;
187
191 void InsertTuple(vtkIdType i, const double* source) override;
192
196 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
197
202 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override;
203
208
212 vtkIdType InsertNextTuple(const float* source) override;
213
217 vtkIdType InsertNextTuple(const double* source) override;
218
222 void DeepCopy(vtkAbstractArray* aa) override;
223
227 void DeepCopy(vtkDataArray* da) override;
228
233 vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) override;
234
239 vtkAbstractArray* source2, double t) override;
240
245
250
254 void RemoveTuple(vtkIdType id) override;
255
259 void RemoveFirstTuple() override;
260
264 void RemoveLastTuple() override;
265
269 void SetTypedTuple(vtkIdType i, const Scalar* t);
270
274 void SetTypedComponent(vtkIdType t, int c, Scalar v);
275
279 void InsertTypedTuple(vtkIdType i, const Scalar* t);
280
285
289 void SetValue(vtkIdType idx, Scalar value);
290
295
299 void InsertValue(vtkIdType idx, Scalar v);
300
302
305 vtkSetMacro(Normalize, bool);
306 vtkGetMacro(Normalize, bool);
308
309protected:
312
314
317 bool AllocateTuples(vtkIdType numTuples);
320
324 virtual void Transform(Scalar* tuple) const = 0;
325
329 bool ComputeScalarRange(double* range) override;
330
334 bool ComputeVectorRange(double range[2]) override;
335
339 virtual void ComputePeriodicRange();
340
345
346 bool Normalize; // If transformed vector must be normalized
347
348private:
350 void operator=(const vtkPeriodicDataArray&) = delete;
351
352 friend class vtkGenericDataArray<vtkPeriodicDataArray<Scalar>, Scalar>;
353
354 Scalar* TempScalarArray; // Temporary array used by GetTypedTuple methods
355 double* TempDoubleArray; // Temporary array used by GetTuple vethods
356 vtkIdType TempTupleIdx; // Location of currently stored Temp Tuple to use as cache
357 vtkAOSDataArrayTemplate<Scalar>* Data; // Original data
358
359 bool InvalidRange;
360 double PeriodicRange[6]; // Transformed periodic range
361};
362
363#include "vtkPeriodicDataArray.txx"
364
365#endif // vtkPeriodicDataArray_h
366// VTK-HeaderTest-Exclude: vtkPeriodicDataArray.h
Abstract superclass for all arrays.
Abstract superclass to iterate over elements in an vtkAbstractArray.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
Base interface for all typed vtkDataArray subclasses.
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
Map native an Array into an angulat periodic array.
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) override
Copy tuples from id p1 to id p2 included into provided array.
void InsertTypedTuple(vtkIdType i, const Scalar *t)
Read only container, not supported.
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output) override
Copy tuples values, selected by ptIds into provided array.
void SetTuple(vtkIdType i, const double *source) override
Read only container, not supported.
virtual void ComputePeriodicRange()
Update the transformed periodic range.
bool AllocateTuples(vtkIdType numTuples)
Read only container, not supported.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext) override
Read only container, not supported.
void ClearLookup() override
Not implemented.
vtkTemplateTypeMacro(vtkPeriodicDataArray< Scalar >, GenericBase)
vtkIdType InsertNextTuple(const double *source) override
Read only container, not supported.
unsigned long GetActualMemorySize() const override
Return the memory in kilobytes consumed by this data array.
vtkIdType LookupTypedValue(Scalar value) override
Not implemented.
void SetNumberOfTuples(vtkIdType number) override
Read only container, not supported.
bool ComputeScalarRange(double *range) override
Get the transformed range by components.
void LookupValue(vtkVariant value, vtkIdList *ids) override
Not implemented.
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source) override
Read only container, error.
void RemoveTuple(vtkIdType id) override
Read only container, not supported.
vtkArrayIterator * NewIterator() override
Not implemented.
void SetValue(vtkIdType idx, Scalar value)
Read only container, not supported.
void DeepCopy(vtkAbstractArray *aa) override
Read only container, not supported.
void InsertVariantValue(vtkIdType idx, vtkVariant value) override
Read only container, not supported.
ValueType & GetValueReference(vtkIdType idx)
Get value at index idx as reference.
vtkIdType InsertNextTypedTuple(const Scalar *t)
Read only container, not supported.
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
Read only container, not supported.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
Read only container, not supported.
void LookupTypedValue(Scalar value, vtkIdList *ids) override
Not implemented.
void GetTypedTuple(vtkIdType idx, Scalar *t) const
Copy tuple value at location idx into provided array.
void SetTuple(vtkIdType i, const float *source) override
Read only container, not supported.
void SetTypedComponent(vtkIdType t, int c, Scalar v)
Read only container, not supported.
bool ReallocateTuples(vtkIdType numTuples)
Read only container, not supported.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
Read only container, not supported.
vtkTypeBool Resize(vtkIdType numTuples) override
Read only container, not supported.
vtkVariant GetVariantValue(vtkIdType idx) override
Not implemented.
virtual void Transform(Scalar *tuple) const =0
Transform the provided tuple.
void InitializeArray(vtkAOSDataArrayTemplate< Scalar > *inputData)
Initialize the mapped array with the original input data array.
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
Return the requested component of the specified tuple.
void RemoveLastTuple() override
Read only container, not supported.
void SetVariantValue(vtkIdType idx, vtkVariant value) override
Read only container, not supported.
void Squeeze() override
No effect.
bool ComputeVectorRange(double range[2]) override
Get the transformed range on all components.
vtkIdType InsertNextValue(Scalar v)
Read only container, not supported.
void InvalidateRange()
Set the invalid range flag to false.
void InsertTuple(vtkIdType i, const float *source) override
Read only container, not supported.
void RemoveFirstTuple() override
Read only container, not supported.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
Read only container, not supported.
void InsertTuple(vtkIdType i, const double *source) override
Read only container, not supported.
void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
Read only container, not supported.
void DeepCopy(vtkDataArray *da) override
Read only container, not supported.
ValueType GetValue(vtkIdType idx) const
Get value at index idx.
void Initialize() override
Initialize array with zero values.
void GetTuple(vtkIdType i, double *tuple) override
Copy tuple at location i into user provided array.
void SetTypedTuple(vtkIdType i, const Scalar *t)
Read only container, not supported.
void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t) override
Read only container, not supported.
void InsertValue(vtkIdType idx, Scalar v)
Read only container, not supported.
vtkIdType LookupValue(vtkVariant value) override
Not implemented.
Superclass::ValueType ValueType
~vtkPeriodicDataArray() override
vtkIdType InsertNextTuple(const float *source) override
Read only container, not supported.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetTuple(vtkIdType i) override
Return tuple at location i.
A atomic type representing the union of many types.
Definition: vtkVariant.h:145
@ value
Definition: vtkX3D.h:226
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int vtkIdType
Definition: vtkType.h:332
#define VTK_NEWINSTANCE