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