Commit d27e18ce authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Remove vtkstd from AMR readers

Change-Id: Iba5e56191c20d77a41865191bd8fec0894539d01
parent 06ddbe73
......@@ -483,7 +483,7 @@ void vtkAMRBaseReader::AssignAndLoadBlocks( vtkHierarchicalBoxDataSet *output )
// hierarchical box data-structure. Note that then number of blocks
// can change based on user constraints, e.g., the number of levels
// visible.
vtkstd::vector< int > idxcounter;
std::vector< int > idxcounter;
idxcounter.resize(this->GetNumberOfLevels()+1, 0);
// Find the number of blocks to be processed. BlockMap.size()
......
......@@ -21,9 +21,9 @@
#define VTKAMRBASEREADER_H_
#include "vtkHierarchicalBoxDataSetAlgorithm.h"
#include <vtkstd/vector> // STL vector header
#include <vtkstd/map> // STL map header
#include <vtkstd/utility> // for STL pair
#include <vector> // STL vector header
#include <map> // STL map header
#include <utility> // for STL pair
// Forward Declarations
class vtkHierarchicalBoxDataSet;
......@@ -262,7 +262,7 @@ class VTK_AMR_EXPORT vtkAMRBaseReader :
//BTX
vtkstd::vector<int> BlockMap;
std::vector<int> BlockMap;
//ETX
private:
......
......@@ -40,8 +40,8 @@
#include <hdf5.h>
#include <sstream>
#include <vtkstd/vector>
#include <vtkstd/string>
#include <vector>
#include <string>
#include <cassert>
#include "vtkAMREnzoReaderInternal.h"
......@@ -200,9 +200,9 @@ void vtkAMREnzoReader::SetFileName( const char* fileName )
if( fileName && strcmp( fileName, "" ) &&
( (this->FileName==NULL) || (strcmp(fileName,this->FileName ) ) ) )
{
vtkstd::string tempName( fileName );
vtkstd::string bExtName( ".boundary" );
vtkstd::string hExtName( ".hierarchy" );
std::string tempName( fileName );
std::string bExtName( ".boundary" );
std::string hExtName( ".hierarchy" );
if( tempName.length() > hExtName.length() &&
tempName.substr(tempName.length()-hExtName.length() )== hExtName )
......
......@@ -23,7 +23,7 @@
#include "vtkAMRBaseReader.h"
#include "vtkstd/map" // For STL map
#include <map> // For STL map
class vtkHierarchicalBoxDataSet;
class vtkEnzoReaderInternal;
......@@ -121,8 +121,8 @@ class VTK_AMR_EXPORT vtkAMREnzoReader : public vtkAMRBaseReader
vtkEnzoReaderInternal *Internal;
vtkstd::map< vtkstd::string, int > label2idx;
vtkstd::map< int, double > conversionFactors;
std::map< std::string, int > label2idx;
std::map< int, double > conversionFactors;
};
#endif /* VTKAMRENZOREADER_H_ */
......@@ -23,8 +23,8 @@
#ifndef VTKAMRENZOREADERINTERNAL_HPP_
#define VTKAMRENZOREADERINTERNAL_HPP_
#include <vtkstd/vector> // for STL vector
#include <vtkstd/string> // for STL string
#include <vector> // for STL vector
#include <string> // for STL string
#include <cassert> // for assert()
......@@ -65,7 +65,7 @@ public:
int Index;
int Level;
int ParentId;
vtkstd::vector< int > ChildrenIds;
std::vector< int > ChildrenIds;
int MinParentWiseIds[3];
int MaxParentWiseIds[3];
......@@ -81,12 +81,12 @@ public:
double MaxBounds[3];
double SubdivisionRatio[3];
vtkstd::string BlockFileName;
vtkstd::string ParticleFileName;
std::string BlockFileName;
std::string ParticleFileName;
void Init();
void GetParentWiseIds( vtkstd::vector< vtkEnzoReaderBlock > & blocks );
void GetLevelBasedIds( vtkstd::vector< vtkEnzoReaderBlock > & blocks );
void GetParentWiseIds( std::vector< vtkEnzoReaderBlock > & blocks );
void GetLevelBasedIds( std::vector< vtkEnzoReaderBlock > & blocks );
};
......@@ -121,14 +121,14 @@ public:
vtkDataArray * DataArray;
// vtkAMREnzoReader * TheReader;
vtkstd::string DirectoryName;
vtkstd::string MajorFileName;
vtkstd::string BoundaryFileName;
vtkstd::string HierarchyFileName;
vtkstd::vector< vtkstd::string > BlockAttributeNames;
vtkstd::vector< vtkstd::string > ParticleAttributeNames;
vtkstd::vector< vtkstd::string > TracerParticleAttributeNames;
vtkstd::vector< vtkEnzoReaderBlock > Blocks;
std::string DirectoryName;
std::string MajorFileName;
std::string BoundaryFileName;
std::string HierarchyFileName;
std::vector< std::string > BlockAttributeNames;
std::vector< std::string > ParticleAttributeNames;
std::vector< std::string > TracerParticleAttributeNames;
std::vector< vtkEnzoReaderBlock > Blocks;
void Init();
void ReleaseDataArray();
......
......@@ -33,8 +33,8 @@
#include "vtkUnsignedShortArray.h"
#include <cassert>
#include <vtkstd/vector>
#include <vtkstd/map>
#include <vector>
#include <map>
#define H5_USE_16_API
#include <hdf5.h>
......
......@@ -30,9 +30,9 @@ void vtkFlashReaderInternal::GetBlockAttribute(
}
// remove the prefix ("mesh_blockandlevel/" or "mesh_blockandproc/") to get
// the actual attribute name
vtkstd::string tempName = atribute;
std::string tempName = atribute;
size_t slashPos = tempName.find( "/" );
vtkstd::string attrName = tempName.substr ( slashPos + 1 );
std::string attrName = tempName.substr ( slashPos + 1 );
hid_t dataIndx = H5Dopen
( this->FileIndex, attrName.c_str() );
......@@ -316,7 +316,7 @@ void vtkFlashReaderInternal::ReadProcessorIds()
}
hsize_t objIndex;
vtkstd::string sObjName = "processor number";
std::string sObjName = "processor number";
char namefromfile[17];
for ( objIndex = 0; objIndex < numbObjs; objIndex ++ )
{
......@@ -324,7 +324,7 @@ void vtkFlashReaderInternal::ReadProcessorIds()
if ( objsize == 16 )
{
H5Gget_objname_by_idx( rootIndx, objIndex, namefromfile, 17 );
vtkstd::string tempstr = namefromfile;
std::string tempstr = namefromfile;
if ( tempstr == sObjName ) // if this file contains processor numbers
{
this->HaveProcessorsInfo = 1;
......@@ -1396,7 +1396,7 @@ void vtkFlashReaderInternal::ReadParticleAttributes()
for ( int i = 0; i < numMembers; i ++ )
{
char * member_name = H5Tget_member_name( point_raw_type, i );
vtkstd::string nice_name = GetSeparatedParticleName( member_name );
std::string nice_name = GetSeparatedParticleName( member_name );
hid_t member_raw_type = H5Tget_member_type( point_raw_type, i );
hid_t member_type = H5Tget_native_type( member_raw_type, H5T_DIR_ASCEND );
int index = (int)(this->ParticleAttributeTypes.size());
......@@ -1515,13 +1515,13 @@ void vtkFlashReaderInternal::ReadParticleAttributesFLASH3()
H5Dread( pnameId, string24, H5S_ALL, H5S_ALL, H5P_DEFAULT, cnames );
// Convert the single string to individual variable names.
vtkstd::string snames( cnames );
std::string snames( cnames );
delete[] cnames;
cnames = NULL;
for ( int i = 0; i < numNames; i ++ )
{
vtkstd::string name = snames.substr( i * 24, 24 );
std::string name = snames.substr( i * 24, 24 );
int sp = (int)(name.find_first_of(' '));
if ( sp < 24 )
......@@ -1534,7 +1534,7 @@ void vtkFlashReaderInternal::ReadParticleAttributesFLASH3()
name != "particle_z"
)
{
vtkstd::string nice_name = GetSeparatedParticleName( name );
std::string nice_name = GetSeparatedParticleName( name );
this->ParticleAttributeTypes.push_back( H5T_NATIVE_DOUBLE );
this->ParticleAttributeNames.push_back( name );
this->ParticleAttributeNamesToIds[ nice_name ] = i;
......
......@@ -24,10 +24,10 @@
#define VTKAMRFLASHREADERINTERNAL_HPP_
#include <cassert>
#include <vtkstd/vector>
#include <vtkstd/map>
#include <vector>
#include <map>
#include <cstring>
#include <vtkstd/string>
#include <string>
#include "vtkSetGet.h"
#include "vtkDataSet.h"
......@@ -105,17 +105,17 @@ typedef struct tagFlashReaderSimulationInformation
char BuildTimeStamp[80];
} FlashReaderSimulationInformation;
static vtkstd::string GetSeparatedParticleName( const vtkstd::string & variable )
static std::string GetSeparatedParticleName( const std::string & variable )
{
vtkstd::string sepaName = variable;
std::string sepaName = variable;
if ( sepaName.length() > 9 && sepaName.substr(0,9) == "particle_" )
{
sepaName = vtkstd::string( "Particles/" ) + sepaName.substr( 9 );
sepaName = std::string( "Particles/" ) + sepaName.substr( 9 );
}
else
{
sepaName = vtkstd::string( "Particles/" ) + sepaName;
sepaName = std::string( "Particles/" ) + sepaName;
}
return sepaName;
......@@ -154,15 +154,15 @@ public:
FlashReaderSimulationInformation SimulationInformation; // CFD simulation
// blocks
vtkstd::vector< Block > Blocks;
vtkstd::vector< int > LeafBlocks;
vtkstd::vector< vtkstd::string > AttributeNames;
std::vector< Block > Blocks;
std::vector< int > LeafBlocks;
std::vector< std::string > AttributeNames;
// particles
vtkstd::string ParticleName;
vtkstd::vector< hid_t > ParticleAttributeTypes;
vtkstd::vector< vtkstd::string > ParticleAttributeNames;
vtkstd::map< vtkstd::string, int > ParticleAttributeNamesToIds;
std::string ParticleName;
std::vector< hid_t > ParticleAttributeTypes;
std::vector< std::string > ParticleAttributeNames;
std::map< std::string, int > ParticleAttributeNamesToIds;
int GetCycle();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment