VTK
vtkCPExodusIINodalCoordinatesTemplate.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCPExodusIINodalCoordinatesTemplate.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 vtkCPExodusIINodalCoordinatesTemplate_h
28 #define vtkCPExodusIINodalCoordinatesTemplate_h
29 
30 #include "vtkMappedDataArray.h"
31 #include "vtkIOExodusModule.h" // For export macro
32 
33 #include "vtkObjectFactory.h" // for vtkStandardNewMacro
34 
35 template <class Scalar>
37 {
38 public:
44  virtual void PrintSelf(ostream &os, vtkIndent indent);
45 
46  typedef typename Superclass::ValueType ValueType;
47 
52  void SetExodusScalarArrays(Scalar *x, Scalar *y, Scalar *z,
53  vtkIdType numPoints);
54 
55  // Reimplemented virtuals -- see superclasses for descriptions:
56  void Initialize();
57  void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
59  void Squeeze();
64  void ClearLookup();
65  double* GetTuple(vtkIdType i);
66  void GetTuple(vtkIdType i, double *tuple);
68  void LookupTypedValue(Scalar value, vtkIdList *ids);
71  void GetTypedTuple(vtkIdType idx, Scalar *t) const;
72 
74 
79  int Resize(vtkIdType numTuples);
82  void SetTuple(vtkIdType i, const float *source);
83  void SetTuple(vtkIdType i, const double *source);
85  void InsertTuple(vtkIdType i, const float *source);
86  void InsertTuple(vtkIdType i, const double *source);
87  void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
89  void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
96  void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
97  vtkAbstractArray* source, double* weights);
99  vtkIdType id2, vtkAbstractArray *source2, double t);
105  void SetTypedTuple(vtkIdType i, const Scalar *t);
106  void InsertTypedTuple(vtkIdType i, const Scalar *t);
107  vtkIdType InsertNextTypedTuple(const Scalar *t);
108  void SetValue(vtkIdType idx, Scalar value);
110  void InsertValue(vtkIdType idx, Scalar v);
112 
113 protected:
116 
117  Scalar *XArray;
118  Scalar *YArray;
119  Scalar *ZArray;
120 
121 private:
123  const vtkCPExodusIINodalCoordinatesTemplate &) VTK_DELETE_FUNCTION;
124  void operator=(
125  const vtkCPExodusIINodalCoordinatesTemplate &) VTK_DELETE_FUNCTION;
126 
127  vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
128  double *TempDoubleArray;
129 };
130 
131 #include "vtkCPExodusIINodalCoordinatesTemplate.txx"
132 
133 #endif //vtkCPExodusIINodalCoordinatesTemplate_h
134 
135 // VTK-HeaderTest-Exclude: vtkCPExodusIINodalCoordinatesTemplate.h
Abstract superclass for all arrays.
Abstract superclass to iterate over elements in an vtkAbstractArray.
Map native Exodus II coordinate arrays into the vtkDataArray interface.
void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output)
Given a list of tuple ids, return an array of tuples.
vtkIdType InsertNextValue(Scalar v)
Insert data at the end of the array.
void LookupValue(vtkVariant value, vtkIdList *ids)
ValueType & GetValueReference(vtkIdType idx)
Get a reference to the scalar value at a particular index.
void InsertVariantValue(vtkIdType idx, vtkVariant value)
Insert a value into the array from a variant.
ValueType GetValue(vtkIdType idx) const
Get the data at a particular index.
vtkIdType InsertNextTuple(const double *source)
int Allocate(vtkIdType sz, vtkIdType ext)
This container is read only – this method does nothing but print a warning.
int Resize(vtkIdType numTuples)
Resize the array to the requested number of tuples and preserve data.
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.
void SetNumberOfTuples(vtkIdType number)
Set the number of tuples (a component group) in the array.
void GetTypedTuple(vtkIdType idx, Scalar *t) const
Copy the tuple value into a user-provided array.
void SetVariantValue(vtkIdType idx, vtkVariant value)
Set a value in the array from a variant.
void Squeeze()
Free any unnecessary memory.
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...
void ClearLookup()
Delete the associated fast lookup data structure on this array, if it exists.
vtkAbstractTemplateTypeMacro(vtkCPExodusIINodalCoordinatesTemplate< Scalar >, vtkMappedDataArray< Scalar >) vtkMappedDataArrayNewInstanceMacro(vtkCPExodusIINodalCoordinatesTemplate< Scalar >) static vtkCPExodusIINodalCoordinatesTemplate *New()
vtkIdType InsertNextTypedTuple(const Scalar *t)
Insert (memory allocation performed) the tuple onto the end of the array.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source)
Copy n consecutive tuples starting at srcStart from the source array to this array,...
void InsertTuple(vtkIdType i, const double *source)
void RemoveTuple(vtkIdType id)
These methods remove tuples from the data array.
void InsertTypedTuple(vtkIdType i, const Scalar *t)
Insert (memory allocation performed) the tuple into the ith location in the array.
void SetExodusScalarArrays(Scalar *x, Scalar *y, Scalar *z, vtkIdType numPoints)
Set the raw scalar arrays for the coordinate set.
void SetValue(vtkIdType idx, Scalar value)
Set the data at a particular index.
void InsertTuple(vtkIdType i, const float *source)
Insert the data tuple at tupleIdx.
void InsertValue(vtkIdType idx, Scalar v)
Insert data at a specified position in the array.
VTK_NEWINSTANCE vtkArrayIterator * NewIterator()
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
vtkVariant GetVariantValue(vtkIdType idx)
Retrieve value from the array as a variant.
vtkIdType LookupTypedValue(Scalar value)
void SetTuple(vtkIdType i, const float *source)
Set the data tuple at tupleIdx.
vtkIdType LookupValue(vtkVariant value)
Return the value indices where a specific value appears.
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...
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,...
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void Initialize()
Release storage and reset array to initial state.
void SetTypedTuple(vtkIdType i, const Scalar *t)
Set the tuple value at the ith location in the array.
void DeepCopy(vtkAbstractArray *aa)
Deep copy of data.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
void LookupTypedValue(Scalar value, vtkIdList *ids)
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...
double * GetTuple(vtkIdType i)
Get the data tuple at tupleIdx.
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source)
Insert the tuple from srcTupleIdx in the source array at the end of this array.
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output)
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
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...
void SetTuple(vtkIdType i, const double *source)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkGenericDataArrayLookupHelper< SelfType > Lookup
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
Map non-contiguous data structures into the vtkDataArray API.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
@ value
Definition: vtkX3D.h:220
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define vtkMappedDataArrayNewInstanceMacro(thisClass)
int vtkIdType
Definition: vtkType.h:287
#define VTK_NEWINSTANCE