VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.h
Go to the documentation of this file.
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 
00048 
00052   void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples);
00053   void SetExodusScalarArrays(std::vector<Scalar*> arrays, vtkIdType numTuples, bool save);
00055 
00056   // Reimplemented virtuals -- see superclasses for descriptions:
00057   void Initialize();
00058   void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
00059   void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output);
00060   void Squeeze();
00061   vtkArrayIterator *NewIterator();
00062   vtkIdType LookupValue(vtkVariant value);
00063   void LookupValue(vtkVariant value, vtkIdList *ids);
00064   vtkVariant GetVariantValue(vtkIdType idx);
00065   void ClearLookup();
00066   double* GetTuple(vtkIdType i);
00067   void GetTuple(vtkIdType i, double *tuple);
00068   vtkIdType LookupTypedValue(Scalar value);
00069   void LookupTypedValue(Scalar value, vtkIdList *ids);
00070   Scalar GetValue(vtkIdType idx);
00071   Scalar& GetValueReference(vtkIdType idx);
00072   void GetTupleValue(vtkIdType idx, Scalar *t);
00073 
00075 
00077   int Allocate(vtkIdType sz, vtkIdType ext);
00078   int Resize(vtkIdType numTuples);
00079   void SetNumberOfTuples(vtkIdType number);
00080   void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
00081   void SetTuple(vtkIdType i, const float *source);
00082   void SetTuple(vtkIdType i, const double *source);
00083   void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
00084   void InsertTuple(vtkIdType i, const float *source);
00085   void InsertTuple(vtkIdType i, const double *source);
00086   void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
00087                     vtkAbstractArray *source);
00088   void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
00089                     vtkAbstractArray* source);
00090   vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source);
00091   vtkIdType InsertNextTuple(const float *source);
00092   vtkIdType InsertNextTuple(const double *source);
00093   void DeepCopy(vtkAbstractArray *aa);
00094   void DeepCopy(vtkDataArray *da);
00095   void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
00096                         vtkAbstractArray* source,  double* weights);
00097   void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1,
00098                         vtkIdType id2, vtkAbstractArray *source2, double t);
00099   void SetVariantValue(vtkIdType idx, vtkVariant value);
00100   void RemoveTuple(vtkIdType id);
00101   void RemoveFirstTuple();
00102   void RemoveLastTuple();
00103   void SetTupleValue(vtkIdType i, const Scalar *t);
00104   void InsertTupleValue(vtkIdType i, const Scalar *t);
00105   vtkIdType InsertNextTupleValue(const Scalar *t);
00106   void SetValue(vtkIdType idx, Scalar value);
00107   vtkIdType InsertNextValue(Scalar v);
00108   void InsertValue(vtkIdType idx, Scalar v);
00110 
00111 protected:
00112   vtkCPExodusIIResultsArrayTemplate();
00113   ~vtkCPExodusIIResultsArrayTemplate();
00114 
00115   std::vector<Scalar *> Arrays;
00116 
00117 private:
00118   vtkCPExodusIIResultsArrayTemplate(const vtkCPExodusIIResultsArrayTemplate &); // Not implemented.
00119   void operator=(const vtkCPExodusIIResultsArrayTemplate &); // Not implemented.
00120 
00121   vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
00122   double *TempDoubleArray;
00124 
00125   bool Save;
00126 };
00128 
00129 #include "vtkCPExodusIIResultsArrayTemplate.txx"
00130 
00131 #endif //vtkCPExodusIIResultsArrayTemplate_h
00132 
00133 // VTK-HeaderTest-Exclude: vtkCPExodusIIResultsArrayTemplate.h