VTK
vtkAMREnzoReaderInternal.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMREnzoReaderInternal.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 =========================================================================*/
25 #ifndef vtkAMREnzoReaderInternal_h
26 #define vtkAMREnzoReaderInternal_h
27 #ifndef __VTK_WRAP__
28 
29 #include "vtksys/SystemTools.hxx"
30 
31 #include <vector> // for STL vector
32 #include <string> // for STL string
33 #include <cassert> // for assert()
34 
35 class vtkDataArray;
36 class vtkDataSet;
37 
38 /*****************************************************************************
39 *
40 * Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
41 * Produced at the Lawrence Livermore National Laboratory
42 * LLNL-CODE-400124
43 * All rights reserved.
44 *
45 * This file was adapted from the VisIt Enzo reader (avtEnzoFileFormat). For
46 * details, see https://visit.llnl.gov/. The full copyright notice is contained
47 * in the file COPYRIGHT located at the root of the VisIt distribution or at
48 * http://www.llnl.gov/visit/copyright.html.
49 *
50 *****************************************************************************/
51 
52 static std::string GetEnzoDirectory( const char* path )
53 {
54  return( vtksys::SystemTools::GetFilenamePath( std::string(path) ) );
55 }
56 
57 
58 // ----------------------------------------------------------------------------
59 // Class vtkEnzoReaderBlock (begin)
60 // ----------------------------------------------------------------------------
61 
62 
64 {
65 public:
66  vtkEnzoReaderBlock() { this->Init(); }
67  ~vtkEnzoReaderBlock() { this->Init(); }
69  { this->DeepCopy(&other); }
71  { this->DeepCopy(&other); return *this; }
72 
73  int Index;
74  int Level;
75  int ParentId;
76  std::vector< int > ChildrenIds;
77 
82 
87 
88  double MinBounds[3];
89  double MaxBounds[3];
90  double SubdivisionRatio[3];
91 
94 
95  void Init();
96  void DeepCopy(const vtkEnzoReaderBlock *other);
97  void GetParentWiseIds( std::vector< vtkEnzoReaderBlock > & blocks );
98  void GetLevelBasedIds( std::vector< vtkEnzoReaderBlock > & blocks );
99 };
100 
101 
102 // ----------------------------------------------------------------------------
103 // Class vtkEnzoReaderBlock ( end )
104 // ----------------------------------------------------------------------------
105 
106 
107 // ----------------------------------------------------------------------------
108 // Class vtkEnzoReaderInternal (begin)
109 // ----------------------------------------------------------------------------
110 
111 
113 {
114 public:
117 
118  // number of all vtkDataSet (vtkImageData / vtkRectilinearGrid / vtkPolyData)
119  // objects that have been SUCCESSFULLY extracted and inserted to the output
120  // vtkMultiBlockDataSet (including rectilinear blocks and particle sets)
122 
128  char * FileName;
129  double DataTime;
131 // vtkAMREnzoReader * TheReader;
132 
137  std::vector< std::string > BlockAttributeNames;
138  std::vector< std::string > ParticleAttributeNames;
139  std::vector< std::string > TracerParticleAttributeNames;
140  std::vector< vtkEnzoReaderBlock > Blocks;
141 
142  void Init();
143  void ReleaseDataArray();
144  void SetFileName( char * fileName ) { this->FileName = fileName; }
145  void ReadMetaData();
146  void GetAttributeNames();
147  void CheckAttributeNames();
148  void ReadBlockStructures();
149  void ReadGeneralParameters();
150  void DetermineRootBoundingBox();
151  int LoadAttribute( const char *attribute, int blockIdx );
152  int GetBlockAttribute(
153  const char* attribute, int blockIdx, vtkDataSet* pDataSet );
154  std::string GetBaseDirectory(const char* path)
155  {return GetEnzoDirectory(path); };
156 
157 
158 };
159 
160 
161 
162 
163 // ----------------------------------------------------------------------------
164 // Class vtkEnzoReaderInternal ( end )
165 // ----------------------------------------------------------------------------
166 
167 #endif
168 #endif /* vtkAMREnzoReaderInternal_h */
169 // VTK-HeaderTest-Exclude: vtkAMREnzoReaderInternal.h
vtkEnzoReaderBlock(const vtkEnzoReaderBlock &other)
std::string GetBaseDirectory(const char *path)
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
std::vector< std::string > ParticleAttributeNames
std::vector< std::string > BlockAttributeNames
void GetLevelBasedIds(std::vector< vtkEnzoReaderBlock > &blocks)
void SetFileName(char *fileName)
void DeepCopy(const vtkEnzoReaderBlock *other)
vtkEnzoReaderBlock & operator=(const vtkEnzoReaderBlock &other)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
std::vector< vtkEnzoReaderBlock > Blocks
std::vector< std::string > TracerParticleAttributeNames
std::vector< int > ChildrenIds
void GetParentWiseIds(std::vector< vtkEnzoReaderBlock > &blocks)
static std::string GetEnzoDirectory(const char *path)