Commit c8ab6a00 authored by Yuanxin Liu's avatar Yuanxin Liu
Browse files

Fix build errors from compiling examples

Also makes a few clean up changes.

Change-Id: I12c2fa1a43ddad274388b7bc02dadc8d7dc8aeea
parent 7aaa6e90
......@@ -191,9 +191,9 @@ bool vtkAMRInformation::IsValid()
void vtkAMRInformation::Initialize(int numLevels, int* blocksPerLevel)
{
if(numLevels<=0)
if(numLevels<0)
{
vtkErrorMacro("Number of levels must be at least 1: "<<numLevels);
vtkErrorMacro("Number of levels must be at least 0: "<<numLevels);
return;
}
// allocate boxes
......
......@@ -95,13 +95,6 @@ public:
// is valid only after the pipeline has updated.
virtual unsigned long GetActualMemorySize();
/* //BTX */
/* // Description: */
/* // Retrieve an instance of this class from an information object. */
/* static vtkCompositeDataSet* GetData(vtkInformation* info); */
/* static vtkCompositeDataSet* GetData(vtkInformationVector* v, int i=0); */
/* //ETX */
// Description:
// Restore data object to initial state,
virtual void Initialize();
......@@ -117,17 +110,6 @@ public:
// might be expansive.
virtual vtkIdType GetNumberOfPoints();
// virtual void SetSourceIndex(int i);
/* // Description: */
/* // COMPOSITE_INDEX() is added to the leaf nodes of the meta-data composite */
/* // dataset (COMPOSITE_DATA_META_DATA) during REQUEST_INFORMATION(). Filters */
/* // downstream can use this index to request specific datasets when */
/* // creating UPDATE_COMPOSITE_INDICES(). */
/* // *** THIS IS AN EXPERIMENTAL FEATURE. IT MAY CHANGE WITHOUT NOTICE *** */
/* static vtkInformationIntegerKey* COMPOSITE_INDEX(); */
//BTX
protected:
vtkDataObjectTree();
......
......@@ -85,23 +85,23 @@ vtkCompositeDataIterator* vtkUniformGridAMR::NewIterator()
//----------------------------------------------------------------------------
void vtkUniformGridAMR::Initialize()
{
vtkSmartPointer<vtkAMRInformation> amrInfo =vtkSmartPointer<vtkAMRInformation>::New();
this->SetAMRInfo(amrInfo);
this->AMRData->Initialize();
this->Initialize(0,NULL);
}
//----------------------------------------------------------------------------
void vtkUniformGridAMR::Initialize(int numLevels, int * blocksPerLevel)
{
this->Bounds[0] = VTK_DOUBLE_MAX;
this->Bounds[1] = VTK_DOUBLE_MIN;
this->Bounds[2] = VTK_DOUBLE_MAX;
this->Bounds[3] = VTK_DOUBLE_MIN;
this->Bounds[4] = VTK_DOUBLE_MAX;
this->Bounds[5] = VTK_DOUBLE_MIN;
}
//----------------------------------------------------------------------------
void vtkUniformGridAMR::Initialize(int numLevels, int * blocksPerLevel)
{
this->Initialize();
vtkSmartPointer<vtkAMRInformation> amrInfo =vtkSmartPointer<vtkAMRInformation>::New();
this->SetAMRInfo(amrInfo);
this->AMRInfo->Initialize(numLevels, blocksPerLevel);
this->AMRData->Initialize();
}
//----------------------------------------------------------------------------
......@@ -132,6 +132,11 @@ void vtkUniformGridAMR::SetDataSet(
{
return; //NULL gird, nothing to do
}
if(level>=this->GetNumberOfLevels() || idx >=this->GetNumberOfDataSets(level))
{
vtkErrorMacro("Invalid data set index: "<<level<<" "<<idx);
return;
}
this->AMRInfo->SetGridDescription(grid->GetGridDescription());
int index = this->AMRInfo->GetIndex(level,idx);
......
......@@ -166,7 +166,6 @@ vtkHierarchicalBoxDataSet* GetAMRDataSet()
data->SetDataSet( level, blockId,grid3);
grid3->Delete();
vtkAMRUtilities::GenerateMetaData( data, NULL );
data->GenerateVisibilityArrays();
return( data );
}
......@@ -125,7 +125,9 @@ void WriteAMRData( vtkHierarchicalBoxDataSet *amrData, std::string prefix )
vtkHierarchicalBoxDataSet* GetAMRDataSet()
{
vtkHierarchicalBoxDataSet *data = vtkHierarchicalBoxDataSet::New();
data->Initialize();
int blocksPerLevel[2] = {1,3};
double globalOrigin[3] = {-2.0,-2.0,-2.0};
data->Initialize(2,blocksPerLevel,globalOrigin,VTK_XYZ_GRID);
double origin[3];
double h[3];
......@@ -173,7 +175,6 @@ vtkHierarchicalBoxDataSet* GetAMRDataSet()
data->SetDataSet( level, blockId,grid3);
grid3->Delete();
vtkAMRUtilities::GenerateMetaData( data, NULL );
data->GenerateVisibilityArrays();
return( data );
}
......
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