VTK
dox/Hybrid/vtkExodusModel.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkExodusModel.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 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00054 #ifndef __vtkExodusModel_h
00055 #define __vtkExodusModel_h
00056 
00057 #include "vtkObject.h"
00058 
00059 #include "vtkModelMetadata.h"  // So those who include vtkExodusModel don't
00060                                // need to know anything about ModelMetadata
00061 
00062 class vtkIdTypeArray;
00063 class vtkUnstructuredGrid;
00064 
00065 class VTK_HYBRID_EXPORT vtkExodusModel : public vtkObject
00066 { 
00067 public:
00068   vtkTypeMacro(vtkExodusModel, vtkObject);
00069   virtual void PrintSelf(ostream &os, vtkIndent indent);
00070 
00071   static vtkExodusModel *New();
00072 
00082   int SetGlobalInformation(int fid, int compute_word_size);
00083 
00096   int AddUGridElementVariable(char *ugridVarName, char *origName, int numComponents);
00097   int RemoveUGridElementVariable(char *ugridVarName);
00098 
00099   int AddUGridNodeVariable(char *ugridVarName, char *origName, int numComponents);
00100   int RemoveUGridNodeVariable(char *ugridVarName);
00101 
00102   void SetElementVariableInfo(int numOrigNames, char **origNames,
00103             int numNames, char **names,  int *numComp, int *map);
00104   void SetNodeVariableInfo(int numOrigNames, char **origNames,
00105             int numNames, char **names,  int *numComp, int *map);
00106 
00120   int SetLocalInformation(vtkUnstructuredGrid *ugrid,
00121         int fid, int timeStep, int newGeometry, int compute_word_size);
00122 
00126   static int HasMetadata(vtkUnstructuredGrid *grid);
00127 
00130   vtkModelMetadata *GetModelMetadata();
00131   void SetModelMetadata(vtkModelMetadata *emData);
00132 
00142   int UnpackExodusModel(vtkUnstructuredGrid *grid, int deleteIt);
00143 
00148   int MergeExodusModel(vtkExodusModel *em);
00149 
00157   vtkExodusModel *ExtractExodusModel(vtkIdTypeArray *globalCellIdList, 
00158                                      vtkUnstructuredGrid *grid);
00159 
00165   void PackExodusModel(vtkUnstructuredGrid *grid);
00166   
00169   void Reset();
00170 
00171 protected:
00172 
00173   vtkExodusModel();
00174   ~vtkExodusModel();
00175 
00176 private:
00177 
00178   vtkModelMetadata *CheckSetModelMetadata();
00179 
00180   static void CopyDoubleToFloat(float *f, double *d, int len);
00181 
00182   int SetLocalBlockInformation(
00183           int fid, int use_floats, int *blockIds , int *cellIds, int ncells);
00184   int SetLocalNodeSetInformation(
00185                        int fid, int use_floats, int *pointIds, int npoints);
00186   int SetLocalSideSetInformation(
00187                         int fid, int use_floats, int *cellIds, int ncells);
00188 
00189   void RemoveBeginningAndTrailingSpaces(char **names, int len);
00190 
00191   vtkModelMetadata *ModelMetadata;
00192 
00193   int GeometryCount;
00194 
00195   vtkExodusModel(const vtkExodusModel&); // Not implemented
00196   void operator=(const vtkExodusModel&); // Not implemented
00197 };
00198 #endif