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 
98  virtual int GetNumberOfVariableArrays();
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 
118  virtual vtkDoubleArray* GetFrequencyScales();
119  virtual vtkDoubleArray* GetPhaseShifts();
121 
123  static int CanReadFile(const char *filename);
124 
127  static vtkInformationIntegerKey *IS_INTERNAL_VOLUME();
128 
131  static vtkInformationIntegerKey *IS_EXTERNAL_SURFACE();
132 
134 
138  static vtkInformationObjectBaseKey *POINTS();
139  static vtkInformationObjectBaseKey *POINT_DATA();
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:
198  vtkSLACReader();
199  ~vtkSLACReader();
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);
300  void RemoveAllMidpoints();
301  vtkIdType GetNumberOfMidpoints() const;
302 
305  MidpointCoordinates *FindMidpoint(const EdgeEndpoints &edge);
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:
322  MidpointIdMap();
323  ~MidpointIdMap();
325 
326  void AddMidpoint(const EdgeEndpoints &edge, vtkIdType midpoint);
327  void RemoveMidpoint(const EdgeEndpoints &edge);
328  void RemoveAllMidpoints();
329  vtkIdType GetNumberOfMidpoints() const;
330 
333  vtkIdType *FindMidpoint(const EdgeEndpoints &edge);
334 
336  void InitTraversal();
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 
391  virtual int InterpolateMidpointData(vtkMultiBlockDataSet *output,
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
EdgeEndpoints(vtkIdType endpointA, vtkIdType endpointB)
abstract base class for most VTK objects
Definition: vtkObject.h:61
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
bool operator==(const EdgeEndpoints &other) const
dynamic, self-adjusting array of vtkIdType
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:275
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
dynamic, self-adjusting array of double
static vtkMultiBlockDataSetAlgorithm * New()
MidpointCoordinates(const double coord[3], vtkIdType id)
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for integer values in vtkInformation.
Store on/off settings for data arrays for a vtkSource.
Key for vtkObjectBase values.
vtkInternal * Internal
Composite dataset that organizes datasets into blocks.
void PrintSelf(ostream &os, vtkIndent indent)
Store zero or more vtkInformation instances.
#define VTKIONETCDF_EXPORT
char * MeshFileName
vtkIdType GetMaxEndPoint() const
vtkIdType GetMinEndPoint() const
vtkTimeStamp MeshReadTime