VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCPExodusIIResultsArrayTemplate.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00029 #ifndef __vtkCPExodusIIResultsArrayTemplate_h 00030 #define __vtkCPExodusIIResultsArrayTemplate_h 00031 00032 #include "vtkMappedDataArray.h" 00033 00034 #include "vtkTypeTemplate.h" // For templated vtkObject API 00035 #include "vtkObjectFactory.h" // for vtkStandardNewMacro 00036 00037 template <class Scalar> 00038 class vtkCPExodusIIResultsArrayTemplate: 00039 public vtkTypeTemplate<vtkCPExodusIIResultsArrayTemplate<Scalar>, 00040 vtkMappedDataArray<Scalar> > 00041 { 00042 public: 00043 vtkMappedDataArrayNewInstanceMacro(vtkCPExodusIIResultsArrayTemplate<Scalar>) 00044 static vtkCPExodusIIResultsArrayTemplate *New(); 00045 virtual void PrintSelf(ostream &os, vtkIndent indent); 00046 00047 void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples); 00048 00049 // Reimplemented virtuals -- see superclasses for descriptions: 00050 void Initialize(); 00051 void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output); 00052 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output); 00053 void Squeeze(); 00054 vtkArrayIterator *NewIterator(); 00055 vtkIdType LookupValue(vtkVariant value); 00056 void LookupValue(vtkVariant value, vtkIdList *ids); 00057 vtkVariant GetVariantValue(vtkIdType idx); 00058 void ClearLookup(); 00059 double* GetTuple(vtkIdType i); 00060 void GetTuple(vtkIdType i, double *tuple); 00061 vtkIdType LookupTypedValue(Scalar value); 00062 void LookupTypedValue(Scalar value, vtkIdList *ids); 00063 Scalar GetValue(vtkIdType idx); 00064 Scalar& GetValueReference(vtkIdType idx); 00065 void GetTupleValue(vtkIdType idx, Scalar *t); 00066 00068 00070 int Allocate(vtkIdType sz, vtkIdType ext); 00071 int Resize(vtkIdType numTuples); 00072 void SetNumberOfTuples(vtkIdType number); 00073 void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source); 00074 void SetTuple(vtkIdType i, const float *source); 00075 void SetTuple(vtkIdType i, const double *source); 00076 void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source); 00077 void InsertTuple(vtkIdType i, const float *source); 00078 void InsertTuple(vtkIdType i, const double *source); 00079 void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, 00080 vtkAbstractArray *source); 00081 vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source); 00082 vtkIdType InsertNextTuple(const float *source); 00083 vtkIdType InsertNextTuple(const double *source); 00084 void DeepCopy(vtkAbstractArray *aa); 00085 void DeepCopy(vtkDataArray *da); 00086 void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, 00087 vtkAbstractArray* source, double* weights); 00088 void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, 00089 vtkIdType id2, vtkAbstractArray *source2, double t); 00090 void SetVariantValue(vtkIdType idx, vtkVariant value); 00091 void RemoveTuple(vtkIdType id); 00092 void RemoveFirstTuple(); 00093 void RemoveLastTuple(); 00094 void SetTupleValue(vtkIdType i, const Scalar *t); 00095 void InsertTupleValue(vtkIdType i, const Scalar *t); 00096 vtkIdType InsertNextTupleValue(const Scalar *t); 00097 void SetValue(vtkIdType idx, Scalar value); 00098 vtkIdType InsertNextValue(Scalar v); 00099 void InsertValue(vtkIdType idx, Scalar v); 00101 00102 protected: 00103 vtkCPExodusIIResultsArrayTemplate(); 00104 ~vtkCPExodusIIResultsArrayTemplate(); 00105 00106 std::vector<Scalar *> Arrays; 00107 00108 private: 00109 vtkCPExodusIIResultsArrayTemplate(const vtkCPExodusIIResultsArrayTemplate &); // Not implemented. 00110 void operator=(const vtkCPExodusIIResultsArrayTemplate &); // Not implemented. 00111 00112 vtkIdType Lookup(const Scalar &val, vtkIdType startIndex); 00113 double *TempDoubleArray; 00114 }; 00115 00116 #include "vtkCPExodusIIResultsArrayTemplate.txx" 00117 00118 #endif //__vtkCPExodusIIResultsArrayTemplate_h 00119 00120 // VTK-HeaderTest-Exclude: vtkCPExodusIIResultsArrayTemplate.h