ParaView
vtkCGNSReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCGNSReader.h
5 
6  Copyright (c) Ken Martin, Will Schrodeder, 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 // Copyright 2013-2014 Mickael Philit.
16 
35 #ifndef vtkCGNSReader_h
36 #define vtkCGNSReader_h
37 
38 #include "vtkMultiBlockDataSetAlgorithm.h"
39 #include "vtkPVVTKExtensionsCGNSReaderModule.h" // for export macro
40 
41 class vtkDataSet;
42 class vtkDataArraySelection;
43 class vtkCallbackCommand;
44 
45 namespace CGNSRead
46 {
47 class vtkCGNSMetaData;
48 }
49 
50 class vtkMultiProcessController;
51 class VTKPVVTKEXTENSIONSCGNSREADER_EXPORT vtkCGNSReader : public vtkMultiBlockDataSetAlgorithm
52 {
53 public:
54  static vtkCGNSReader* New();
55  vtkTypeMacro(vtkCGNSReader, vtkMultiBlockDataSetAlgorithm);
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
62  vtkSetStringMacro(FileName);
63  vtkGetStringMacro(FileName);
65 
69  int CanReadFile(const char* filename);
70 
71  // The following methods allow selective reading of solutions fields.
72  int GetBaseArrayStatus(const char* name);
73  void SetBaseArrayStatus(const char* name, int status);
74  void DisableAllBases();
75  void EnableAllBases();
76 
77  int GetNumberOfBaseArrays();
78  int GetNumberOfPointArrays();
79  int GetNumberOfCellArrays();
80 
81  const char* GetBaseArrayName(int index);
82  const char* GetPointArrayName(int index);
83  const char* GetCellArrayName(int index);
84 
85  int GetPointArrayStatus(const char* name);
86  int GetCellArrayStatus(const char* name);
87 
88  void SetPointArrayStatus(const char* name, int status);
89  void SetCellArrayStatus(const char* name, int status);
90 
91  void DisableAllPointArrays();
92  void EnableAllPointArrays();
93 
94  void DisableAllCellArrays();
95  void EnableAllCellArrays();
96 
97  vtkSetMacro(DoublePrecisionMesh, int);
98  vtkGetMacro(DoublePrecisionMesh, int);
99  vtkBooleanMacro(DoublePrecisionMesh, int);
100 
101  vtkSetMacro(LoadBndPatch, int);
102  vtkGetMacro(LoadBndPatch, int);
103  vtkBooleanMacro(LoadBndPatch, int);
104 
105  vtkSetMacro(CreateEachSolutionAsBlock, int);
106  vtkGetMacro(CreateEachSolutionAsBlock, int);
107  vtkBooleanMacro(CreateEachSolutionAsBlock, int);
108 
110 
115  void SetController(vtkMultiProcessController* c);
116  vtkGetObjectMacro(Controller, vtkMultiProcessController);
118 
123  void Broadcast(vtkMultiProcessController* ctrl);
124 
125 protected:
126  vtkCGNSReader();
127  ~vtkCGNSReader();
128 
129  virtual int FillOutputPortInformation(int port, vtkInformation* info);
130 
131  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
132  virtual int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
133 
134  vtkDataArraySelection* BaseSelection;
135  vtkDataArraySelection* PointDataArraySelection;
136  vtkDataArraySelection* CellDataArraySelection;
137 
138  // The observer to modify this object when the array selections are
139  // modified.
140  vtkCallbackCommand* SelectionObserver;
141 
142  // Callback registered with the SelectionObserver.
143  static void SelectionModifiedCallback(
144  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
145 
146  int GetCurvilinearZone(
147  int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
148 
149  int GetUnstructuredZone(
150  int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
151  vtkMultiProcessController* Controller;
152  vtkIdType ProcRank;
153  vtkIdType ProcSize;
154 
155 private:
156  vtkCGNSReader(const vtkCGNSReader&) VTK_DELETE_FUNCTION;
157  void operator=(const vtkCGNSReader&) VTK_DELETE_FUNCTION;
158 
159  CGNSRead::vtkCGNSMetaData* Internal; // Metadata
160 
161  char* FileName; // cgns file name
162  int LoadBndPatch; // option to set section loading for unstructured grid
163  int DoublePrecisionMesh; // option to set mesh loading to double precision
164  int CreateEachSolutionAsBlock; // debug option to create
165 
166  // For internal cgio calls (low level IO)
167  int cgioNum; // cgio file reference
168  double rootId; // id of root node
169  double currentId; // id of node currently being read (zone)
170  //
171  unsigned int NumberOfBases;
172  int ActualTimeStep;
173 
174  class vtkPrivate;
175  friend class vtkPrivate;
176 };
177 
178 #endif // vtkCGNSReader_h
vtkIdType ProcSize
vtkIdType ProcRank
vtkCGNSReader creates a multi-block dataset and reads unstructured grids, and structured meshes from ...
Definition: vtkCGNSReader.h:51
vtkDataArraySelection * CellDataArraySelection
vtkCallbackCommand * SelectionObserver
vtkMultiProcessController * Controller
vtkDataArraySelection * BaseSelection
vtkDataArraySelection * PointDataArraySelection