VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
47  void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples);
48 
49  // Reimplemented virtuals -- see superclasses for descriptions:
50  void Initialize();
51  void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
52  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output);
53  void Squeeze();
56  void LookupValue(vtkVariant value, vtkIdList *ids);
58  void ClearLookup();
59  double* GetTuple(vtkIdType i);
60  void GetTuple(vtkIdType i, double *tuple);
61  vtkIdType LookupTypedValue(Scalar value);
62  void LookupTypedValue(Scalar value, vtkIdList *ids);
63  Scalar GetValue(vtkIdType idx);
64  Scalar& GetValueReference(vtkIdType idx);
65  void GetTupleValue(vtkIdType idx, Scalar *t);
66 
68 
70  int Allocate(vtkIdType sz, vtkIdType ext);
71  int Resize(vtkIdType numTuples);
72  void SetNumberOfTuples(vtkIdType number);
74  void SetTuple(vtkIdType i, const float *source);
75  void SetTuple(vtkIdType i, const double *source);
76  void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
77  void InsertTuple(vtkIdType i, const float *source);
78  void InsertTuple(vtkIdType i, const double *source);
79  void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
80  vtkAbstractArray *source);
82  vtkIdType InsertNextTuple(const float *source);
83  vtkIdType InsertNextTuple(const double *source);
84  void DeepCopy(vtkAbstractArray *aa);
85  void DeepCopy(vtkDataArray *da);
86  void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
87  vtkAbstractArray* source, double* weights);
89  vtkIdType id2, vtkAbstractArray *source2, double t);
90  void SetVariantValue(vtkIdType idx, vtkVariant value);
91  void RemoveTuple(vtkIdType id);
92  void RemoveFirstTuple();
93  void RemoveLastTuple();
94  void SetTupleValue(vtkIdType i, const Scalar *t);
95  void InsertTupleValue(vtkIdType i, const Scalar *t);
96  vtkIdType InsertNextTupleValue(const Scalar *t);
97  void SetValue(vtkIdType idx, Scalar value);
98  vtkIdType InsertNextValue(Scalar v);
99  void InsertValue(vtkIdType idx, Scalar v);
101 
102 protected:
105 
106  std::vector<Scalar *> Arrays;
107 
108 private:
110  void operator=(const vtkCPExodusIIResultsArrayTemplate &); // Not implemented.
111 
112  vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
113  double *TempDoubleArray;
114 };
115 
116 #include "vtkCPExodusIIResultsArrayTemplate.txx"
117 
118 #endif //__vtkCPExodusIIResultsArrayTemplate_h
119 
120 // 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)
const GLdouble * v
Definition: vtkgl.h:11595
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)
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
int vtkIdType
Definition: vtkType.h:268
int Allocate(vtkIdType sz, vtkIdType ext)
GLdouble GLdouble t
Definition: vtkgl.h:11602
GLuint * ids
Definition: vtkgl.h:11831
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)
const GLbyte * weights
Definition: vtkgl.h:12766
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:53
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()
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)
const GLuint * arrays
Definition: vtkgl.h:13636
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output)
void SetTupleValue(vtkIdType i, const Scalar *t)
GLuint GLfloat * val
Definition: vtkgl.h:13789
Scalar & GetValueReference(vtkIdType idx)