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 
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  virtual void PrintSelf(ostream &os, vtkIndent indent);
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();
62  void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
63  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output);
64  void Squeeze();
69  void ClearLookup();
70  double* GetTuple(vtkIdType i);
71  void GetTuple(vtkIdType i, double *tuple);
73  void LookupTypedValue(Scalar value, vtkIdList *ids);
74  ValueType GetValue(vtkIdType idx) const;
75  ValueType& GetValueReference(vtkIdType idx);
76  void GetTypedTuple(vtkIdType idx, Scalar *t) const;
77 
79 
83  int Allocate(vtkIdType sz, vtkIdType ext);
84  int Resize(vtkIdType numTuples);
85  void SetNumberOfTuples(vtkIdType number);
87  void SetTuple(vtkIdType i, const float *source);
88  void SetTuple(vtkIdType i, const double *source);
90  void InsertTuple(vtkIdType i, const float *source);
91  void InsertTuple(vtkIdType i, const double *source);
92  void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
94  void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
97  vtkIdType InsertNextTuple(const float *source);
98  vtkIdType InsertNextTuple(const double *source);
99  void DeepCopy(vtkAbstractArray *aa);
100  void DeepCopy(vtkDataArray *da);
101  void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
102  vtkAbstractArray* source, double* weights);
104  vtkIdType id2, vtkAbstractArray *source2, double t);
107  void RemoveTuple(vtkIdType id);
108  void RemoveFirstTuple();
109  void RemoveLastTuple();
110  void SetTypedTuple(vtkIdType i, const Scalar *t);
111  void InsertTypedTuple(vtkIdType i, const Scalar *t);
112  vtkIdType InsertNextTypedTuple(const Scalar *t);
113  void SetValue(vtkIdType idx, Scalar value);
114  vtkIdType InsertNextValue(Scalar v);
115  void InsertValue(vtkIdType idx, Scalar v);
117 
118 protected:
121 
122  std::vector<Scalar *> Arrays;
123 
124 private:
126  void operator=(const vtkCPExodusIIResultsArrayTemplate &) VTK_DELETE_FUNCTION;
127 
128  vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
129  double *TempDoubleArray;
131 
134  bool Save;
135 };
137 
138 #include "vtkCPExodusIIResultsArrayTemplate.txx"
139 
140 #endif //vtkCPExodusIIResultsArrayTemplate_h
141 
142 // VTK-HeaderTest-Exclude: vtkCPExodusIIResultsArrayTemplate.h
void InsertVariantValue(vtkIdType idx, vtkVariant value)
This container is read only – this method does nothing but print a warning.
void SetNumberOfTuples(vtkIdType number)
This container is read only – this method does nothing but print a warning.
ValueType GetValue(vtkIdType idx) const
Get the data at a particular index.
void SetTypedTuple(vtkIdType i, const Scalar *t)
This container is read only – this method does nothing but print a warning.
double * GetTuple(vtkIdType i)
Get the data tuple at tupleIdx.
vtkVariant GetVariantValue(vtkIdType idx)
Retrieve value from the array as a variant.
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples)
Set the arrays to be used and the number of tuples in each array.
Map non-contiguous data structures into the vtkDataArray API.
Abstract superclass for all arrays.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source)
This container is read only – this method does nothing but print a warning.
void SetVariantValue(vtkIdType idx, vtkVariant value)
This container is read only – this method does nothing but print a warning.
int vtkIdType
Definition: vtkType.h:287
int Allocate(vtkIdType sz, vtkIdType ext)
This container is read only – this method does nothing but print a warning.
#define vtkMappedDataArrayNewInstanceMacro(thisClass)
void InsertTypedTuple(vtkIdType i, const Scalar *t)
This container is read only – this method does nothing but print a warning.
void GetTypedTuple(vtkIdType idx, Scalar *t) const
Copy the tuple value into a user-provided array.
A atomic type representing the union of many types.
Definition: vtkVariant.h:75
ValueType & GetValueReference(vtkIdType idx)
Get a reference to the scalar value at a particular index.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
This container is read only – this method does nothing but print a warning.
void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights)
This container is read only – this method does nothing but print a warning.
int Resize(vtkIdType numTuples)
This container is read only – this method does nothing but print a warning.
void Squeeze()
Free any unnecessary memory.
void SetValue(vtkIdType idx, Scalar value)
This container is read only – this method does nothing but print a warning.
void Initialize()
Release storage and reset array to initial state.
vtkAbstractTemplateTypeMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >, vtkMappedDataArray< Scalar >) vtkMappedDataArrayNewInstanceMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >) static vtkCPExodusIIResultsArrayTemplate *New()
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
This container is read only – this method does nothing but print a warning.
vtkIdType LookupValue(vtkVariant value)
Return the value indices where a specific value appears.
void DeepCopy(vtkAbstractArray *aa)
This container is read only – this method does nothing but print a warning.
list of point or cell ids
Definition: vtkIdList.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
Map native Exodus II results arrays into the vtkDataArray interface.
Abstract superclass to iterate over elements in an vtkAbstractArray.
#define VTK_NEWINSTANCE
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void InsertValue(vtkIdType idx, Scalar v)
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextValue(Scalar v)
This container is read only – this method does nothing but print a warning.
void RemoveTuple(vtkIdType id)
This container is read only – this method does nothing but print a warning.
void RemoveLastTuple()
This container is read only – this method does nothing but print a warning.
VTK_NEWINSTANCE vtkArrayIterator * NewIterator()
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source)
This container is read only – this method does nothing but print a warning.
vtkIdType InsertNextTypedTuple(const Scalar *t)
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...
void RemoveFirstTuple()
This container is read only – this method does nothing but print a warning.
vtkIdType LookupTypedValue(Scalar value)
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output)
Given a list of tuple ids, return an array of tuples.
void ClearLookup()
Delete the associated fast lookup data structure on this array, if it exists.