VTK  9.2.6
vtkCPExodusIIResultsArrayTemplate.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCPExodusIIResultsArrayTemplate.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 
30 #ifndef vtkCPExodusIIResultsArrayTemplate_h
31 #define vtkCPExodusIIResultsArrayTemplate_h
32 
33 #include "vtkMappedDataArray.h"
34 
35 #include "vtkObjectFactory.h" // for vtkStandardNewMacro
36 
37 template <class Scalar>
39 {
40 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
47  typedef typename Superclass::ValueType ValueType;
48 
50 
56  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples);
57  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples, bool save);
59 
60  // Reimplemented virtuals -- see superclasses for descriptions:
61  void Initialize() override;
62  void GetTuples(vtkIdList* ptIds, vtkAbstractArray* output) override;
63  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
64  void Squeeze() override;
67  void LookupValue(vtkVariant value, vtkIdList* ids) override;
68  vtkVariant GetVariantValue(vtkIdType idx) override;
69  void ClearLookup() override;
70  double* GetTuple(vtkIdType i) override;
71  void GetTuple(vtkIdType i, double* tuple) override;
72  vtkIdType LookupTypedValue(Scalar value) override;
73  void LookupTypedValue(Scalar value, vtkIdList* ids) override;
74  ValueType GetValue(vtkIdType idx) const override;
75  ValueType& GetValueReference(vtkIdType idx) override;
76  void GetTypedTuple(vtkIdType idx, Scalar* t) const override;
77 
79 
83  vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext) override;
84  vtkTypeBool Resize(vtkIdType numTuples) override;
85  void SetNumberOfTuples(vtkIdType number) override;
86  void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source) override;
87  void SetTuple(vtkIdType i, const float* source) override;
88  void SetTuple(vtkIdType i, const double* source) override;
90  void InsertTuple(vtkIdType i, const float* source) override;
91  void InsertTuple(vtkIdType i, const double* source) override;
92  void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
94  vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
95  void InsertTuples(
96  vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override;
98  vtkIdType InsertNextTuple(const float* source) override;
99  vtkIdType InsertNextTuple(const double* source) override;
100  void DeepCopy(vtkAbstractArray* aa) override;
101  void DeepCopy(vtkDataArray* da) override;
102  void InterpolateTuple(
103  vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) override;
105  vtkAbstractArray* source2, double t) override;
106  void SetVariantValue(vtkIdType idx, vtkVariant value) override;
107  void InsertVariantValue(vtkIdType idx, vtkVariant value) override;
108  void RemoveTuple(vtkIdType id) override;
109  void RemoveFirstTuple() override;
110  void RemoveLastTuple() override;
111  void SetTypedTuple(vtkIdType i, const Scalar* t) override;
112  void InsertTypedTuple(vtkIdType i, const Scalar* t) override;
113  vtkIdType InsertNextTypedTuple(const Scalar* t) override;
114  void SetValue(vtkIdType idx, Scalar value) override;
115  vtkIdType InsertNextValue(Scalar v) override;
116  void InsertValue(vtkIdType idx, Scalar v) override;
118 
119 protected:
122 
123  std::vector<Scalar*> Arrays;
124 
125 private:
127  void operator=(const vtkCPExodusIIResultsArrayTemplate&) = delete;
128 
129  vtkIdType Lookup(const Scalar& val, vtkIdType startIndex);
130  double* TempDoubleArray;
132 
135  bool Save;
137 };
138 
139 #include "vtkCPExodusIIResultsArrayTemplate.txx"
140 
141 #endif // vtkCPExodusIIResultsArrayTemplate_h
142 
143 // VTK-HeaderTest-Exclude: vtkCPExodusIIResultsArrayTemplate.h
vtkVariant GetVariantValue(vtkIdType idx) override
Retrieve value from the array as a variant.
void RemoveFirstTuple() 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 InsertVariantValue(vtkIdType idx, vtkVariant value) override
This container is read only – this method does nothing but print a warning.
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples)
Set the arrays to be used and the number of tuples in each array.
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
Map non-contiguous data structures into the vtkDataArray API.
Abstract superclass for all arrays.
void DeepCopy(vtkAbstractArray *aa) 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 SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source) 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.
void RemoveTuple(vtkIdType id) override
This container is read only – this method does nothing but print a warning.
int vtkIdType
Definition: vtkType.h:332
void GetTypedTuple(vtkIdType idx, Scalar *t) const override
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext) override
This container is read only – this method does nothing but print a warning.
int vtkTypeBool
Definition: vtkABI.h:69
void SetVariantValue(vtkIdType idx, vtkVariant value) override
This container is read only – this method does nothing but print a warning.
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 InsertValue(vtkIdType idx, Scalar v) 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()
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
void InsertTypedTuple(vtkIdType i, const Scalar *t) override
This container is read only – this method does nothing but print a warning.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
double * GetTuple(vtkIdType i) override
Get the data tuple at tupleIdx.
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
void save(Archiver &ar, const std::string &str, const unsigned int vtkNotUsed(version))
vtkTypeBool Resize(vtkIdType numTuples) override
This container is read only – this method does nothing but print a warning.
Map native Exodus II results arrays into the vtkDataArray interface.
Abstract superclass to iterate over elements in an vtkAbstractArray.
ValueType GetValue(vtkIdType idx) const override
Get the data at a particular index.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
#define VTK_NEWINSTANCE
void SetNumberOfTuples(vtkIdType number) 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 SetTypedTuple(vtkIdType i, const Scalar *t) override
This container is read only – this method does nothing but print a warning.
ValueType & GetValueReference(vtkIdType idx) override
Get a reference to the scalar value at a particular index.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType InsertNextValue(Scalar v) override
This container is read only – this method does nothing but print a warning.
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkIdType LookupTypedValue(Scalar value) override
void Squeeze() override
Free any unnecessary memory.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
This container is read only – this method does nothing but print a warning.
#define vtkMappedDataArrayNewInstanceMacro(thisClass)
void SetValue(vtkIdType idx, Scalar value) override
This container is read only – this method does nothing but print a warning.