Commit a45a52a1 authored by Joachim Pouderoux's avatar Joachim Pouderoux
Browse files

Change the indexing of HyperTree and remove dead code & vars.

HT are now indexed in such a way that there is no more
dead index.
HTGSource in quadric mode use the GlobalIndexStart mode to
avoid the storage of the local to global node id per tree
(contrary to descriptor/mask sources which use a BSF global
indexing mode, quadric nodes are numberered on a per-tree
basis).

Also remove some no more used functions and vars.

Change-Id: Ie5fe5f267a22706334d883d330b8aa9bbb3926e2
parent c5873cf4
......@@ -19,14 +19,16 @@ PURPOSE. See the above copyright notice for more information.
#include <deque>
#include <vector>
#include <map>
#include <assert.h>
// Description:
// The template value N describes the number of children to binary and
// ternary trees.
template<int N> class vtkCompactHyperTree; // : public vtkHyperTree
template<int N> class vtkCompactHyperTree;
template<int N> class vtkCompactHyperTreeNode;
template<int N> class vtkCompactHyperTreeCursor : public vtkHyperTreeCursor
{
public:
......@@ -35,16 +37,10 @@ public:
static vtkCompactHyperTreeCursor<N>* New()
{
vtkObject* o = vtkObjectFactory::CreateInstance( "vtkCompactHyperTreeCursor<N>" );
if ( o )
{
return static_cast<vtkCompactHyperTreeCursor<N> *>( o );
}
else
{
return new vtkCompactHyperTreeCursor<N>;
}
vtkObject* o =
vtkObjectFactory::CreateInstance( "vtkCompactHyperTreeCursor<N>" );
return o ? static_cast<vtkCompactHyperTreeCursor<N> *>( o ) :
new vtkCompactHyperTreeCursor<N>();
}
//---------------------------------------------------------------------------
......@@ -117,7 +113,7 @@ public:
virtual int GetChildIndex()
{
assert( "post: valid_range" && this->ChildIndex >= 0 &&
this->ChildIndex<GetNumberOfChildren() );
this->ChildIndex < GetNumberOfChildren() );
return this->ChildIndex;
}
......@@ -159,7 +155,8 @@ public:
virtual void ToChild( int child )
{
assert( "pre: not_leaf" && !IsLeaf() );
assert( "pre: valid_child" && child >= 0 && child<this->GetNumberOfChildren() );
assert( "pre: valid_child" && child >= 0
&& child < this->GetNumberOfChildren() );
vtkCompactHyperTreeNode<N>* node = this->Tree->GetNode( this->Index );
this->ChildHistory.push_back( this->ChildIndex );
......@@ -213,7 +210,8 @@ public:
assert( "pre: other_exists" && other != 0 );
assert( "pre: same_hyperTree" && this->SameTree(other) );
vtkCompactHyperTreeCursor<N>* o = static_cast<vtkCompactHyperTreeCursor<N> *>( other );
vtkCompactHyperTreeCursor<N>* o =
static_cast<vtkCompactHyperTreeCursor<N> *>( other );
bool result = this->Index == o->Index
&& this->ChildIndex == o->ChildIndex
......@@ -241,7 +239,8 @@ public:
virtual int SameTree( vtkHyperTreeCursor* other )
{
assert( "pre: other_exists" && other != 0 );
vtkCompactHyperTreeCursor<N> *o = vtkCompactHyperTreeCursor<N>::SafeDownCast( other );
vtkCompactHyperTreeCursor<N> *o =
vtkCompactHyperTreeCursor<N>::SafeDownCast( other );
return o != 0 && this->Tree == o->Tree;
}
......@@ -342,7 +341,8 @@ public:
//---------------------------------------------------------------------------
void SetChildIndex(int childIndex )
{
assert( "pre: valid_range" && childIndex >= 0 && childIndex<GetNumberOfChildren() );
assert( "pre: valid_range" && childIndex >= 0
&& childIndex<GetNumberOfChildren() );
this->ChildIndex = childIndex;
assert( "post: is_set" && childIndex==GetChildIndex() );
}
......@@ -423,14 +423,19 @@ class vtkHyperTreeLeafFlags
public:
vtkHyperTreeLeafFlags()
{ // Unused bits are set to 1.
this->Flags[0] = this->Flags[1] = this->Flags[2] = this->Flags[3] = 255;
for ( int i = 0; i < 4; ++ i )
{
this->Flags[i] = 0xFF;
}
}
// True if all chilren are leaves.
bool IsTerminal()
{
// Unused bits are set to 1.
return ( this->Flags[0] == 255) && ( this->Flags[1] == 255) && ( this->Flags[2] == 255);
return this->Flags[0] == 0xFF
&& this->Flags[1] == 0xFF
&& this->Flags[2] == 0xFF;
}
void SetLeafFlag(int idx, bool val)
......@@ -443,7 +448,8 @@ public:
idx -= 8;
}
unsigned char mask = 1 << idx;
this->Flags[i] = val ? ( this->Flags[i] | mask ) : ( this->Flags[i] & (mask ^ 255) );
this->Flags[i] = val ?
( this->Flags[i] | mask ) : ( this->Flags[i] & (mask ^ 0xFF) );
}
bool GetLeafFlag(int idx)
......@@ -469,7 +475,7 @@ public:
{
os << ( ( this->Flags[byteIdx] & mask ) == mask );
++childIdx;
if (mask == 128)
if ( mask == 128 )
{
mask = 1;
++byteIdx;
......@@ -590,7 +596,8 @@ public:
static vtkCompactHyperTree<N>* New()
{
vtkObject* o = vtkObjectFactory::CreateInstance( "vtkCompactHyperTree<N>" );
return o ? static_cast<vtkCompactHyperTree<N> *>(o) : new vtkCompactHyperTree<N>;
return o ?
static_cast<vtkCompactHyperTree<N> *>(o) : new vtkCompactHyperTree<N>;
}
//---------------------------------------------------------------------------
......@@ -603,15 +610,14 @@ public:
for ( int i = 0; i < N; ++ i )
{
// It is assumed that the root is a special node with only one child.
// The other children flags are irrelevant, but set them as nodes for no good reason.
// The other children flags are irrelevant, but set them as nodes for
// no good reason.
this->Nodes[0].SetLeafFlag( i, i == 0 ); // First child is a leaf
this->Nodes[0].SetChild( i, 0 );
}
this->LeafParent.resize( 1 );
this->LeafParent[0] = 0;
this->NumberOfLevels = 1;
this->NumberOfLeavesPerLevel.resize( 1 );
this->NumberOfLeavesPerLevel[0] = 1;
this->NumberOfNodes = 1;
this->GlobalIndexTable.clear();
this->GlobalIndexStart = 0;
......@@ -656,7 +662,10 @@ public:
this->GlobalIndexTable.resize( local + 1 );
}
this->GlobalIndexTable[ local ] = global;
if ( local == 0 && this->LeafParent.size() == 1 ) SetGlobalIndexFromLocal( 1, global );
if ( local == 0 && this->LeafParent.size() == 1 )
{
SetGlobalIndexFromLocal( 1, global );
}
}
//---------------------------------------------------------------------------
......@@ -672,7 +681,8 @@ public:
// \post result_greater_or_equal_to_one: result>=1
virtual vtkIdType GetNumberOfLevels()
{
assert( "post: result_greater_or_equal_to_one" && this->NumberOfLevels >= 1);
assert( "post: result_greater_or_equal_to_one"
&& this->NumberOfLevels >= 1);
return this->NumberOfLevels;
}
......@@ -681,7 +691,8 @@ public:
// Public only for the vtkCompactHyperTreeCursor.
vtkCompactHyperTreeNode<N>* GetNode( int nodeIdx )
{
assert( "pre: valid_range" && nodeIdx >= 0 && nodeIdx<GetNumberOfNodes() );
assert( "pre: valid_range" && nodeIdx >= 0
&& nodeIdx < this->Nodes.size() );
return &this->Nodes[nodeIdx];
}
......@@ -694,9 +705,10 @@ public:
// This really returns the nodeIdx of the leafs parent.
int GetLeafParent( int leafIdx )
{
assert( "pre: valid_range" && leafIdx >= 0 && leafIdx < this->LeafParent.size());
assert( "post: valid_result" && this->LeafParent[leafIdx] >= 0 &&
this->LeafParent[leafIdx] < this->GetNumberOfNodes() );
assert( "pre: valid_range" && leafIdx >= 0
&& leafIdx < this->LeafParent.size());
assert( "post: valid_result" && this->LeafParent[leafIdx] >= 0
&& this->LeafParent[leafIdx] < this->GetNumberOfNodes() );
return this->LeafParent[leafIdx];
}
......@@ -715,41 +727,41 @@ public:
assert( "pre: is_a_leaf" && leafCursor->IsLeaf() );
// We are using a vtkCompactHyperTreeCursor.
// We know that GetLeafId() return Cursor.
vtkIdType leafIndex = leafCursor->GetLeafId();
vtkCompactHyperTreeCursor<N>* cursor =
static_cast<vtkCompactHyperTreeCursor<N> *>(leafCursor);
// The leaf becomes a node and is not anymore a leaf
cursor->SetIsLeaf( false ); // let the cursor know about that change.
size_t nodeIndex = this->LeafParent.size();
cursor->SetIndex( static_cast<vtkIdType>( nodeIndex ) );
size_t nodeIndex = cursor->GetNodeId();
// Nodes get constructed with leaf flags set to 1.
this->Nodes.resize( nodeIndex + 1 );
vtkIdType parentNodeIdx = this->LeafParent[leafIndex];
if ( this->Nodes.size() <= nodeIndex )
{
this->Nodes.resize( nodeIndex + 1 );
}
vtkIdType parentNodeIdx = this->LeafParent[nodeIndex];
this->Nodes[nodeIndex].SetParent( parentNodeIdx );
// Change the parent: it has one less child as a leaf
vtkCompactHyperTreeNode<N>* parent = &( this->Nodes[parentNodeIdx] );
vtkCompactHyperTreeNode<N>& parent = this->Nodes[parentNodeIdx];
// New nodes index in parents children array.
int idx = cursor->GetChildIndex();
assert( "check matching_child" && parent->GetChild( idx ) == leafIndex );
parent->SetLeafFlag( idx, false );
parent->SetChild( idx, static_cast<int>( nodeIndex ) );
parent.SetLeafFlag( idx, false );
parent.SetChild( idx, static_cast<int>( nodeIndex ) );
// The first new child
// Recycle the leaf index we are deleting because it became a node.
// This avoids messy leaf parent array issues.
this->NumberOfNodes += N;
// The other (N) new children.
size_t nextLeaf = 1 + this->LeafParent.size();
size_t nextLeaf = this->LeafParent.size();
this->LeafParent.resize( nextLeaf + N );
for ( int i = 0; i < N; ++ i, ++ nextLeaf )
{
this->Nodes[nodeIndex].SetChild( i, static_cast<int>( nextLeaf ) );
this->LeafParent[nextLeaf] = static_cast<int>( nodeIndex );
this->Nodes[nodeIndex].SetLeafFlag( i, true );
}
// Update the number of leaves per level.
......@@ -760,9 +772,7 @@ public:
{
// We have a new level.
++ this->NumberOfLevels;
this->NumberOfLeavesPerLevel.resize( this->NumberOfLevels );
}
this->NumberOfLeavesPerLevel[level + 1] += N;
}
//---------------------------------------------------------------------------
......@@ -802,8 +812,9 @@ public:
// Ignore the attribute array because its size is added by the data set.
unsigned int GetActualMemorySize()
{
size_t size = sizeof(int) * this->LeafParent.size() +
sizeof(vtkCompactHyperTreeNode<N>) * this->Nodes.size();
size_t size = sizeof(vtkIdType) * this->LeafParent.size() +
sizeof(vtkCompactHyperTreeNode<N>) * this->Nodes.size() +
sizeof(vtkIdType) * this->GlobalIndexTable.size();
return static_cast<unsigned int>( size / 1024 );
}
......@@ -872,25 +883,7 @@ protected:
this->Scale[i] = 1.;
}
// Set root node
this->Nodes.resize( 1 );
this->Nodes[0].SetParent( 0 );
// Nodes default to have all children leaf flags equal true
for ( int i = 0 ; i < N ; ++ i )
{
this->Nodes[0].SetLeafFlag( i, i == 0 ); // First child is a leaf
this->Nodes[0].SetChild( i, 0 );
}
this->LeafParent.resize( 1 );
this->LeafParent[0] = 0;
this->NumberOfLevels = 1;
this->NumberOfLeavesPerLevel.resize( 1 );
this->NumberOfLeavesPerLevel[0] = 1;
this->NumberOfNodes = 1;
this->GlobalIndexTable.clear();
this->GlobalIndexStart = 0;
this->Initialize();
}
int BranchFactor;
......@@ -904,9 +897,6 @@ protected:
// Storage for non-leaf tree nodes
std::vector<vtkCompactHyperTreeNode<N> > Nodes;
// Storage for number of leaves in each level
std::vector<vtkIdType> NumberOfLeavesPerLevel;
// Storage to record the parent of each leaf
std::vector<vtkIdType> LeafParent;
......
......@@ -167,7 +167,6 @@ public:
// This is done to hide templates.
virtual void FindChildParameters( int, vtkIdType&, bool& );
// Description:
// Set the start global index for the current tree.
// The global index of a node will be this index + the node index.
......
......@@ -65,10 +65,6 @@ vtkCxxSetObjectMacro( vtkHyperTreeGrid, ZCoordinates, vtkDataArray );
//-----------------------------------------------------------------------------
vtkHyperTreeGrid::vtkHyperTreeGrid()
{
// Grid of hyper trees
this->HyperTreesLeafIdOffsets = 0;
this->NumLeaves = 0;
// Dual grid corners (primal grid leaf centers)
this->Points = 0;
this->Connectivity = 0;
......@@ -231,13 +227,6 @@ void vtkHyperTreeGrid::CopyStructure( vtkDataSet* ds )
}
}
// Shallow copy cell tree leaf ID offsets
this->HyperTreesMap = htg->HyperTreesMap;
delete [] this->HyperTreesLeafIdOffsets;
this->HyperTreesLeafIdOffsets = 0;
this->NumLeaves = htg->NumLeaves;
this->DeleteInternalArrays();
if ( htg->Points )
......@@ -335,8 +324,6 @@ void vtkHyperTreeGrid::GenerateTrees()
// Clean up existing trees
this->DeleteTrees();
this->HyperTreesMap.clear();
// Generate concrete instance of hyper tree and append it to list of roots
vtkIdType nr = this->GetNumberOfTrees();
......@@ -344,7 +331,6 @@ void vtkHyperTreeGrid::GenerateTrees()
{
vtkHyperTree* tree = vtkHyperTree::CreateInstance( this->BranchFactor, this->Dimension );
this->HyperTrees[ this->MaterialMaskIndex ? this->MaterialMaskIndex->GetValue(r) : r ] = tree;
this->HyperTreesMap[ this->MaterialMaskIndex ? this->MaterialMaskIndex->GetValue(r) : r ] = r;
} //r
this->Modified();
......@@ -900,8 +886,9 @@ vtkIdType vtkHyperTreeGrid::FindCell( double x[3], vtkCell* cell,
}
//----------------------------------------------------------------------------
vtkIdType vtkHyperTreeGrid::FindCell( double x[3], vtkCell* cell, vtkIdType cellId,
double tol2, int& subId,double pcoords[3],
vtkIdType vtkHyperTreeGrid::FindCell( double x[3], vtkCell* cell,
vtkIdType cellId, double tol2,
int& subId, double pcoords[3],
double* weights )
{
return this->FindCell( x, cell, NULL, cellId, tol2, subId, pcoords, weights );
......@@ -919,6 +906,10 @@ unsigned long vtkHyperTreeGrid::GetActualMemorySize()
size += tree->GetActualMemorySize();
}
// Approximate map memory size
size += static_cast<unsigned long>(
( this->HyperTrees.size() * sizeof(vtkIdType) * 3 ) / 1024 );
if ( this->XCoordinates )
{
size += this->XCoordinates->GetActualMemorySize();
......@@ -949,6 +940,11 @@ unsigned long vtkHyperTreeGrid::GetActualMemorySize()
size += this->MaterialMask->GetActualMemorySize();
}
if ( this->MaterialMaskIndex )
{
size += this->MaterialMaskIndex->GetActualMemorySize();
}
return size;
}
......@@ -971,15 +967,10 @@ vtkIdTypeArray* vtkHyperTreeGrid::GetConnectivity()
}
//-----------------------------------------------------------------------------
vtkIdType vtkHyperTreeGrid::GetLevelZeroIndex( vtkIdType index )
{
//return index;
std::map<vtkIdType, vtkIdType>::iterator it = this->HyperTreesMap.find( index );
return ( it != this->HyperTreesMap.end() ) ? it->second : (vtkIdType)-1;
}
//-----------------------------------------------------------------------------
void vtkHyperTreeGrid::GetLevelZeroCoordsFromIndex( vtkIdType index, vtkIdType &i, vtkIdType &j, vtkIdType &k )
void vtkHyperTreeGrid::GetLevelZeroCoordsFromIndex( vtkIdType index,
vtkIdType &i,
vtkIdType &j,
vtkIdType &k )
{
if ( !this->TransposedRootIndexing )
{
......@@ -998,7 +989,17 @@ void vtkHyperTreeGrid::GetLevelZeroCoordsFromIndex( vtkIdType index, vtkIdType &
}
//-----------------------------------------------------------------------------
void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* superCursor,
void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* sc,
vtkIdType index )
{
vtkIdType i, j, k;
this->GetLevelZeroCoordsFromIndex( index, i, j, k );
// Initialize center cursor
this->InitializeSuperCursor( sc, i, j, k, index );
}
//-----------------------------------------------------------------------------
void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* sc,
unsigned int i,
unsigned int j,
unsigned int k,
......@@ -1015,18 +1016,18 @@ void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* super
this->YCoordinates->GetTuple( j + 1, extreme + 1);
this->ZCoordinates->GetTuple( k + 1, extreme + 2 );
memcpy( superCursor->Origin, origin, 3 * sizeof( double ) );
superCursor->Size[0] = extreme[0] - origin[0];
superCursor->Size[1] = extreme[1] - origin[1];
superCursor->Size[2] = extreme[2] - origin[2];
memcpy( sc->Origin, origin, 3 * sizeof( double ) );
sc->Size[0] = extreme[0] - origin[0];
sc->Size[1] = extreme[1] - origin[1];
sc->Size[2] = extreme[2] - origin[2];
// Initialize middle cursors and bounds for other cursors
superCursor->NumberOfCursors = 3;
sc->NumberOfCursors = 3;
for ( unsigned int c = 1; c < this->Dimension; ++ c )
{
superCursor->NumberOfCursors *= 3;
sc->NumberOfCursors *= 3;
}
superCursor->MiddleCursorId = superCursor->NumberOfCursors / 2;
sc->MiddleCursorId = sc->NumberOfCursors / 2;
int lowI = -1;
int highI = 1;
......@@ -1056,7 +1057,7 @@ void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* super
{
int pos[3] = { ci, cj, ck };
int d = ci + 3 * cj + 9 * ck;
superCursor->GetCursor( d )->Initialize( this, index, pos );
sc->GetCursor( d )->Initialize( this, index, pos );
} // i
} // j
} // k
......@@ -1096,14 +1097,16 @@ void vtkHyperTreeGrid::InitializeSuperCursorChild( vtkHyperTreeGridSuperCursor*
child->Origin[2] = parent->Origin[2] + ( z * child->Size[2] );
// Move each cursor in the superCursor down to a child
vtkSuperCursorEntry* cursorPtr = this->SuperCursorTraversalTable + ( childIdx * 27 );
vtkSuperCursorEntry* cursorPtr =
this->SuperCursorTraversalTable + ( childIdx * 27 );
for ( int cursorIdx = 0; cursorIdx < child->NumberOfCursors; ++ cursorIdx )
{
// Extract the parent and child of the new node from the traversal table
// Child is encoded in the first three bits for all dimensions
int tParent = cursorPtr[cursorIdx].Parent;
child->Cursors[cursorIdx] = parent->Cursors[tParent];
if ( parent->Cursors[tParent].GetTree() && ! parent->Cursors[tParent].IsLeaf() )
if ( parent->Cursors[tParent].GetTree()
&& ! parent->Cursors[tParent].IsLeaf() )
{
// Move to child
child->Cursors[cursorIdx] = parent->Cursors[tParent];
......@@ -1261,12 +1264,11 @@ void vtkHyperTreeGrid::ComputeDualGrid()
this->InitializeTreeIterator( it );
while ( it.GetNextTree( index ) )
{
vtkIdType i, j, k;
this->GetLevelZeroCoordsFromIndex( index, i, j, k );
// Initialize super cursors
// Storage for super cursors
vtkHyperTreeGridSuperCursor superCursor;
this->InitializeSuperCursor( &superCursor, i, j, k, index );
// Initialize center cursor
this->InitializeSuperCursor( &superCursor, index );
// Traverse and populate dual recursively
this->TraverseDualRecursively( &superCursor, 0 );
......@@ -1276,15 +1278,18 @@ void vtkHyperTreeGrid::ComputeDualGrid()
for ( unsigned int d = 0; d < this->Dimension; ++ d )
{
// Iterate over all adjustments for current dimension
for ( std::map<vtkIdType,double>::const_iterator itps = this->PointShifts[d].begin();
itps != this->PointShifts[d].end(); ++ itps )
for ( std::map<vtkIdType, double>::const_iterator itps =
this->PointShifts[d].begin();
itps != this->PointShifts[d].end(); ++ itps )
{
double pt[3];
this->Points->GetPoint( itps->first, pt );
pt[d] += itps->second;
this->Points->SetPoint( itps->first, pt );
} // it
this->PointShifts[d].clear();
} // d
this->PointShifted.clear();
timer->StopTimer();
cerr << "Internal dual update : " << timer->GetElapsedTime() << endl;
......@@ -1294,8 +1299,8 @@ void vtkHyperTreeGrid::ComputeDualGrid()
//-----------------------------------------------------------------------------
// Iterate over leaves. Generate dual point. Highest level (smallest leaf)
// owns the corner and generates that dual cell.
void vtkHyperTreeGrid::TraverseDualRecursively( vtkHyperTreeGridSuperCursor* superCursor,
unsigned int level )
void vtkHyperTreeGrid::TraverseDualRecursively(
vtkHyperTreeGridSuperCursor* superCursor, unsigned int level )
{
// Get cursor at super cursor center
vtkHyperTreeSimpleCursor* cursor0 = superCursor->GetCursor( 0 );
......@@ -1336,7 +1341,8 @@ void vtkHyperTreeGrid::TraverseDualRecursively( vtkHyperTreeGridSuperCursor* sup
}
//-----------------------------------------------------------------------------
void vtkHyperTreeGrid::TraverseDualMaskedLeaf( vtkHyperTreeGridSuperCursor* superCursor )
void vtkHyperTreeGrid::TraverseDualMaskedLeaf(
vtkHyperTreeGridSuperCursor* superCursor )
{
// Get cursor at super cursor center
vtkHyperTreeSimpleCursor* cursor0 = superCursor->GetCursor( 0 );
......@@ -1736,9 +1742,6 @@ void vtkHyperTreeGrid::GenerateSuperCursorTraversalTable()
//-----------------------------------------------------------------------------
void vtkHyperTreeGrid::DeleteInternalArrays()
{
delete [] this->HyperTreesLeafIdOffsets;
this->HyperTreesLeafIdOffsets = 0;
if ( this->Points )
{
this->Points->UnRegister( this );
......@@ -1855,19 +1858,9 @@ void vtkHyperTreeGrid::vtkHyperTreeSimpleCursor::ToRoot()
// Return to root level
this->Level = 0;
this->Index = 0;
if ( this->Tree->GetNumberOfLeaves() == 1 )
{
// Root is a leaf
this->Index = 0;
this->Leaf = true;
}
else
{
// Root is a node
this->Index = 1; // First node ( 0 ) is a special empty node
this->Leaf = false;
}
this->Leaf = ( this->Tree->GetNumberOfLeaves() == 1 );
}
//-----------------------------------------------------------------------------
......@@ -1883,14 +1876,6 @@ void vtkHyperTreeGrid::vtkHyperTreeSimpleCursor::ToChild( int child )
this->Level++;
assert( "Bad index" && this->Index >= 0 );
if ( this->Leaf )
{
// assert( "Bad leaf index" && this->Index < this->Tree->GetNumberOfLeaves()+1 );
}
else
{
assert( "Bad node index" && this->Index < this->Tree->GetNumberOfNodes() );
}
}
//-----------------------------------------------------------------------------
......
......@@ -321,6 +321,8 @@ public:
unsigned int,
unsigned int,
vtkIdType );
void InitializeSuperCursor( vtkHyperTreeGridSuperCursor*,
vtkIdType );
// Description:
// Initialize a cursor to point to a child of an existing super cursor.
// This will not work in place.
......@@ -329,13 +331,11 @@ public:
int childIdx );
#endif
//ETX
// Description:
// The number of children each node can have.
vtkGetMacro(NumberOfChildren, int);
// Description:
vtkIdType GetLevelZeroIndex( vtkIdType );
// Description:
// Convert a level 0 index to its ijk coordinates according the grid size.
void GetLevelZeroCoordsFromIndex( vtkIdType index,
......@@ -368,10 +368,6 @@ protected:
vtkDataArray* ZCoordinates;
std::map<vtkIdType, vtkHyperTree*> HyperTrees;