VTK
dox/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCPExodusIINodalCoordinatesTemplate.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 
00026 #ifndef __vtkCPExodusIINodalCoordinatesTemplate_h
00027 #define __vtkCPExodusIINodalCoordinatesTemplate_h
00028 
00029 #include "vtkMappedDataArray.h"
00030 #include "vtkIOExodusModule.h" // For export macro
00031 
00032 #include "vtkTypeTemplate.h" // For templated vtkObject API
00033 #include "vtkObjectFactory.h" // for vtkStandardNewMacro
00034 
00035 template <class Scalar>
00036 class vtkCPExodusIINodalCoordinatesTemplate:
00037     public vtkTypeTemplate<vtkCPExodusIINodalCoordinatesTemplate<Scalar>,
00038                            vtkMappedDataArray<Scalar> >
00039 {
00040 public:
00041   vtkMappedDataArrayNewInstanceMacro(
00042       vtkCPExodusIINodalCoordinatesTemplate<Scalar>)
00043   static vtkCPExodusIINodalCoordinatesTemplate *New();
00044   virtual void PrintSelf(ostream &os, vtkIndent indent);
00045 
00047 
00049   void SetExodusScalarArrays(Scalar *x, Scalar *y, Scalar *z,
00050                              vtkIdType numPoints);
00052 
00053   // Reimplemented virtuals -- see superclasses for descriptions:
00054   void Initialize();
00055   void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
00056   void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output);
00057   void Squeeze();
00058   vtkArrayIterator *NewIterator();
00059   vtkIdType LookupValue(vtkVariant value);
00060   void LookupValue(vtkVariant value, vtkIdList *ids);
00061   vtkVariant GetVariantValue(vtkIdType idx);
00062   void ClearLookup();
00063   double* GetTuple(vtkIdType i);
00064   void GetTuple(vtkIdType i, double *tuple);
00065   vtkIdType LookupTypedValue(Scalar value);
00066   void LookupTypedValue(Scalar value, vtkIdList *ids);
00067   Scalar GetValue(vtkIdType idx);
00068   Scalar& GetValueReference(vtkIdType idx);
00069   void GetTupleValue(vtkIdType idx, Scalar *t);
00070 
00072 
00074   int Allocate(vtkIdType sz, vtkIdType ext);
00075   int Resize(vtkIdType numTuples);
00076   void SetNumberOfTuples(vtkIdType number);
00077   void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
00078   void SetTuple(vtkIdType i, const float *source);
00079   void SetTuple(vtkIdType i, const double *source);
00080   void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
00081   void InsertTuple(vtkIdType i, const float *source);
00082   void InsertTuple(vtkIdType i, const double *source);
00083   void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
00084                     vtkAbstractArray *source);
00085   vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source);
00086   vtkIdType InsertNextTuple(const float *source);
00087   vtkIdType InsertNextTuple(const double *source);
00088   void DeepCopy(vtkAbstractArray *aa);
00089   void DeepCopy(vtkDataArray *da);
00090   void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
00091                         vtkAbstractArray* source,  double* weights);
00092   void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1,
00093                         vtkIdType id2, vtkAbstractArray *source2, double t);
00094   void SetVariantValue(vtkIdType idx, vtkVariant value);
00095   void RemoveTuple(vtkIdType id);
00096   void RemoveFirstTuple();
00097   void RemoveLastTuple();
00098   void SetTupleValue(vtkIdType i, const Scalar *t);
00099   void InsertTupleValue(vtkIdType i, const Scalar *t);
00100   vtkIdType InsertNextTupleValue(const Scalar *t);
00101   void SetValue(vtkIdType idx, Scalar value);
00102   vtkIdType InsertNextValue(Scalar v);
00103   void InsertValue(vtkIdType idx, Scalar v);
00105 
00106 protected:
00107   vtkCPExodusIINodalCoordinatesTemplate();
00108   ~vtkCPExodusIINodalCoordinatesTemplate();
00109 
00110   Scalar *XArray;
00111   Scalar *YArray;
00112   Scalar *ZArray;
00113 
00114 private:
00115   vtkCPExodusIINodalCoordinatesTemplate(
00116       const vtkCPExodusIINodalCoordinatesTemplate &); // Not implemented.
00117   void operator=(
00118       const vtkCPExodusIINodalCoordinatesTemplate &); // Not implemented.
00119 
00120   vtkIdType Lookup(const Scalar &val, vtkIdType startIndex);
00121   double *TempDoubleArray;
00122 };
00123 
00124 #include "vtkCPExodusIINodalCoordinatesTemplate.txx"
00125 
00126 #endif //__vtkCPExodusIINodalCoordinatesTemplate_h
00127 
00128 // VTK-HeaderTest-Exclude: vtkCPExodusIINodalCoordinatesTemplate.h