Updates will be applied - 12:30pm EDT (UTC -400). Site will be down for around 30

Commit 5d3c7d68 authored by Joachim Pouderoux's avatar Joachim Pouderoux

code cleaning

parent 54f52ce1
......@@ -385,29 +385,29 @@ vtkDataObject* vtkXdmfHeavyData::ReadUniformData(XdmfGrid* xmfGrid, int blockId)
switch (vtk_data_type)
{
case VTK_UNIFORM_GRID:
dataObject = this->RequestImageData(xmfGrid, true);
break;
case VTK_UNIFORM_GRID:
dataObject = this->RequestImageData(xmfGrid, true);
break;
case VTK_IMAGE_DATA:
dataObject = this->RequestImageData(xmfGrid, false);
break;
case VTK_IMAGE_DATA:
dataObject = this->RequestImageData(xmfGrid, false);
break;
case VTK_STRUCTURED_GRID:
dataObject = this->RequestStructuredGrid(xmfGrid);
break;
case VTK_STRUCTURED_GRID:
dataObject = this->RequestStructuredGrid(xmfGrid);
break;
case VTK_RECTILINEAR_GRID:
dataObject = this->RequestRectilinearGrid(xmfGrid);
break;
case VTK_RECTILINEAR_GRID:
dataObject = this->RequestRectilinearGrid(xmfGrid);
break;
case VTK_UNSTRUCTURED_GRID:
dataObject = this->ReadUnstructuredGrid(xmfGrid);
break;
case VTK_UNSTRUCTURED_GRID:
dataObject = this->ReadUnstructuredGrid(xmfGrid);
break;
default:
// un-handled case.
return 0;
default:
// un-handled case.
return 0;
}
if (caching)
......
......@@ -321,15 +321,14 @@ int vtkXdmfReader::RequestInformation(vtkInformation *, vtkInformationVector **,
// * Publish the SIL which provides information about the grid hierarchy.
outInfo->Set(vtkDataObject::SIL(), domain->GetSIL());
// * Publish time information.
const std::map<int, XdmfFloat64>& ts = domain->GetTimeStepsRev();
std::vector<double> time_steps(ts.size());
std::map<int, XdmfFloat64>::const_iterator it = ts.begin();
for (int i = 0; it != ts.end(); i++, ++it)
{
time_steps[i] = it->second;
// * Publish time information.
/*std::vector<double> time_steps(domain->GetTimeSteps().begin(),
domain->GetTimeSteps().end());*/
}
if (time_steps.size() > 0)
{
......@@ -629,7 +628,6 @@ vtkGraph* vtkXdmfReader::GetSIL()
return 0;
}
//----------------------------------------------------------------------------
void vtkXdmfReader::ClearDataSetCache()
{
......
......@@ -218,7 +218,7 @@ vtkXdmfDomain::vtkXdmfDomain(XdmfDOM* xmlDom, int domain_index)
this->NumberOfGrids = this->XMLDOM->FindNumberOfElements("Grid", this->XMLDomain);
this->XMFGrids = new XdmfGrid[this->NumberOfGrids+1];
XdmfXmlNode xmlGrid = this->XMLDOM->FindElement("Grid", 0, this->XMLDomain);
XdmfXmlNode xmlGrid = this->XMLDOM->FindElement("Grid", 0, this->XMLDomain);
XdmfInt64 cc=0;
while (xmlGrid)
{
......@@ -297,14 +297,14 @@ int vtkXdmfDomain::GetVTKDataType(XdmfGrid* xmfGrid)
{
return VTK_MULTIBLOCK_DATA_SET;
}
if (xmfGrid->GetTopology()->GetClass() == XDMF_UNSTRUCTURED )
if (xmfGrid->GetTopology()->GetClass() == XDMF_UNSTRUCTURED )
{
return VTK_UNSTRUCTURED_GRID;
}
}
XdmfInt32 topologyType = xmfGrid->GetTopology()->GetTopologyType();
if (topologyType == XDMF_2DSMESH || topologyType == XDMF_3DSMESH )
{
return VTK_STRUCTURED_GRID;
{
return VTK_STRUCTURED_GRID;
}
else if (topologyType == XDMF_2DCORECTMESH ||
topologyType == XDMF_3DCORECTMESH)
......@@ -327,9 +327,9 @@ int vtkXdmfDomain::GetIndexForTime(double time)
{
std::map<XdmfFloat64, int>::const_iterator iter = this->TimeSteps.find(time);
if (iter != this->TimeSteps.end())
{
{
return iter->second;
}
}
iter = this->TimeSteps.upper_bound(time);
if (iter == this->TimeSteps.begin())
......@@ -443,7 +443,7 @@ bool vtkXdmfDomain::GetOriginAndSpacing(XdmfGrid* xmfGrid,
XdmfGeometry *xmfGeometry = xmfGrid->GetGeometry();
if (xmfGeometry->GetGeometryType() == XDMF_GEOMETRY_ORIGIN_DXDYDZ )
{
{
// Update geometry so that origin and spacing are read
xmfGeometry->Update(); // read heavy-data for the geometry.
XdmfFloat64 *xmfOrigin = xmfGeometry->GetOrigin();
......@@ -548,7 +548,7 @@ void vtkXdmfDomain::CollectMetaData()
this->Grids->clear();
// We have aborted collecting grids information since it was too numerous to
// be of any use to the user.
// be of any use to the user.
this->SILBuilder->Initialize();
blocksRoot = this->SILBuilder->AddVertex("Blocks");
hierarchyRoot = this->SILBuilder->AddVertex("Hierarchy");
......@@ -629,7 +629,7 @@ void vtkXdmfDomain::CollectNonLeafMetaData(XdmfGrid* xmfGrid,
XdmfInt32 numChildren = xmfGrid->GetNumberOfChildren();
for (XdmfInt32 cc=0; cc < numChildren; cc++)
{
XdmfGrid* xmfChild = xmfGrid->GetChild(cc);
XdmfGrid* xmfChild = xmfGrid->GetChild(cc);
this->CollectMetaData(xmfChild, silVertex);
}
......@@ -730,7 +730,7 @@ void vtkXdmfDomain::CollectLeafMetaData(XdmfGrid* xmfGrid, vtkIdType silParent)
// XdmfInt32 setCenter = xmfSet->GetSetType();
// Not sure if we want to create separate lists for different types of sets
// or just treat all the sets as same. For now, we are treating them as
// or just treat all the sets as same. For now, we are treating them as
// the same.
this->Sets->AddArray(name);
}
......
......@@ -261,19 +261,7 @@ public:
XdmfFloat64 GetTimeForIndex(int index)
{
std::map<int, XdmfFloat64>::iterator iter = this->TimeStepsRev.find(index);
/*int cc=0;
for (iter = this->TimeSteps.begin(); iter != this->TimeSteps.end();
iter++, cc++)
{
if (cc == index)
{
return *iter;
}
}*/
if (iter != this->TimeStepsRev.end())
return iter->second;
// invalid index.
return 0.0;
return (iter != this->TimeStepsRev.end()) ? iter->second : 0.0;
}
//---------------------------------------------------------------------------
......
......@@ -41,6 +41,7 @@
#include "vtkStructuredGrid.h"
#include "vtkTypeTraits.h"
#include "vtkUnstructuredGrid.h"
#include "vtksys/SystemTools.hxx"
#include "XdmfArray.h"
#include "XdmfAttribute.h"
......@@ -53,8 +54,6 @@
#include "XdmfTime.h"
#include "XdmfTopology.h"
#include "vtksys/SystemTools.hxx"
#include <algorithm>
#include <map>
#include <stdio.h>
......@@ -417,7 +416,6 @@ int vtkXdmfWriter::RequestData(
}
this->LightDataLimit = lightDataLimit;
return 1;
}
......
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