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);
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);
76  void GetTypedTuple(vtkIdType idx, Scalar *t) const;
77 
79 
84  int Resize(vtkIdType numTuples);
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,
102  vtkAbstractArray* source, double* weights);
104  vtkIdType id2, vtkAbstractArray *source2, double t);
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);
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
vtkCPExodusIIResultsArrayTemplate::SetTuple
void SetTuple(vtkIdType i, const float *source)
Set the data tuple at tupleIdx.
vtkCPExodusIIResultsArrayTemplate::InsertNextValue
vtkIdType InsertNextValue(Scalar v)
Insert data at the end of the array.
vtkCPExodusIIResultsArrayTemplate::InterpolateTuple
void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t)
Insert the tuple at dstTupleIdx in this array to the tuple interpolated from the two tuple indices,...
vtkCPExodusIIResultsArrayTemplate::Squeeze
void Squeeze()
Free any unnecessary memory.
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkCPExodusIIResultsArrayTemplate::InsertNextTypedTuple
vtkIdType InsertNextTypedTuple(const Scalar *t)
Insert (memory allocation performed) the tuple onto the end of the array.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
save
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
Definition: vtkVariantBoostSerialization.h:65
vtkCPExodusIIResultsArrayTemplate::LookupTypedValue
vtkIdType LookupTypedValue(Scalar value)
vtkCPExodusIIResultsArrayTemplate::InsertTypedTuple
void InsertTypedTuple(vtkIdType i, const Scalar *t)
Insert (memory allocation performed) the tuple into the ith location in the array.
vtkCPExodusIIResultsArrayTemplate::GetTypedTuple
void GetTypedTuple(vtkIdType idx, Scalar *t) const
Copy the tuple value into a user-provided array.
vtkCPExodusIIResultsArrayTemplate::GetValue
ValueType GetValue(vtkIdType idx) const
Get the data at a particular index.
vtkCPExodusIIResultsArrayTemplate::RemoveTuple
void RemoveTuple(vtkIdType id)
These methods remove tuples from the data array.
vtkObjectFactory.h
vtkMappedDataArray.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkCPExodusIIResultsArrayTemplate::SetExodusScalarArrays
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples, bool save)
vtkCPExodusIIResultsArrayTemplate::Arrays
std::vector< Scalar * > Arrays
Definition: vtkCPExodusIIResultsArrayTemplate.h:122
vtkCPExodusIIResultsArrayTemplate::GetTuple
void GetTuple(vtkIdType i, double *tuple)
Get the data tuple at tupleIdx by filling in a user-provided array, Make sure that your array is larg...
vtkMappedDataArray
Map non-contiguous data structures into the vtkDataArray API.
Definition: vtkMappedDataArray.h:42
vtkGenericDataArray< vtkTypedDataArray< Scalar >, Scalar >::Lookup
vtkGenericDataArrayLookupHelper< SelfType > Lookup
Definition: vtkGenericDataArray.h:324
vtkMappedDataArrayNewInstanceMacro
#define vtkMappedDataArrayNewInstanceMacro(thisClass)
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:822
vtkCPExodusIIResultsArrayTemplate::LookupValue
void LookupValue(vtkVariant value, vtkIdList *ids)
vtkCPExodusIIResultsArrayTemplate::Allocate
int Allocate(vtkIdType sz, vtkIdType ext)
This container is read only – this method does nothing but print a warning.
vtkCPExodusIIResultsArrayTemplate::InsertTuple
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
vtkCPExodusIIResultsArrayTemplate::RemoveLastTuple
void RemoveLastTuple()
vtkCPExodusIIResultsArrayTemplate::InsertVariantValue
void InsertVariantValue(vtkIdType idx, vtkVariant value)
Insert a value into the array from a variant.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCPExodusIIResultsArrayTemplate::GetTuples
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output)
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
vtkCPExodusIIResultsArrayTemplate::InsertTuples
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source)
Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in t...
vtkCPExodusIIResultsArrayTemplate::ValueType
Superclass::ValueType ValueType
Definition: vtkCPExodusIIResultsArrayTemplate.h:47
vtkCPExodusIIResultsArrayTemplate::InsertTuples
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source)
Copy n consecutive tuples starting at srcStart from the source array to this array,...
vtkCPExodusIIResultsArrayTemplate::SetNumberOfTuples
void SetNumberOfTuples(vtkIdType number)
Set the number of tuples (a component group) in the array.
vtkCPExodusIIResultsArrayTemplate::InsertTuple
void InsertTuple(vtkIdType i, const double *source)
vtkCPExodusIIResultsArrayTemplate::SetTuple
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
Set the tuple at dstTupleIdx in this array to the tuple at srcTupleIdx in the source array.
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
vtkCPExodusIIResultsArrayTemplate::GetVariantValue
vtkVariant GetVariantValue(vtkIdType idx)
Retrieve value from the array as a variant.
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkCPExodusIIResultsArrayTemplate::Initialize
void Initialize()
Release storage and reset array to initial state.
vtkCPExodusIIResultsArrayTemplate::SetExodusScalarArrays
void SetExodusScalarArrays(std::vector< Scalar * > arrays, vtkIdType numTuples)
Set the arrays to be used and the number of tuples in each array.
vtkCPExodusIIResultsArrayTemplate::LookupValue
vtkIdType LookupValue(vtkVariant value)
Return the value indices where a specific value appears.
vtkCPExodusIIResultsArrayTemplate::DeepCopy
void DeepCopy(vtkAbstractArray *aa)
Deep copy of data.
vtkCPExodusIIResultsArrayTemplate::InsertValue
void InsertValue(vtkIdType idx, Scalar v)
Insert data at a specified position in the array.
vtkCPExodusIIResultsArrayTemplate::vtkCPExodusIIResultsArrayTemplate
vtkCPExodusIIResultsArrayTemplate()
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:79
vtkCPExodusIIResultsArrayTemplate::~vtkCPExodusIIResultsArrayTemplate
~vtkCPExodusIIResultsArrayTemplate()
vtkCPExodusIIResultsArrayTemplate::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkCPExodusIIResultsArrayTemplate::NewIterator
VTK_NEWINSTANCE vtkArrayIterator * NewIterator()
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
vtkCPExodusIIResultsArrayTemplate::InterpolateTuple
void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights)
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
vtkCPExodusIIResultsArrayTemplate::Resize
int Resize(vtkIdType numTuples)
Resize the array to the requested number of tuples and preserve data.
vtkCPExodusIIResultsArrayTemplate::InsertNextTuple
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source)
Insert the tuple from srcTupleIdx in the source array at the end of this array.
vtkCPExodusIIResultsArrayTemplate::SetValue
void SetValue(vtkIdType idx, Scalar value)
Set the data at a particular index.
vtkCPExodusIIResultsArrayTemplate::InsertNextTuple
vtkIdType InsertNextTuple(const float *source)
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
vtkCPExodusIIResultsArrayTemplate
Map native Exodus II results arrays into the vtkDataArray interface.
Definition: vtkCPExodusIIResultsArrayTemplate.h:39
vtkArrayIterator
Abstract superclass to iterate over elements in an vtkAbstractArray.
Definition: vtkArrayIterator.h:50
vtkCPExodusIIResultsArrayTemplate::SetTuple
void SetTuple(vtkIdType i, const double *source)
vtkCPExodusIIResultsArrayTemplate::GetTuples
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output)
Given a list of tuple ids, return an array of tuples.
VTK_NEWINSTANCE
#define VTK_NEWINSTANCE
Definition: vtkWrappingHints.h:30
vtkCPExodusIIResultsArrayTemplate::LookupTypedValue
void LookupTypedValue(Scalar value, vtkIdList *ids)
vtkCPExodusIIResultsArrayTemplate::GetValueReference
ValueType & GetValueReference(vtkIdType idx)
Get a reference to the scalar value at a particular index.
vtkCPExodusIIResultsArrayTemplate::ClearLookup
void ClearLookup()
Delete the associated fast lookup data structure on this array, if it exists.
vtkCPExodusIIResultsArrayTemplate::SetVariantValue
void SetVariantValue(vtkIdType idx, vtkVariant value)
Set a value in the array from a variant.
vtkCPExodusIIResultsArrayTemplate::InsertNextTuple
vtkIdType InsertNextTuple(const double *source)
vtkCPExodusIIResultsArrayTemplate::SetTypedTuple
void SetTypedTuple(vtkIdType i, const Scalar *t)
Set the tuple value at the ith location in the array.
vtkCPExodusIIResultsArrayTemplate::DeepCopy
void DeepCopy(vtkDataArray *da)
vtkCPExodusIIResultsArrayTemplate::GetTuple
double * GetTuple(vtkIdType i)
Get the data tuple at tupleIdx.
vtkCPExodusIIResultsArrayTemplate::RemoveFirstTuple
void RemoveFirstTuple()
vtkCPExodusIIResultsArrayTemplate::InsertTuple
void InsertTuple(vtkIdType i, const float *source)
Insert the data tuple at tupleIdx.
vtkCPExodusIIResultsArrayTemplate::vtkAbstractTemplateTypeMacro
vtkAbstractTemplateTypeMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >, vtkMappedDataArray< Scalar >) vtkMappedDataArrayNewInstanceMacro(vtkCPExodusIIResultsArrayTemplate< Scalar >) static vtkCPExodusIIResultsArrayTemplate *New()