Commit 44e7c97c authored by Philippe Pébay's avatar Philippe Pébay
Browse files

Documentation clean up

Change-Id: I557bcc04b090c737925044bff44533cb09a0bf2e
parent 251243e2
......@@ -40,12 +40,6 @@
#include <assert.h>
// Issues:
// 1: Order of leaf id's due to refining nodes. Reader could order leaves base on its own needs.
// 2: Default cell interface creates connectivity arrays (effectively unstructured grid) to support random
// access to cells. A serial iterator would be much more efficient.
vtkInformationKeyMacro(vtkHyperTreeGrid, LEVELS, Integer);
vtkInformationKeyMacro(vtkHyperTreeGrid, DIMENSION, Integer);
vtkInformationKeyRestrictedMacro(vtkHyperTreeGrid, SIZES, DoubleVector, 3 );
......@@ -729,7 +723,7 @@ public:
// Restore the initial state: only one node and one leaf: the root.
virtual void Initialize()
{
// Law: I believe that leaves are implicit (not node objects)
// NB: Leaves are implicit (not node objects)
// so why initialize a root node with one leaf?
// Does the root always have one child?
this->Nodes.resize(1);
......@@ -737,7 +731,7 @@ public:
int i=0;
while (i < N)
{
// Law: I assume that the root is a special node with only one child.
// It is assumed that the root is a special node with only one child.
// The other children flags are irrelavent, 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 );
......@@ -790,8 +784,7 @@ public:
//---------------------------------------------------------------------------
// Description:
// Public only for the vtkCompactHyperTreeCursor.
// Law:
// cursor (index ) appears to be different between nodes and leaves.
// NB: Cursor (index ) appears to be different between nodes and leaves.
// Different arrays => overlapping indexes.
// I am changing the name for clarity.
// This really returns the nodeIdx of the leafs parent.
......@@ -830,10 +823,10 @@ public:
// the leaf becomes a node and is not anymore a leaf.
cursor->SetIsLeaf( 0 ); // let the cursor knows about that change.
size_t nodeIndex=this->Nodes.size();
// Law: I believe that the node array does not include leaves (which are implicit).
// Bad interface "SetCursor" I would rather SetIndex.
// NB: Bad interface "SetCursor"; should rather SetIndex.
cursor->SetCursor(static_cast<int>( nodeIndex ) );
// Law: Add a node
// Nodes get constructed with leaf flags set to 1.
this->Nodes.resize( nodeIndex + 1 );
int parentNodeIdx = this->LeafParent[leafIndex];
......@@ -841,14 +834,15 @@ public:
// Change the parent: it has one less child as a leaf
vtkCompactHyperTreeNode<N> *parent=&( this->Nodes[parentNodeIdx] );
// Law: New nodes index in parents children array.
// New nodes index in parents children array.
int i = cursor->GetChildIndex();
assert( "check matching_child" && parent->GetChild( i ) == leafIndex );
parent->SetLeafFlag(i, false);
parent->SetChild(i,static_cast<int>( nodeIndex ) );
// The first new child
// Law: Recycle the leaf index we are deleting because it became a node.
// Recycle the leaf index we are deleting because it became a node.
// This avoids messy leaf parent array issues.
this->Nodes[nodeIndex].SetChild( 0, leafIndex );
this->LeafParent[leafIndex]=static_cast<int>( nodeIndex );
......@@ -884,7 +878,7 @@ public:
}
//---------------------------------------------------------------------------
// Law: Bad interface: This is really GetNumberOfLeaves.
// NB: Bad interface: This is really GetNumberOfLeaves.
int GetLeafParentSize()
{
return static_cast<int>( this->LeafParent.size() );
......@@ -972,10 +966,11 @@ protected:
this->Dimension = 3;
}
// Law: The root.
// The root.
this->Nodes.resize(1);
this->Nodes[0].SetParent( 0 );
// Law: Nodes default to have all children leaf flags equal true.
// Nodes default to have all children leaf flags equal true.
int i=0;
while( i < N )
{
......
......@@ -14,6 +14,7 @@
=========================================================================*/
// .NAME vtkHyperTreeGrid - A dataset structured as a tree where each node has
// exactly either 2^n or 3^n children.
//
// .SECTION Description
// An hypertree is a dataset where each node has either exactly 2^n or 3^n children
// or no child at all if the node is a leaf. `n' is the dimension of the
......@@ -109,10 +110,10 @@
// .SECTION Caveats
// It is not a spatial search object. If you are looking for this kind of
// octree see vtkCellLocator instead.
//
// .SECTION Thanks
// This class was written by Charles Law and Philippe Pebay, Kitware 2012
// This test was written by Philippe Pebay and Charles Law, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#ifndef __vtkHyperTreeGrid_h
#define __vtkHyperTreeGrid_h
......
......@@ -21,7 +21,6 @@
#include "vtkHyperTreeGrid.h"
#include "vtkStreamingDemandDrivenPipeline.h"
//----------------------------------------------------------------------------
vtkHyperTreeGridAlgorithm::vtkHyperTreeGridAlgorithm()
{
......
......@@ -14,9 +14,9 @@
=========================================================================*/
// .NAME vtkHyperTreeGridAlgorithm - Superclass for algorithms that produce
// a hyper tree grid as output
//
// .SECTION Description
// vtkTreeGridAlgorithm is a convenience class to make writing algorithms
// vtkHyperTreeGridAlgorithm is a convenience class to make writing algorithms
// easier. It is also designed to help transition old algorithms to the new
// pipeline architecture. There are some assumptions and defaults made by this
// class you should be aware of. This class defaults such that your filter
......@@ -25,9 +25,10 @@
// constructor for the default. This class also provides a FillInputPortInfo
// method that by default says that all inputs will be HyperTreeGrid. If that
// isn't the case then please override this method in your subclass.
//
// .SECTION Thanks
// This class was written by Philippe Pebay, Kitware SAS 2012
// This test was written by Philippe Pebay and Charles Law, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#ifndef __vtkHyperTreeGridAlgorithm_h
#define __vtkHyperTreeGridAlgorithm_h
......
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