VTK
vtkSLACReader.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkSLACReader.h
6 
7  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
16 
17 /*-------------------------------------------------------------------------
18  Copyright 2008 Sandia Corporation.
19  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
20  the U.S. Government retains certain rights in this software.
21 -------------------------------------------------------------------------*/
22 
37 #ifndef vtkSLACReader_h
38 #define vtkSLACReader_h
39 
40 #include "vtkIONetCDFModule.h" // For export macro
42 
43 #include "vtkSmartPointer.h" // For internal method.
44 
46 class vtkDoubleArray;
47 class vtkIdTypeArray;
50 
52 {
53 public:
55  static vtkSLACReader *New();
56  virtual void PrintSelf(ostream &os, vtkIndent indent);
57 
58  vtkGetStringMacro(MeshFileName);
59  vtkSetStringMacro(MeshFileName);
60 
62 
66  virtual void AddModeFileName(const char *fname);
67  virtual void RemoveAllModeFileNames();
68  virtual unsigned int GetNumberOfModeFileNames();
69  virtual const char *GetModeFileName(unsigned int idx);
71 
73 
75  vtkGetMacro(ReadInternalVolume, int);
76  vtkSetMacro(ReadInternalVolume, int);
77  vtkBooleanMacro(ReadInternalVolume, int);
79 
81 
83  vtkGetMacro(ReadExternalSurface, int);
84  vtkSetMacro(ReadExternalSurface, int);
85  vtkBooleanMacro(ReadExternalSurface, int);
87 
89 
91  vtkGetMacro(ReadMidpoints, int);
92  vtkSetMacro(ReadMidpoints, int);
93  vtkBooleanMacro(ReadMidpoints, int);
95 
97 
99  virtual const char *GetVariableArrayName(int idx);
100  virtual int GetVariableArrayStatus(const char *name);
101  virtual void SetVariableArrayStatus(const char *name, int status);
103 
105 
106  virtual void ResetFrequencyScales();
107  virtual void SetFrequencyScale(int index, double scale);
109 
111 
112  virtual void ResetPhaseShifts();
113  virtual void SetPhaseShift(int index, double shift);
115 
117 
121 
123  static int CanReadFile(const char *filename);
124 
128 
132 
134 
141 
142 //BTX
144 
148  {
149  public:
150  EdgeEndpoints() : MinEndPoint(-1), MaxEndPoint(-1) {}
151  EdgeEndpoints(vtkIdType endpointA, vtkIdType endpointB) {
152  if (endpointA < endpointB)
153  {
154  this->MinEndPoint = endpointA; this->MaxEndPoint = endpointB;
155  }
156  else
157  {
158  this->MinEndPoint = endpointB; this->MaxEndPoint = endpointA;
159  }
160  }
161  inline vtkIdType GetMinEndPoint() const { return this->MinEndPoint; }
162  inline vtkIdType GetMaxEndPoint() const { return this->MaxEndPoint; }
163  inline bool operator==(const EdgeEndpoints &other) const {
164  return ( (this->GetMinEndPoint() == other.GetMinEndPoint())
165  && (this->GetMaxEndPoint() == other.GetMaxEndPoint()) );
166  }
167  protected:
170  };
172 
174 
176  {
177  public:
179  MidpointCoordinates(const double coord[3], vtkIdType id) {
180  this->Coordinate[0] = coord[0];
181  this->Coordinate[1] = coord[1];
182  this->Coordinate[2] = coord[2];
183  this->ID = id;
184  }
185  double Coordinate[3];
187  };
189 
190  enum {
191  SURFACE_OUTPUT = 0,
192  VOLUME_OUTPUT = 1,
193  NUM_OUTPUTS = 2
194  };
195 //ETX
196 
197 protected:
200 
201 //BTX
202  class vtkInternal;
203  vtkInternal *Internal;
204 
205  // Friend so vtkInternal can access MidpointIdMap
206  // (so Sun CC compiler doesn't complain).
207  friend class vtkInternal;
208 
210 
214 
217 
220 
223 
224 //ETX
225 
226  virtual int RequestInformation(vtkInformation *request,
227  vtkInformationVector **inputVector,
228  vtkInformationVector *outputVector);
229 
230  virtual int RequestData(vtkInformation *request,
231  vtkInformationVector **inputVector,
232  vtkInformationVector *outputVector);
233 
235 
236  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
237  void *clientdata, void *calldata);
239 
241 
246  virtual vtkIdType GetNumTuplesInVariable(int ncFD, int varId,
247  int expectedNumComponents);
249 
252  virtual int CheckTetrahedraWinding(int meshFD);
253 
255 
257  virtual int ReadConnectivity(int meshFD, vtkMultiBlockDataSet *surfaceOutput,
258  vtkMultiBlockDataSet *volumeOutput);
260 
262 
263  virtual int ReadTetrahedronInteriorArray(int meshFD,
264  vtkIdTypeArray *connectivity);
265  virtual int ReadTetrahedronExteriorArray(int meshFD,
266  vtkIdTypeArray *connectivity);
268 
269 //BTX
271 
273  virtual vtkSmartPointer<vtkDataArray> ReadPointDataArray(int ncFD, int varId);
274 //ETX
276 
277 //BTX
279 
280  enum {
281  NumPerTetInt = 5,
282  NumPerTetExt = 9
283  };
284 //ETX
286 
287 //BTX
289 
291  {
292  public:
296 
297  void AddMidpoint(const EdgeEndpoints &edge,
298  const MidpointCoordinates &midpoint);
299  void RemoveMidpoint(const EdgeEndpoints &edge);
302 
306 
307  protected:
308  class vtkInternal;
309  vtkInternal *Internal;
310 
311  private:
312  // Too lazy to implement these.
314  void operator=(const MidpointCoordinateMap &);
315  };
316 
318 
320  {
321  public:
325 
326  void AddMidpoint(const EdgeEndpoints &edge, vtkIdType midpoint);
327  void RemoveMidpoint(const EdgeEndpoints &edge);
330 
334 
339  bool GetNextMidpoint(EdgeEndpoints &edge, vtkIdType &midpoint);
340 
341  protected:
342  class vtkInternal;
343  vtkInternal *Internal;
344 
345  private:
346  // Too lazy to implement these.
347  MidpointIdMap(const MidpointIdMap &);
348  void operator=(const MidpointIdMap &);
349  };
350 //ETX
351 
354  virtual int ReadCoordinates(int meshFD, vtkMultiBlockDataSet *output);
355 
357 
360  virtual int ReadMidpointCoordinates(int meshFD, vtkMultiBlockDataSet *output,
361  MidpointCoordinateMap &map);
363 
365 
368  virtual int ReadMidpointData(int meshFD, vtkMultiBlockDataSet *output,
369  MidpointIdMap &map);
371 
373 
375  virtual int RestoreMeshCache(vtkMultiBlockDataSet *surfaceOutput,
376  vtkMultiBlockDataSet *volumeOutput,
377  vtkMultiBlockDataSet *compositeOutput);
379 
381 
383  virtual int ReadFieldData(const int *modeFDArray,
384  int numModeFDs,
385  vtkMultiBlockDataSet *output);
387 
389 
392  MidpointIdMap &map);
394 
399 
402  virtual int MeshUpToDate();
403 
404 private:
405  vtkSLACReader(const vtkSLACReader &); // Not implemented
406  void operator=(const vtkSLACReader &); // Not implemented
407 };
408 
409 #endif //vtkSLACReader_h
vtkSLACReader::MidpointCoordinateMap
Definition: vtkSLACReader.h:291
vtkSLACReader::MidpointIdMap
Definition: vtkSLACReader.h:320
vtkgl::id
GLuint id
Definition: vtkgl.h:11834
vtkSLACReader::ReadFieldData
virtual int ReadFieldData(const int *modeFDArray, int numModeFDs, vtkMultiBlockDataSet *output)
vtkSLACReader::MidpointCoordinates::MidpointCoordinates
MidpointCoordinates()
Definition: vtkSLACReader.h:178
vtkSLACReader::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkSLACReader::EdgeEndpoints
Definition: vtkSLACReader.h:148
vtkSLACReader::EdgeEndpoints::MinEndPoint
vtkIdType MinEndPoint
Definition: vtkSLACReader.h:168
vtkSLACReader::MidpointIdMap::RemoveMidpoint
void RemoveMidpoint(const EdgeEndpoints &edge)
vtkSLACReader::New
static vtkSLACReader * New()
vtkSLACReader::MidpointCoordinateMap::RemoveAllMidpoints
void RemoveAllMidpoints()
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkSLACReader::SelectionModifiedCallback
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkSLACReader::ReadMidpointCoordinates
virtual int ReadMidpointCoordinates(int meshFD, vtkMultiBlockDataSet *output, MidpointCoordinateMap &map)
vtkSLACReader::ReadMidpoints
int ReadMidpoints
Definition: vtkSLACReader.h:213
vtkSLACReader::GetPhaseShifts
virtual vtkDoubleArray * GetPhaseShifts()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkSLACReader::MidpointCoordinateMap::FindMidpoint
MidpointCoordinates * FindMidpoint(const EdgeEndpoints &edge)
vtkSLACReader::FrequencyModes
bool FrequencyModes
Definition: vtkSLACReader.h:222
vtkSLACReader::MeshUpToDate
virtual int MeshUpToDate()
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkSLACReader::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkSLACReader::MeshFileName
char * MeshFileName
Definition: vtkSLACReader.h:209
vtkSLACReader::MidpointIdMap::RemoveAllMidpoints
void RemoveAllMidpoints()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSLACReader::ResetPhaseShifts
virtual void ResetPhaseShifts()
vtkSLACReader::SetFrequencyScale
virtual void SetFrequencyScale(int index, double scale)
vtkSLACReader::RemoveAllModeFileNames
virtual void RemoveAllModeFileNames()
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:35
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkSLACReader::EdgeEndpoints::MaxEndPoint
vtkIdType MaxEndPoint
Definition: vtkSLACReader.h:169
vtkSLACReader
Definition: vtkSLACReader.h:52
vtkgl::coord
GLuint coord
Definition: vtkgl.h:16713
vtkSLACReader::TimeStepModes
bool TimeStepModes
Definition: vtkSLACReader.h:219
vtkSLACReader::MidpointIdMap::FindMidpoint
vtkIdType * FindMidpoint(const EdgeEndpoints &edge)
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:51
vtkSLACReader::MidpointIdMap::InitTraversal
void InitTraversal()
vtkSLACReader::GetVariableArrayStatus
virtual int GetVariableArrayStatus(const char *name)
vtkSLACReader::MidpointCoordinateMap::GetNumberOfMidpoints
vtkIdType GetNumberOfMidpoints() const
vtkSLACReader::MidpointCoordinateMap::MidpointCoordinateMap
MidpointCoordinateMap()
vtkSLACReader::GetNumberOfVariableArrays
virtual int GetNumberOfVariableArrays()
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:34
vtkSLACReader::IS_EXTERNAL_SURFACE
static vtkInformationIntegerKey * IS_EXTERNAL_SURFACE()
vtkSLACReader::EdgeEndpoints::operator==
bool operator==(const EdgeEndpoints &other) const
Definition: vtkSLACReader.h:163
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkSLACReader::CheckTetrahedraWinding
virtual int CheckTetrahedraWinding(int meshFD)
vtkSLACReader::MidpointIdMap::AddMidpoint
void AddMidpoint(const EdgeEndpoints &edge, vtkIdType midpoint)
vtkSLACReader::RestoreMeshCache
virtual int RestoreMeshCache(vtkMultiBlockDataSet *surfaceOutput, vtkMultiBlockDataSet *volumeOutput, vtkMultiBlockDataSet *compositeOutput)
vtkSLACReader::MidpointCoordinates::ID
vtkIdType ID
Definition: vtkSLACReader.h:186
vtkSLACReader::SetVariableArrayStatus
virtual void SetVariableArrayStatus(const char *name, int status)
vtkSLACReader::MidpointIdMap::GetNumberOfMidpoints
vtkIdType GetNumberOfMidpoints() const
vtkSLACReader::ReadMidpointData
virtual int ReadMidpointData(int meshFD, vtkMultiBlockDataSet *output, MidpointIdMap &map)
vtkInformationObjectBaseKey
Key for vtkObjectBase values.
Definition: vtkInformationObjectBaseKey.h:33
vtkSLACReader::ReadModeData
bool ReadModeData
Definition: vtkSLACReader.h:216
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:34
vtkSLACReader::ReadPointDataArray
virtual vtkSmartPointer< vtkDataArray > ReadPointDataArray(int ncFD, int varId)
vtkSLACReader::InterpolateMidpointData
virtual int InterpolateMidpointData(vtkMultiBlockDataSet *output, MidpointIdMap &map)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSLACReader::MidpointCoordinateMap::AddMidpoint
void AddMidpoint(const EdgeEndpoints &edge, const MidpointCoordinates &midpoint)
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkSLACReader::~vtkSLACReader
~vtkSLACReader()
vtkSLACReader::CanReadFile
static int CanReadFile(const char *filename)
vtkSLACReader::EdgeEndpoints::EdgeEndpoints
EdgeEndpoints()
Definition: vtkSLACReader.h:150
vtkSLACReader::ReadExternalSurface
int ReadExternalSurface
Definition: vtkSLACReader.h:212
vtkSLACReader::GetFrequencyScales
virtual vtkDoubleArray * GetFrequencyScales()
vtkSLACReader::GetNumberOfModeFileNames
virtual unsigned int GetNumberOfModeFileNames()
vtkSmartPointer.h
vtkSLACReader::GetModeFileName
virtual const char * GetModeFileName(unsigned int idx)
vtkMultiBlockDataSetAlgorithm.h
vtkSLACReader::EdgeEndpoints::GetMinEndPoint
vtkIdType GetMinEndPoint() const
Definition: vtkSLACReader.h:161
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkSLACReader::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkSLACReader::GetNumTuplesInVariable
virtual vtkIdType GetNumTuplesInVariable(int ncFD, int varId, int expectedNumComponents)
vtkSLACReader::AddModeFileName
virtual void AddModeFileName(const char *fname)
vtkSLACReader::MeshReadTime
vtkTimeStamp MeshReadTime
Definition: vtkSLACReader.h:398
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSLACReader::vtkSLACReader
vtkSLACReader()
vtkSLACReader::ReadTetrahedronInteriorArray
virtual int ReadTetrahedronInteriorArray(int meshFD, vtkIdTypeArray *connectivity)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkSLACReader::ReadTetrahedronExteriorArray
virtual int ReadTetrahedronExteriorArray(int meshFD, vtkIdTypeArray *connectivity)
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkSLACReader::IS_INTERNAL_VOLUME
static vtkInformationIntegerKey * IS_INTERNAL_VOLUME()
vtkSLACReader::MidpointIdMap::GetNextMidpoint
bool GetNextMidpoint(EdgeEndpoints &edge, vtkIdType &midpoint)
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:49
vtkSLACReader::POINTS
static vtkInformationObjectBaseKey * POINTS()
vtkSLACReader::MidpointIdMap::Internal
vtkInternal * Internal
Definition: vtkSLACReader.h:342
VTKIONETCDF_EXPORT
#define VTKIONETCDF_EXPORT
Definition: vtkIONetCDFModule.h:15
vtkSLACReader::EdgeEndpoints::GetMaxEndPoint
vtkIdType GetMaxEndPoint() const
Definition: vtkSLACReader.h:162
vtkSLACReader::GetVariableArrayName
virtual const char * GetVariableArrayName(int idx)
vtkSLACReader::MidpointCoordinates
Definition: vtkSLACReader.h:176
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkSLACReader::SetPhaseShift
virtual void SetPhaseShift(int index, double shift)
vtkSLACReader::POINT_DATA
static vtkInformationObjectBaseKey * POINT_DATA()
vtkSLACReader::ResetFrequencyScales
virtual void ResetFrequencyScales()
vtkIONetCDFModule.h
vtkSLACReader::MidpointCoordinates::MidpointCoordinates
MidpointCoordinates(const double coord[3], vtkIdType id)
Definition: vtkSLACReader.h:179
vtkSLACReader::EdgeEndpoints::EdgeEndpoints
EdgeEndpoints(vtkIdType endpointA, vtkIdType endpointB)
Definition: vtkSLACReader.h:151
vtkSLACReader::Internal
vtkInternal * Internal
Definition: vtkSLACReader.h:202
vtkSLACReader::MidpointCoordinateMap::RemoveMidpoint
void RemoveMidpoint(const EdgeEndpoints &edge)
vtkSLACReader::MidpointCoordinateMap::Internal
vtkInternal * Internal
Definition: vtkSLACReader.h:308
vtkSLACReader::MidpointIdMap::MidpointIdMap
MidpointIdMap()
vtkSLACReader::ReadInternalVolume
int ReadInternalVolume
Definition: vtkSLACReader.h:211
vtkSLACReader::ReadConnectivity
virtual int ReadConnectivity(int meshFD, vtkMultiBlockDataSet *surfaceOutput, vtkMultiBlockDataSet *volumeOutput)
vtkSLACReader::MidpointIdMap::~MidpointIdMap
~MidpointIdMap()
vtkX3D::Coordinate
@ Coordinate
Definition: vtkX3D.h:44
vtkSLACReader::ReadCoordinates
virtual int ReadCoordinates(int meshFD, vtkMultiBlockDataSet *output)
vtkSLACReader::MidpointCoordinateMap::~MidpointCoordinateMap
~MidpointCoordinateMap()
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:32