Commit d83abee4 authored by Robert Maynard's avatar Robert Maynard
Browse files

ENH: Removed the use of vtkstd

The vtkstd forwarding headers are deprecated, move to using the STL
headers directly.
parent e330b535
......@@ -39,7 +39,7 @@
#include "vtkXdmfReader.h"
#include "vtkXdmfReaderInternal.h"
#include <vtkstd/deque>
#include <deque>
#include <assert.h>
static void vtkScaleExtents(int in_exts[6], int out_exts[6], int stride[3])
......@@ -214,7 +214,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadTemporalCollection(
// sub-grids for a time-step since that changes the composite data hierarchy
// over time which makes it hard to use filters such as vtkExtractBlock etc.
vtkstd::deque<XdmfGrid*> valid_children;
std::deque<XdmfGrid*> valid_children;
for (XdmfInt32 cc=0; cc < xmfTemporalCollection->GetNumberOfChildren(); cc++)
{
XdmfGrid* child = xmfTemporalCollection->GetChild(cc);
......@@ -241,8 +241,8 @@ vtkDataObject* vtkXdmfHeavyData::ReadTemporalCollection(
return 0;
}
vtkstd::deque<vtkSmartPointer<vtkDataObject> > child_data_objects;
vtkstd::deque<XdmfGrid*>::iterator iter;
std::deque<vtkSmartPointer<vtkDataObject> > child_data_objects;
std::deque<XdmfGrid*>::iterator iter;
for (iter = valid_children.begin(); iter != valid_children.end(); ++iter)
{
vtkDataObject* childDO = this->ReadData(*iter);
......
......@@ -316,7 +316,7 @@ int vtkXdmfReader::RequestInformation(vtkInformation *, vtkInformationVector **,
outInfo->Set(vtkDataObject::SIL(), domain->GetSIL());
// * Publish time information.
vtkstd::vector<double> time_steps(domain->GetTimeSteps().begin(),
std::vector<double> time_steps(domain->GetTimeSteps().begin(),
domain->GetTimeSteps().end());
if (time_steps.size() > 0)
......
......@@ -65,7 +65,7 @@ bool vtkXdmfDocument::Parse(const char* xmffilename)
delete [] this->LastReadContents;
this->LastReadContents = 0;
this->LastReadContentsLength = 0;
this->LastReadFilename = vtkstd::string();
this->LastReadFilename = std::string();
this->XMLDOM.SetInputFileName(xmffilename);
if (!this->XMLDOM.Parse())
......@@ -74,7 +74,7 @@ bool vtkXdmfDocument::Parse(const char* xmffilename)
}
//Tell the parser what the working directory is.
vtkstd::string directory =
std::string directory =
vtksys::SystemTools::GetFilenamePath(xmffilename) + "/";
if (directory == "/")
{
......@@ -107,7 +107,7 @@ bool vtkXdmfDocument::ParseString(const char* xmfdata, size_t length)
delete this->LastReadContents;
this->LastReadContentsLength = 0;
this->LastReadFilename = vtkstd::string();
this->LastReadFilename = std::string();
this->LastReadContents = new char[length+1];
this->LastReadContentsLength = length;
......@@ -323,7 +323,7 @@ int vtkXdmfDomain::GetVTKDataType(XdmfGrid* xmfGrid)
//----------------------------------------------------------------------------
int vtkXdmfDomain::GetIndexForTime(double time)
{
vtkstd::set<XdmfFloat64>::iterator iter = this->TimeSteps.upper_bound(time);
std::set<XdmfFloat64>::iterator iter = this->TimeSteps.upper_bound(time);
if (iter == this->TimeSteps.begin())
{
// The requested time step is before any available time. We will use it by
......@@ -335,7 +335,7 @@ int vtkXdmfDomain::GetIndexForTime(double time)
iter--;
}
vtkstd::set<XdmfFloat64>::iterator iter2 = this->TimeSteps.begin();
std::set<XdmfFloat64>::iterator iter2 = this->TimeSteps.begin();
int counter = 0;
while (iter2 != iter)
{
......@@ -554,8 +554,8 @@ void vtkXdmfDomain::CollectMetaData()
{
XdmfGrid * xmfGrid = &this->XMFGrids[cc];
vtkstd::string originalGridName = xmfGrid->GetName();
vtkstd::string gridName = xmfGrid->GetName();
std::string originalGridName = xmfGrid->GetName();
std::string gridName = xmfGrid->GetName();
unsigned int count=1;
while (this->Grids->HasArray(gridName.c_str()))
{
......@@ -651,8 +651,8 @@ void vtkXdmfDomain::CollectLeafMetaData(XdmfGrid* xmfGrid, vtkIdType silParent)
if (silParent != -1 &&
this->GridsOverflowCounter < MAX_COLLECTABLE_NUMBER_OF_GRIDS)
{
vtkstd::string originalGridName = xmfGrid->GetName();
vtkstd::string gridName = xmfGrid->GetName();
std::string originalGridName = xmfGrid->GetName();
std::string gridName = xmfGrid->GetName();
unsigned int count=1;
while (this->Grids->HasArray(gridName.c_str()))
{
......
......@@ -41,10 +41,10 @@
#include "XdmfTime.h"
#include "XdmfSet.h"
#include <vtkstd/string>
#include <vtkstd/vector>
#include <vtkstd/set>
#include <vtkstd/map>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <vtksys/SystemTools.hxx>
#include <assert.h>
#include <functional>
......@@ -66,7 +66,7 @@ public:
//---------------------------------------------------------------------------
// Description:
// Returns the names for available domains.
const vtkstd::vector<vtkstd::string>& GetDomains()
const std::vector<std::string>& GetDomains()
{ return this->Domains; }
//---------------------------------------------------------------------------
......@@ -96,16 +96,16 @@ private:
int ActiveDomainIndex;
XdmfDOM XMLDOM;
vtkXdmfDomain* ActiveDomain;
vtkstd::vector<vtkstd::string> Domains;
std::vector<std::string> Domains;
char* LastReadContents;
size_t LastReadContentsLength;
vtkstd::string LastReadFilename;
std::string LastReadFilename;
};
// I don't use vtkDataArraySelection since it's very slow when it comes to large
// number of arrays.
class vtkXdmfArraySelection : public vtkstd::map<vtkstd::string, bool>
class vtkXdmfArraySelection : public std::map<std::string, bool>
{
public:
void Merge(const vtkXdmfArraySelection& other)
......@@ -185,9 +185,9 @@ private:
unsigned int GridsOverflowCounter;
// these are node indices used when building the SIL.
vtkIdType SILBlocksRoot;
vtkstd::map<vtkstd::string, vtkIdType> GridCenteredAttrbuteRoots;
vtkstd::map<vtkIdType,
vtkstd::map<XdmfInt64, vtkIdType> > GridCenteredAttrbuteValues;
std::map<std::string, vtkIdType> GridCenteredAttrbuteRoots;
std::map<vtkIdType,
std::map<XdmfInt64, vtkIdType> > GridCenteredAttrbuteValues;
vtkSILBuilder* SILBuilder;
vtkMutableDirectedGraph* SIL;
......@@ -195,7 +195,7 @@ private:
vtkXdmfArraySelection* CellArrays;
vtkXdmfArraySelection* Grids;
vtkXdmfArraySelection* Sets;
vtkstd::set<XdmfFloat64> TimeSteps; //< Only discrete timesteps are currently
std::set<XdmfFloat64> TimeSteps; //< Only discrete timesteps are currently
// supported.
public:
......@@ -236,7 +236,7 @@ public:
//---------------------------------------------------------------------------
// Description:
// Returns the timesteps.
const vtkstd::set<XdmfFloat64>& GetTimeSteps()
const std::set<XdmfFloat64>& GetTimeSteps()
{ return this->TimeSteps; }
//---------------------------------------------------------------------------
......@@ -249,7 +249,7 @@ public:
// Returns the time value at the given index.
XdmfFloat64 GetTimeForIndex(int index)
{
vtkstd::set<XdmfFloat64>::iterator iter;
std::set<XdmfFloat64>::iterator iter;
int cc=0;
for (iter = this->TimeSteps.begin(); iter != this->TimeSteps.end();
iter++, cc++)
......
......@@ -52,11 +52,11 @@
#include "XdmfRoot.h"
#include "XdmfTime.h"
#include "XdmfTopology.h"
#include <vtkstd/vector>
#include <vtkstd/map>
#include <vtkstd/algorithm>
#include <vector>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <libxml/tree.h> // always after vtkstd::blah stuff
#include <libxml/tree.h> // always after std::blah stuff
#if defined(_WIN32) && !defined(__CYGWIN__)
# define SNPRINTF _snprintf
......@@ -73,7 +73,7 @@ class vtkXdmfWriterDomainMemoryHandler
}
~vtkXdmfWriterDomainMemoryHandler()
{
for(vtkstd::vector<XdmfGrid*>::iterator iter = domainGrids.begin(); iter != domainGrids.end(); ++iter)
for(std::vector<XdmfGrid*>::iterator iter = domainGrids.begin(); iter != domainGrids.end(); ++iter)
{
delete *iter;
}
......@@ -90,7 +90,7 @@ class vtkXdmfWriterDomainMemoryHandler
}
private:
XdmfDomain* domain;
vtkstd::vector<XdmfGrid*> domainGrids;
std::vector<XdmfGrid*> domainGrids;
};
//==============================================================================
......@@ -120,7 +120,7 @@ struct vtkXdmfWriterInternal
}
};
typedef vtkstd::map<CellType, vtkSmartPointer<vtkIdList> > MapOfCellTypes;
typedef std::map<CellType, vtkSmartPointer<vtkIdList> > MapOfCellTypes;
static void DetermineCellTypes(vtkPointSet *t, MapOfCellTypes& vec);
};
......@@ -483,10 +483,10 @@ void vtkXdmfWriter::CreateTopology(vtkDataSet *ds, XdmfGrid *grid, vtkIdType PDi
grid->SetGridType(XDMF_GRID_UNIFORM);
const char *heavyName = NULL;
vtkstd::string heavyDataSetName;
std::string heavyDataSetName;
if (this->HeavyDataFileName)
{
heavyDataSetName = vtkstd::string(this->HeavyDataFileName) + ":";
heavyDataSetName = std::string(this->HeavyDataFileName) + ":";
if (this->HeavyDataGroupName)
{
heavyDataSetName = heavyDataSetName + HeavyDataGroupName + "/Topology";
......@@ -843,10 +843,10 @@ void vtkXdmfWriter::CreateGeometry(vtkDataSet *ds, XdmfGrid *grid, void *staticd
geo->SetLightDataLimit(this->LightDataLimit);
const char *heavyName = NULL;
vtkstd::string heavyDataSetName;
std::string heavyDataSetName;
if (this->HeavyDataFileName)
{
heavyDataSetName = vtkstd::string(this->HeavyDataFileName) + ":";
heavyDataSetName = std::string(this->HeavyDataFileName) + ":";
if (this->HeavyDataGroupName)
{
heavyDataSetName = heavyDataSetName + HeavyDataGroupName + "/Geometry";
......@@ -969,13 +969,13 @@ void vtkXdmfWriter::WriteArrays(vtkFieldData* fd, XdmfGrid *grid, int associatio
vtkDataSetAttributes *dsa = vtkDataSetAttributes::SafeDownCast(fd);
const char *heavyName = NULL;
vtkstd::string heavyDataSetName;
std::string heavyDataSetName;
if (this->HeavyDataFileName)
{
heavyDataSetName = vtkstd::string(this->HeavyDataFileName) + ":";
heavyDataSetName = std::string(this->HeavyDataFileName) + ":";
if (this->HeavyDataGroupName)
{
heavyDataSetName = heavyDataSetName + vtkstd::string(HeavyDataGroupName) + "/" + name;
heavyDataSetName = heavyDataSetName + std::string(HeavyDataGroupName) + "/" + name;
}
heavyName = heavyDataSetName.c_str();
}
......@@ -983,12 +983,12 @@ void vtkXdmfWriter::WriteArrays(vtkFieldData* fd, XdmfGrid *grid, int associatio
//
// Sort alphabetically to avoid potential bad ordering problems
//
vtkstd::vector<vtkstd::string> AttributeNames;
std::vector<std::string> AttributeNames;
for (int i=0; i<fd->GetNumberOfArrays(); i++) {
vtkDataArray *scalars = fd->GetArray(i);
AttributeNames.push_back(scalars->GetName());
}
vtkstd::sort(AttributeNames.begin(), AttributeNames.end());
std::sort(AttributeNames.begin(), AttributeNames.end());
for (unsigned int i = 0; i < AttributeNames.size(); i++)
{
......@@ -1134,7 +1134,7 @@ void vtkXdmfWriter::ConvertVToXArray(vtkDataArray *vda,
}
if (heavyprefix) {
vtkstd::string dsname = vtkstd::string(heavyprefix) + "/" + vtkstd::string(vda->GetName());
std::string dsname = std::string(heavyprefix) + "/" + std::string(vda->GetName());
xda->SetHeavyDataSetName(dsname.c_str());
}
......
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