VTK
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) VTK_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() VTK_OVERRIDE;
59  void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output) VTK_OVERRIDE;
60  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) VTK_OVERRIDE;
61  void Squeeze() VTK_OVERRIDE;
63  vtkIdType LookupValue(vtkVariant value) VTK_OVERRIDE;
64  void LookupValue(vtkVariant value, vtkIdList *ids) VTK_OVERRIDE;
65  vtkVariant GetVariantValue(vtkIdType idx) VTK_OVERRIDE;
66  void ClearLookup() VTK_OVERRIDE;
67  double* GetTuple(vtkIdType i) VTK_OVERRIDE;
68  void GetTuple(vtkIdType i, double *tuple) VTK_OVERRIDE;
69  vtkIdType LookupTypedValue(Scalar value) VTK_OVERRIDE;
70  void LookupTypedValue(Scalar value, vtkIdList *ids) VTK_OVERRIDE;
71  ValueType GetValue(vtkIdType idx) const VTK_OVERRIDE;
72  ValueType& GetValueReference(vtkIdType idx) VTK_OVERRIDE;
73  void GetTypedTuple(vtkIdType idx, Scalar *t) const VTK_OVERRIDE;
74 
76 
80  int Allocate(vtkIdType sz, vtkIdType ext) VTK_OVERRIDE;
81  int Resize(vtkIdType numTuples) VTK_OVERRIDE;
82  void SetNumberOfTuples(vtkIdType number) VTK_OVERRIDE;
83  void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) VTK_OVERRIDE;
84  void SetTuple(vtkIdType i, const float *source) VTK_OVERRIDE;
85  void SetTuple(vtkIdType i, const double *source) VTK_OVERRIDE;
86  void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) VTK_OVERRIDE;
87  void InsertTuple(vtkIdType i, const float *source) VTK_OVERRIDE;
88  void InsertTuple(vtkIdType i, const double *source) VTK_OVERRIDE;
89  void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
90  vtkAbstractArray *source) VTK_OVERRIDE;
91  void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
92  vtkAbstractArray* source) VTK_OVERRIDE;
94  vtkIdType InsertNextTuple(const float *source) VTK_OVERRIDE;
95  vtkIdType InsertNextTuple(const double *source) VTK_OVERRIDE;
96  void DeepCopy(vtkAbstractArray *aa) VTK_OVERRIDE;
97  void DeepCopy(vtkDataArray *da) VTK_OVERRIDE;
98  void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
99  vtkAbstractArray* source, double* weights) VTK_OVERRIDE;
101  vtkIdType id2, vtkAbstractArray *source2, double t) VTK_OVERRIDE;
102  void SetVariantValue(vtkIdType idx, vtkVariant value) VTK_OVERRIDE;
103  void InsertVariantValue(vtkIdType idx, vtkVariant value) VTK_OVERRIDE;
104  void RemoveTuple(vtkIdType id) VTK_OVERRIDE;
105  void RemoveFirstTuple() VTK_OVERRIDE;
106  void RemoveLastTuple() VTK_OVERRIDE;
107  void SetTypedTuple(vtkIdType i, const Scalar *t) VTK_OVERRIDE;
108  void InsertTypedTuple(vtkIdType i, const Scalar *t) VTK_OVERRIDE;
109  vtkIdType InsertNextTypedTuple(const Scalar *t) VTK_OVERRIDE;
110  void SetValue(vtkIdType idx, Scalar value) VTK_OVERRIDE;
111  vtkIdType InsertNextValue(Scalar v) VTK_OVERRIDE;
112  void InsertValue(vtkIdType idx, Scalar v) VTK_OVERRIDE;
114 
115 protected:
117  ~vtkCPExodusIIResultsArrayTemplate() VTK_OVERRIDE;
118 
119  std::vector<Scalar *> Arrays;
120 
121 private:
122  vtkCPExodusIIResultsArrayTemplate(const vtkCPExodusIIResultsArrayTemplate &) VTK_DELETE_FUNCTION;
123  void operator=(const vtkCPExodusIIResultsArrayTemplate &) VTK_DELETE_FUNCTION;
124 
125  vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
126  double *TempDoubleArray;
128 
131  bool Save;
132 };
134 
135 #include "vtkCPExodusIIResultsArrayTemplate.txx"
136 
137 #endif //vtkCPExodusIIResultsArrayTemplate_h
138 
139 // 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 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.
ValueType GetValue(vtkIdType idx) const override
Get the data at a particular index.
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:345
#define vtkMappedDataArrayNewInstanceMacro(thisClass)
VTK_NEWINSTANCE vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
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.
int Allocate(vtkIdType sz, vtkIdType ext) override
This container is read only – this method does nothing but print a warning.
void GetTypedTuple(vtkIdType idx, Scalar *t) const override
Copy the tuple value into a user-provided array.
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:33
void SetExodusScalarArrays(std::vector< Scalar *> arrays, vtkIdType numTuples)
Set the arrays to be used and the number of tuples in each array.
list of point or cell ids
Definition: vtkIdList.h:30
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:48
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.
Map native Exodus II results arrays into the vtkDataArray interface.
Abstract superclass to iterate over elements in an vtkAbstractArray.
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
#define VTK_NEWINSTANCE
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
void SetNumberOfTuples(vtkIdType number) override
This container is read only – this method does nothing but print a warning.
boost::graph_traits< vtkGraph *>::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int Resize(vtkIdType numTuples) 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.
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.
void SetValue(vtkIdType idx, Scalar value) override
This container is read only – this method does nothing but print a warning.