Commit 0b76a9d0 authored by Ken Martin's avatar Ken Martin
Browse files

some 64 bit support from Mathieu

parent 14c2b801
......@@ -21,7 +21,7 @@
#include "vtkEmptyCell.h"
#include "vtkGenericCell.h"
#include "vtkHexahedron.h"
#include "vtkIntArray.h"
#include "vtkIdTypeArray.h"
#include "vtkLine.h"
#include "vtkObjectFactory.h"
#include "vtkPixel.h"
......@@ -44,7 +44,7 @@
#include "vtkVoxel.h"
#include "vtkWedge.h"
vtkCxxRevisionMacro(vtkUnstructuredGrid, "1.116");
vtkCxxRevisionMacro(vtkUnstructuredGrid, "1.116.2.1");
vtkStandardNewMacro(vtkUnstructuredGrid);
vtkUnstructuredGrid::vtkUnstructuredGrid ()
......@@ -113,7 +113,7 @@ void vtkUnstructuredGrid::Allocate (vtkIdType numCells, int extSize)
{
this->Locations->UnRegister(this);
}
this->Locations = vtkIntArray::New();
this->Locations = vtkIdTypeArray::New();
this->Locations->Allocate(numCells,extSize);
this->Locations->Register(this);
this->Locations->Delete();
......@@ -480,7 +480,7 @@ void vtkUnstructuredGrid::SetCells(int type, vtkCellArray *cells)
{
this->Locations->UnRegister(this);
}
this->Locations = vtkIntArray::New();
this->Locations = vtkIdTypeArray::New();
this->Locations->Allocate(cells->GetNumberOfCells(),1000);
this->Locations->Register(this);
this->Locations->Delete();
......@@ -525,7 +525,7 @@ void vtkUnstructuredGrid::SetCells(int *types, vtkCellArray *cells)
{
this->Locations->UnRegister(this);
}
this->Locations = vtkIntArray::New();
this->Locations = vtkIdTypeArray::New();
this->Locations->Allocate(cells->GetNumberOfCells(),1000);
this->Locations->Register(this);
this->Locations->Delete();
......@@ -540,7 +540,7 @@ void vtkUnstructuredGrid::SetCells(int *types, vtkCellArray *cells)
void vtkUnstructuredGrid::SetCells(vtkUnsignedCharArray *cellTypes,
vtkIntArray *cellLocations,
vtkIdTypeArray *cellLocations,
vtkCellArray *cells)
{
// set cell array
......@@ -891,7 +891,7 @@ void vtkUnstructuredGrid::DeepCopy(vtkDataObject *dataObject)
}
if (grid->Locations)
{
this->Locations = vtkIntArray::New();
this->Locations = vtkIdTypeArray::New();
this->Locations->DeepCopy(grid->Locations);
this->Locations->Register(this);
this->Locations->Delete();
......@@ -1008,7 +1008,7 @@ int vtkUnstructuredGrid::IsHomogeneous()
}
// Fill container with indices of cells which match given type.
void vtkUnstructuredGrid::GetIdsOfCellsOfType(int type, vtkIntArray *array)
void vtkUnstructuredGrid::GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)
{
for (int cellId = 0; cellId < this->GetNumberOfCells(); cellId++)
{
......
......@@ -30,7 +30,7 @@ class vtkConvexPointSet;
class vtkEmptyCell;
class vtkHexahedron;
class vtkIdList;
class vtkIntArray;
class vtkIdTypeArray;
class vtkLine;
class vtkPixel;
class vtkPolyLine;
......@@ -78,7 +78,7 @@ public:
int GetCellType(vtkIdType cellId);
vtkUnsignedCharArray* GetCellTypesArray() { return this->Types; }
vtkIntArray* GetCellLocationsArray() { return this->Locations; }
vtkIdTypeArray* GetCellLocationsArray() { return this->Locations; }
void Squeeze();
void Initialize();
int GetMaxCellSize();
......@@ -92,7 +92,7 @@ public:
// composing the dataset.
void SetCells(int type, vtkCellArray *cells);
void SetCells(int *types, vtkCellArray *cells);
void SetCells(vtkUnsignedCharArray *cellTypes, vtkIntArray *cellLocations,
void SetCells(vtkUnsignedCharArray *cellTypes, vtkIdTypeArray *cellLocations,
vtkCellArray *cells);
vtkCellArray *GetCells() {return this->Connectivity;};
void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts);
......@@ -156,10 +156,10 @@ public:
virtual void DeepCopy(vtkDataObject *src);
// Description:
// Fill vtkIntArray container with list of cell Ids. This
// Fill vtkIdTypeArray container with list of cell Ids. This
// method traverses all cells and, for a particular cell type,
// inserts the cell Id into the container.
void GetIdsOfCellsOfType(int type, vtkIntArray *array);
void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array);
// Description:
// Traverse cells and determine if cells are all of the same type.
......@@ -202,7 +202,7 @@ protected:
vtkCellArray *Connectivity;
vtkCellLinks *Links;
vtkUnsignedCharArray *Types;
vtkIntArray *Locations;
vtkIdTypeArray *Locations;
private:
// Hide these from the user and the compiler.
......
......@@ -30,7 +30,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkClipDataSet, "1.32");
vtkCxxRevisionMacro(vtkClipDataSet, "1.32.2.1");
vtkStandardNewMacro(vtkClipDataSet);
vtkCxxSetObjectMacro(vtkClipDataSet,ClipFunction,vtkImplicitFunction);
......@@ -140,7 +140,7 @@ void vtkClipDataSet::Execute()
int j;
vtkIdType estimatedSize;
vtkUnsignedCharArray *types[2];
vtkIntArray *locs[2];
vtkIdTypeArray *locs[2];
int numOutputs = 1;
vtkDebugMacro(<< "Clipping dataset");
......@@ -196,7 +196,7 @@ void vtkClipDataSet::Execute()
conn[0]->InitTraversal();
types[0] = vtkUnsignedCharArray::New();
types[0]->Allocate(estimatedSize,estimatedSize/2);
locs[0] = vtkIntArray::New();
locs[0] = vtkIdTypeArray::New();
locs[0]->Allocate(estimatedSize,estimatedSize/2);
if ( this->GenerateClippedOutput )
{
......@@ -206,7 +206,7 @@ void vtkClipDataSet::Execute()
conn[1]->InitTraversal();
types[1] = vtkUnsignedCharArray::New();
types[1]->Allocate(estimatedSize,estimatedSize/2);
locs[1] = vtkIntArray::New();
locs[1] = vtkIdTypeArray::New();
locs[1]->Allocate(estimatedSize,estimatedSize/2);
}
newPoints = vtkPoints::New();
......
......@@ -27,10 +27,10 @@
#include "vtkGenericCell.h"
#include "vtkTetra.h"
#include "vtkCellArray.h"
#include "vtkIntArray.h"
#include "vtkIdTypeArray.h"
#include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro(vtkClipVolume, "1.64");
vtkCxxRevisionMacro(vtkClipVolume, "1.64.2.1");
vtkStandardNewMacro(vtkClipVolume);
vtkCxxSetObjectMacro(vtkClipVolume,ClipFunction,vtkImplicitFunction);
......@@ -119,7 +119,7 @@ void vtkClipVolume::Execute()
vtkUnstructuredGrid *output = this->GetOutput();
vtkUnstructuredGrid *clippedOutput = this->GetClippedOutput();
vtkCellArray *outputConn;
vtkIntArray *outputLoc;
vtkIdTypeArray *outputLoc;
vtkUnsignedCharArray *outputTypes;
vtkIdType cellId, newCellId, i;
int j, k, flip;
......@@ -183,7 +183,7 @@ void vtkClipVolume::Execute()
this->NumberOfCells = 0;
this->Connectivity = vtkCellArray::New();
this->Connectivity->Allocate(estimatedSize*2); //allocate storage for cells
this->Locations = vtkIntArray::New();
this->Locations = vtkIdTypeArray::New();
this->Locations->Allocate(estimatedSize);
this->Types = vtkUnsignedCharArray::New();
this->Types->Allocate(estimatedSize);
......@@ -242,7 +242,7 @@ void vtkClipVolume::Execute()
this->NumberOfClippedCells = 0;
this->ClippedConnectivity = vtkCellArray::New();
this->ClippedConnectivity->Allocate(estimatedSize); //storage for cells
this->ClippedLocations = vtkIntArray::New();
this->ClippedLocations = vtkIdTypeArray::New();
this->ClippedLocations->Allocate(estimatedSize);
this->ClippedTypes = vtkUnsignedCharArray::New();
this->ClippedTypes->Allocate(estimatedSize);
......
......@@ -73,7 +73,7 @@ class vtkUnstructuredGrid;
class vtkCell;
class vtkTetra;
class vtkCellArray;
class vtkIntArray;
class vtkIdTypeArray;
class vtkUnsignedCharArray;
class VTK_GRAPHICS_EXPORT vtkClipVolume : public vtkStructuredPointsToUnstructuredGridFilter
......@@ -196,11 +196,11 @@ private:
vtkIdType NumberOfCells;
vtkCellArray *Connectivity;
vtkUnsignedCharArray *Types;
vtkIntArray *Locations;
vtkIdTypeArray *Locations;
vtkIdType NumberOfClippedCells;
vtkCellArray *ClippedConnectivity;
vtkUnsignedCharArray *ClippedTypes;
vtkIntArray *ClippedLocations;
vtkIdTypeArray *ClippedLocations;
private:
vtkClipVolume(const vtkClipVolume&); // Not implemented.
......
......@@ -15,14 +15,14 @@
#include "vtkXMLPUnstructuredGridReader.h"
#include "vtkCellArray.h"
#include "vtkIntArray.h"
#include "vtkIdTypeArray.h"
#include "vtkObjectFactory.h"
#include "vtkUnsignedCharArray.h"
#include "vtkUnstructuredGrid.h"
#include "vtkXMLDataElement.h"
#include "vtkXMLUnstructuredGridReader.h"
vtkCxxRevisionMacro(vtkXMLPUnstructuredGridReader, "1.5");
vtkCxxRevisionMacro(vtkXMLPUnstructuredGridReader, "1.5.2.1");
vtkStandardNewMacro(vtkXMLPUnstructuredGridReader);
//----------------------------------------------------------------------------
......@@ -114,7 +114,7 @@ void vtkXMLPUnstructuredGridReader::SetupOutputData()
cellTypes->SetNumberOfTuples(this->GetNumberOfCells());
vtkCellArray* outCells = vtkCellArray::New();
vtkIntArray* locations = vtkIntArray::New();
vtkIdTypeArray* locations = vtkIdTypeArray::New();
locations->SetNumberOfTuples(this->GetNumberOfCells());
output->SetCells(cellTypes, locations, outCells);
......@@ -156,10 +156,10 @@ int vtkXMLPUnstructuredGridReader::ReadPieceData()
output->GetCells());
// Copy the cell locations with offset adjustment.
vtkIntArray* inLocations = input->GetCellLocationsArray();
vtkIntArray* outLocations = output->GetCellLocationsArray();
int* inLocs = inLocations->GetPointer(0);
int* outLocs = outLocations->GetPointer(this->StartCell);
vtkIdTypeArray* inLocations = input->GetCellLocationsArray();
vtkIdTypeArray* outLocations = output->GetCellLocationsArray();
vtkIdType* inLocs = inLocations->GetPointer(0);
vtkIdType* outLocs = outLocations->GetPointer(this->StartCell);
vtkIdType numCells = inLocations->GetNumberOfTuples();
vtkIdType i;
for(i=0;i < numCells; ++i)
......
......@@ -15,13 +15,13 @@
#include "vtkXMLUnstructuredGridReader.h"
#include "vtkCellArray.h"
#include "vtkIntArray.h"
#include "vtkIdTypeArray.h"
#include "vtkObjectFactory.h"
#include "vtkUnsignedCharArray.h"
#include "vtkUnstructuredGrid.h"
#include "vtkXMLDataElement.h"
vtkCxxRevisionMacro(vtkXMLUnstructuredGridReader, "1.6");
vtkCxxRevisionMacro(vtkXMLUnstructuredGridReader, "1.6.2.1");
vtkStandardNewMacro(vtkXMLUnstructuredGridReader);
//----------------------------------------------------------------------------
......@@ -141,7 +141,7 @@ void vtkXMLUnstructuredGridReader::SetupOutputData()
cellTypes->SetNumberOfTuples(this->GetNumberOfCells());
vtkCellArray* outCells = vtkCellArray::New();
vtkIntArray* locations = vtkIntArray::New();
vtkIdTypeArray* locations = vtkIdTypeArray::New();
locations->SetNumberOfTuples(this->GetNumberOfCells());
output->SetCells(cellTypes, locations, outCells);
......@@ -258,8 +258,8 @@ int vtkXMLUnstructuredGridReader::ReadPieceData()
}
// Construct the cell locations.
vtkIntArray* locations = output->GetCellLocationsArray();
int* locs = locations->GetPointer(this->StartCell);
vtkIdTypeArray* locations = output->GetCellLocationsArray();
vtkIdType* locs = locations->GetPointer(this->StartCell);
vtkIdType* begin = output->GetCells()->GetData()->GetPointer(startLoc);
vtkIdType* cur = begin;
vtkIdType i;
......
Supports Markdown
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