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 
29 #ifndef vtkCPExodusIIResultsArrayTemplate_h
30 #define vtkCPExodusIIResultsArrayTemplate_h
31 
32 #include "vtkMappedDataArray.h"
33 
34 #include "vtkTypeTemplate.h" // For templated vtkObject API
35 #include "vtkObjectFactory.h" // for vtkStandardNewMacro
36 
37 template <class Scalar>
39  public vtkTypeTemplate<vtkCPExodusIIResultsArrayTemplate<Scalar>,
40  vtkMappedDataArray<Scalar> >
41 {
42 public:
45  virtual void PrintSelf(ostream &os, vtkIndent indent);
46 
48 
52  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples);
53  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples, bool save);
55 
56  // Reimplemented virtuals -- see superclasses for descriptions:
57  void Initialize();
58  void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
59  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output);
60  void Squeeze();
63  void LookupValue(vtkVariant value, vtkIdList *ids);
65  void ClearLookup();
66  double* GetTuple(vtkIdType i);
67  void GetTuple(vtkIdType i, double *tuple);
68  vtkIdType LookupTypedValue(Scalar value);
69  void LookupTypedValue(Scalar value, vtkIdList *ids);
70  Scalar GetValue(vtkIdType idx);
71  Scalar& GetValueReference(vtkIdType idx);
72  void GetTupleValue(vtkIdType idx, Scalar *t);
73 
75 
77  int Allocate(vtkIdType sz, vtkIdType ext);
78  int Resize(vtkIdType numTuples);
79  void SetNumberOfTuples(vtkIdType number);
81  void SetTuple(vtkIdType i, const float *source);
82  void SetTuple(vtkIdType i, const double *source);
83  void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
84  void InsertTuple(vtkIdType i, const float *source);
85  void InsertTuple(vtkIdType i, const double *source);
86  void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
87  vtkAbstractArray *source);
88  void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
89  vtkAbstractArray* source);
91  vtkIdType InsertNextTuple(const float *source);
92  vtkIdType InsertNextTuple(const double *source);
93  void DeepCopy(vtkAbstractArray *aa);
94  void DeepCopy(vtkDataArray *da);
95  void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
96  vtkAbstractArray* source, double* weights);
98  vtkIdType id2, vtkAbstractArray *source2, double t);
99  void SetVariantValue(vtkIdType idx, vtkVariant value);
100  void RemoveTuple(vtkIdType id);
101  void RemoveFirstTuple();
102  void RemoveLastTuple();
103  void SetTupleValue(vtkIdType i, const Scalar *t);
104  void InsertTupleValue(vtkIdType i, const Scalar *t);
105  vtkIdType InsertNextTupleValue(const Scalar *t);
106  void SetValue(vtkIdType idx, Scalar value);
107  vtkIdType InsertNextValue(Scalar v);
108  void InsertValue(vtkIdType idx, Scalar v);
110 
111 protected:
114 
115  std::vector<Scalar *> Arrays;
116 
117 private:
119  void operator=(const vtkCPExodusIIResultsArrayTemplate &); // Not implemented.
120 
121  vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
122  double *TempDoubleArray;
124 
125  bool Save;
126 };
128 
129 #include "vtkCPExodusIIResultsArrayTemplate.txx"
130 
131 #endif //vtkCPExodusIIResultsArrayTemplate_h
132 
133 // VTK-HeaderTest-Exclude: vtkCPExodusIIResultsArrayTemplate.h
Provides the equivalent of vtkTypeMacro for use with template classes.
void SetNumberOfTuples(vtkIdType number)
double * GetTuple(vtkIdType i)
vtkVariant GetVariantValue(vtkIdType idx)
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples)
Abstract superclass for all arrays.
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source)
void SetVariantValue(vtkIdType idx, vtkVariant value)
int vtkIdType
Definition: vtkType.h:275
int Allocate(vtkIdType sz, vtkIdType ext)
vtkIdType InsertNextTupleValue(const Scalar *t)
A atomic type representing the union of many types.
Definition: vtkVariant.h:78
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights)
int Resize(vtkIdType numTuples)
void InsertTupleValue(vtkIdType i, const Scalar *t)
void SetValue(vtkIdType idx, Scalar value)
a simple class to control print indentation
Definition: vtkIndent.h:38
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
vtkIdType LookupValue(vtkVariant value)
void DeepCopy(vtkAbstractArray *aa)
list of point or cell ids
Definition: vtkIdList.h:35
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.
void GetTupleValue(vtkIdType idx, Scalar *t)
vtkMappedDataArrayNewInstanceMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >) static vtkCPExodusIIResultsArrayTemplate *New()
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
Scalar GetValue(vtkIdType idx)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void InsertValue(vtkIdType idx, Scalar v)
vtkIdType InsertNextValue(Scalar v)
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source)
static vtkObject * New()
vtkArrayIterator * NewIterator()
vtkIdType LookupTypedValue(Scalar value)
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output)
void SetTupleValue(vtkIdType i, const Scalar *t)
Scalar & GetValueReference(vtkIdType idx)