VTK  9.4.20250309
vtkCPExodusIIResultsArrayTemplate.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
15#ifndef vtkCPExodusIIResultsArrayTemplate_h
16#define vtkCPExodusIIResultsArrayTemplate_h
17
18#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_5_0
19#include "vtkMappedDataArray.h"
20
21#include "vtkObjectFactory.h" // for vtkStandardNewMacro
22
23VTK_ABI_NAMESPACE_BEGIN
24template <class Scalar>
25class VTK_DEPRECATED_IN_9_5_0("Please use the SetArray functionality of `vtkAOSDataArrayTemplate` "
26 "for 1 component or `vtkSOADataArrayTemplate` for more "
28 : public vtkMappedDataArray<Scalar>
29{
30public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
37 typedef typename Superclass::ValueType ValueType;
38
40
46 void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples);
47 void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples, bool save);
49
50 // Reimplemented virtuals -- see superclasses for descriptions:
51 void Initialize() override;
52 void GetTuples(vtkIdList* ptIds, vtkAbstractArray* output) override;
53 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
54 void Squeeze() override;
57 void LookupValue(vtkVariant value, vtkIdList* ids) override;
59 void ClearLookup() override;
60 double* GetTuple(vtkIdType i) override;
61 void GetTuple(vtkIdType i, double* tuple) override;
62 vtkIdType LookupTypedValue(Scalar value) override;
63 void LookupTypedValue(Scalar value, vtkIdList* ids) override;
64 ValueType GetValue(vtkIdType idx) const override;
66 void GetTypedTuple(vtkIdType idx, Scalar* t) const override;
67
69
74 vtkTypeBool Resize(vtkIdType numTuples) override;
75 void SetNumberOfTuples(vtkIdType number) override;
77 void SetTuple(vtkIdType i, const float* source) override;
78 void SetTuple(vtkIdType i, const double* source) override;
80 void InsertTuple(vtkIdType i, const float* source) override;
81 void InsertTuple(vtkIdType i, const double* source) override;
82 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
84 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
86 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override;
88 vtkIdType InsertNextTuple(const float* source) override;
89 vtkIdType InsertNextTuple(const double* source) override;
90 void DeepCopy(vtkAbstractArray* aa) override;
91 void DeepCopy(vtkDataArray* da) override;
93 vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) override;
95 vtkAbstractArray* source2, double t) override;
96 void SetVariantValue(vtkIdType idx, vtkVariant value) override;
97 void InsertVariantValue(vtkIdType idx, vtkVariant value) override;
98 void RemoveTuple(vtkIdType id) override;
99 void RemoveFirstTuple() override;
100 void RemoveLastTuple() override;
101 void SetTypedTuple(vtkIdType i, const Scalar* t) override;
102 void InsertTypedTuple(vtkIdType i, const Scalar* t) override;
103 vtkIdType InsertNextTypedTuple(const Scalar* t) override;
104 void SetValue(vtkIdType idx, Scalar value) override;
105 vtkIdType InsertNextValue(Scalar v) override;
106 void InsertValue(vtkIdType idx, Scalar v) override;
108
109protected:
112
113 std::vector<Scalar*> Arrays;
114
115private:
117 void operator=(const vtkCPExodusIIResultsArrayTemplate&) = delete;
118
119 vtkIdType Lookup(const Scalar& val, vtkIdType startIndex);
120 double* TempDoubleArray;
122
125 bool Save;
127};
128
129VTK_ABI_NAMESPACE_END
130#include "vtkCPExodusIIResultsArrayTemplate.txx"
131
132#endif // vtkCPExodusIIResultsArrayTemplate_h
133
134// VTK-HeaderTest-Exclude: vtkCPExodusIIResultsArrayTemplate.h
Abstract superclass for all arrays.
Abstract superclass to iterate over elements in an vtkAbstractArray.
Map native Exodus II results arrays into the vtkDataArray interface.
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
vtkTypeBool Resize(vtkIdType numTuples) override
This container is read only – this method does nothing but print a warning.
void GetTypedTuple(vtkIdType idx, Scalar *t) const override
void SetNumberOfTuples(vtkIdType number) override
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
vtkAbstractTemplateTypeMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >, vtkMappedDataArray< Scalar >) vtkMappedDataArrayNewInstanceMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >) static vtkCPExodusIIResultsArrayTemplate *New()
ValueType GetValue(vtkIdType idx) const override
Get the data at a particular index.
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) override
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
This container is read only – this method does nothing but print a warning.
void InsertTuple(vtkIdType i, const double *source) override
This container is read only – this method does nothing but print a warning.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
void InsertVariantValue(vtkIdType idx, vtkVariant value) override
This container is read only – this method does nothing but print a warning.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
void LookupTypedValue(Scalar value, vtkIdList *ids) override
void SetTypedTuple(vtkIdType i, const Scalar *t) override
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextTypedTuple(const Scalar *t) override
This container is read only – this method does nothing but print a warning.
void InsertTuple(vtkIdType i, const float *source) override
This container is read only – this method does nothing but print a warning.
void Squeeze() override
Free any unnecessary memory.
void SetValue(vtkIdType idx, Scalar value) override
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextTuple(const double *source) override
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextTuple(const float *source) override
This container is read only – this method does nothing but print a warning.
void SetVariantValue(vtkIdType idx, vtkVariant value) override
This container is read only – this method does nothing but print a warning.
void DeepCopy(vtkDataArray *da) override
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextValue(Scalar v) override
This container is read only – this method does nothing but print a warning.
void GetTuple(vtkIdType i, double *tuple) override
Get the data tuple at tupleIdx by filling in a user-provided array, Make sure that your array is larg...
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
vtkVariant GetVariantValue(vtkIdType idx) override
Retrieve value from the array as a variant.
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
void SetTuple(vtkIdType i, const double *source) override
This container is read only – this method does nothing but print a warning.
double * GetTuple(vtkIdType i) override
Get the data tuple at tupleIdx.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext) override
This container is read only – this method does nothing but print a warning.
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples, bool save)
Set the arrays to be used and the number of tuples in each array.
void SetTuple(vtkIdType i, const float *source) override
This container is read only – this method does nothing but print a warning.
void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t) override
This container is read only – this method does nothing but print a warning.
void RemoveLastTuple() override
This container is read only – this method does nothing but print a warning.
vtkIdType LookupTypedValue(Scalar value) override
ValueType & GetValueReference(vtkIdType idx) override
Get a reference to the scalar value at a particular index.
void RemoveFirstTuple() override
This container is read only – this method does nothing but print a warning.
void InsertTypedTuple(vtkIdType i, const Scalar *t) override
This container is read only – this method does nothing but print a warning.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
void LookupValue(vtkVariant value, vtkIdList *ids) override
Return the value indices where a specific value appears.
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples)
Set the arrays to be used and the number of tuples in each array.
void RemoveTuple(vtkIdType id) override
This container is read only – this method does nothing but print a warning.
void Initialize() override
Release storage and reset array to initial state.
void InsertValue(vtkIdType idx, Scalar v) override
This container is read only – this method does nothing but print a warning.
void DeepCopy(vtkAbstractArray *aa) override
This container is read only – this method does nothing but print a warning.
abstract superclass for arrays of numeric data
vtkGenericDataArrayLookupHelper< SelfType > Lookup
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
Map non-contiguous data structures into the vtkDataArray API.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
A type representing the union of many types.
Definition vtkVariant.h:162
int vtkTypeBool
Definition vtkABI.h:64
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_DEPRECATED_IN_9_5_0(reason)
#define vtkMappedDataArrayNewInstanceMacro(thisClass)
int vtkIdType
Definition vtkType.h:332
void save(Archiver &ar, const std::string &str, const unsigned int vtkNotUsed(version))
#define VTK_NEWINSTANCE