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