VTK  9.1.0
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 
27 #ifndef vtkCPExodusIIResultsArrayTemplate_h
28 #define vtkCPExodusIIResultsArrayTemplate_h
29 
30 #include "vtkMappedDataArray.h"
31 
32 #include "vtkObjectFactory.h" // for vtkStandardNewMacro
33 
34 template <class Scalar>
36 {
37 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  typedef typename Superclass::ValueType ValueType;
45 
47 
53  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples);
54  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples, bool save);
56 
57  // Reimplemented virtuals -- see superclasses for descriptions:
58  void Initialize() override;
59  void GetTuples(vtkIdList* ptIds, vtkAbstractArray* output) override;
60  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
61  void Squeeze() override;
64  void LookupValue(vtkVariant value, vtkIdList* ids) override;
66  void ClearLookup() override;
67  double* GetTuple(vtkIdType i) override;
68  void GetTuple(vtkIdType i, double* tuple) override;
69  vtkIdType LookupTypedValue(Scalar value) override;
70  void LookupTypedValue(Scalar value, vtkIdList* ids) override;
71  ValueType GetValue(vtkIdType idx) const override;
73  void GetTypedTuple(vtkIdType idx, Scalar* t) const override;
74 
76 
81  vtkTypeBool Resize(vtkIdType numTuples) override;
82  void SetNumberOfTuples(vtkIdType number) override;
84  void SetTuple(vtkIdType i, const float* source) override;
85  void SetTuple(vtkIdType i, const double* source) override;
87  void InsertTuple(vtkIdType i, const float* source) override;
88  void InsertTuple(vtkIdType i, const double* source) override;
89  void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
91  vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override;
93  vtkIdType InsertNextTuple(const float* source) override;
94  vtkIdType InsertNextTuple(const double* source) override;
95  void DeepCopy(vtkAbstractArray* aa) override;
96  void DeepCopy(vtkDataArray* da) override;
98  vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) override;
100  vtkAbstractArray* source2, double t) override;
103  void RemoveTuple(vtkIdType id) override;
104  void RemoveFirstTuple() override;
105  void RemoveLastTuple() override;
106  void SetTypedTuple(vtkIdType i, const Scalar* t) override;
107  void InsertTypedTuple(vtkIdType i, const Scalar* t) override;
108  vtkIdType InsertNextTypedTuple(const Scalar* t) override;
109  void SetValue(vtkIdType idx, Scalar value) override;
110  vtkIdType InsertNextValue(Scalar v) override;
111  void InsertValue(vtkIdType idx, Scalar v) override;
113 
114 protected:
117 
118  std::vector<Scalar*> Arrays;
119 
120 private:
122  void operator=(const vtkCPExodusIIResultsArrayTemplate&) = delete;
123 
124  vtkIdType Lookup(const Scalar& val, vtkIdType startIndex);
125  double* TempDoubleArray;
127 
130  bool Save;
132 };
133 
134 #include "vtkCPExodusIIResultsArrayTemplate.txx"
135 
136 #endif // vtkCPExodusIIResultsArrayTemplate_h
137 
138 // 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.
ValueType & GetValueReference(vtkIdType idx) override
Get a reference to the scalar value at a particular index.
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 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.
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
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.
double * GetTuple(vtkIdType i) override
Get the data tuple at tupleIdx.
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.
void SetTuple(vtkIdType i, const double *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.
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
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
Definition: vtkDataArray.h:50
vtkGenericDataArrayLookupHelper< SelfType > Lookup
list of point or cell ids
Definition: vtkIdList.h:31
a simple class to control print indentation
Definition: vtkIndent.h:34
Map non-contiguous data structures into the vtkDataArray API.
Superclass::ValueType ValueType
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
A atomic type representing the union of many types.
Definition: vtkVariant.h:66
@ value
Definition: vtkX3D.h:226
int vtkTypeBool
Definition: vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#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