VTK
vtkEnSightWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEnSightWriter.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 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
32 #ifndef __vtkEnSightWriter_h
33 #define __vtkEnSightWriter_h
34 
35 #include "vtkIOParallelModule.h" // For export macro
36 #include "vtkWriter.h"
37 
39 class vtkModelMetadata;
40 
41 class VTKIOPARALLEL_EXPORT vtkEnSightWriter : public vtkWriter
42 {
43 
44 public:
45  vtkTypeMacro(vtkEnSightWriter,vtkWriter);
46  virtual void PrintSelf(ostream& os, vtkIndent indent);
47 
48  */
49  static vtkEnSightWriter *New();
50 
52 
53  vtkSetMacro(ProcessNumber,int);
54  vtkGetMacro(ProcessNumber,int);
56 
58 
59  vtkSetStringMacro(Path);
60  vtkGetStringMacro(Path);
62 
64 
65  vtkSetStringMacro(BaseName);
66  vtkGetStringMacro(BaseName);
68 
70 
71  vtkSetStringMacro(FileName);
72  vtkGetStringMacro(FileName);
74 
76 
77  vtkSetMacro(TimeStep,int);
78  vtkGetMacro(TimeStep,int);
80 
82 
83  vtkSetMacro(GhostLevel,int);
84  vtkGetMacro(GhostLevel,int);
86 
88 
90  vtkSetMacro(TransientGeometry,bool);
91  vtkGetMacro(TransientGeometry,bool);
93 
95 
96  vtkSetMacro(NumberOfBlocks,int);
97  vtkGetMacro(NumberOfBlocks,int);
99 
101 
103  virtual void SetBlockIDs(int* val)
104  {
105  BlockIDs=val;
106  }
107  virtual int* GetBlockIDs()
108  {
109  return BlockIDs;
110  }
112 
114 
115  virtual void SetInputData(vtkUnstructuredGrid *input);
116  virtual vtkUnstructuredGrid* GetInput();
118 
120 
124  virtual void WriteCaseFile(int TotalTimeSteps);
125  virtual void WriteSOSCaseFile(int NumProcs);
127 
129 
130  virtual void SetModelMetadata(vtkModelMetadata* model);
131  vtkGetObjectMacro(ModelMetadata, vtkModelMetadata);
133 
134 protected:
136  virtual ~vtkEnSightWriter();
137 
139 
140  virtual void WriteData(); // method to allow this class to be instantiated and delegated to
141 
142  virtual void WriteStringToFile(const char* string, FILE* file);
143  virtual void WriteTerminatedStringToFile(const char* string, FILE* file);
144  virtual void WriteIntToFile(const int i,FILE* file);
145  virtual void WriteFloatToFile(const float f,FILE* file);
146  virtual void WriteElementTypeToFile(int ElementType, FILE* fd);
147 
148  virtual bool ShouldWriteGeometry();
149  virtual void SanitizeFileName(char* name);
150  virtual FILE* OpenFile(char* name);
151 
152  void ComputeNames();
153  void DefaultNames();
154 
155  int GetExodusModelIndex(int *ElementArray,int NumberElements,int PartID);
156 
157  char *Path;
158  char *BaseName;
159  char *FileName;
160  int TimeStep;
165  int * BlockIDs;
170 
171  vtkEnSightWriter(const vtkEnSightWriter&); // Not implemented.
172  void operator=(const vtkEnSightWriter&); // Not implemented.
173 
174 };
175 
176 #endif