VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkHyperTree Class Referenceabstract

An object structured as a tree where each node has exactly either 2^n or 3^n children. More...

#include <vtkHyperTree.h>

Inheritance diagram for vtkHyperTree:
[legend]
Collaboration diagram for vtkHyperTree:
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkHyperTreeNewInstance () const
 
virtual void Initialize ()=0
 
virtual vtkHyperTreeCursorNewCursor ()=0
 
virtual vtkIdType GetNumberOfLeaves ()=0
 
virtual vtkIdType GetNumberOfNodes ()=0
 
virtual vtkIdType GetNumberOfIndex ()=0
 
virtual int GetBranchFactor ()=0
 
virtual int GetDimension ()=0
 
virtual void SetScale (double[3])=0
 
virtual void GetScale (double[3])=0
 
virtual double GetScale (unsigned int)=0
 
virtual vtkIdType GetNumberOfLevels ()=0
 Return the number of levels. More...
 
virtual void SubdivideLeaf (vtkHyperTreeCursor *leaf)=0
 Subdivide node pointed by cursor, only if its a leaf. More...
 
virtual unsigned int GetActualMemorySize ()=0
 Return the actual memory size in kibibytes (1024 bytes). More...
 
virtual void FindChildParameters (int, vtkIdType &, bool &)
 Find the Index, Parent Index and IsLeaf() parameters of a child for hypertree. More...
 
virtual void SetGlobalIndexStart (vtkIdType)=0
 Set the start global index for the current tree. More...
 
virtual void SetGlobalIndexFromLocal (vtkIdType local, vtkIdType global)=0
 Set the mapping between local & global ids used by HyperTreeGrids. More...
 
virtual vtkIdType GetGlobalIndexFromLocal (vtkIdType local)=0
 Get the global id of a local node. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkHyperTreeSafeDownCast (vtkObjectBase *o)
 
static VTK_NEWINSTANCE vtkHyperTreeCreateInstance (unsigned int branchFactor, unsigned int dimension)
 Return an instance of a templated hypertree for given branch factor and dimension This is done to hide templates. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkHyperTree ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

An object structured as a tree where each node has exactly either 2^n or 3^n children.

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 dataset (1 (binary tree), 2 (quadtree) or 3 (octree) ). The class name comes from the following paper:

* @ARTICLE{yau-srihari-1983,
*  author={Mann-May Yau and Sargur N. Srihari},
*  title={A Hierarchical Data Structure for Multidimensional Digital Images},
*  journal={Communications of the ACM},
*  month={July},
*  year={1983},
*  volume={26},
*  number={7},
*  pages={504--515}
*  }
* 

Each node is a cell. Attributes are associated with cells, not with points. The geometry is implicitly given by the size of the root node on each axis and position of the center and the orientation. (TODO: review center position and orientation). The geometry is then not limited to an hybercube but can have a rectangular shape. Attributes are associated with leaves. For LOD (Level-Of-Detail) purpose, attributes can be computed on none-leaf nodes by computing the average values from its children (which can be leaves or not).

By construction, an hypertree is efficient in memory usage when the geometry is sparse. The LOD feature allows to cull quickly part of the dataset.

This is an abstract class used as a superclass by a templated compact class. All methods are pure virtual. This is done to hide templates.

Case with 2^n children:
  • 3D case (octree) for each node, each child index (from 0 to 7) is encoded in the following orientation. It is easy to access each child as a cell of a grid. Note also that the binary representation is relevant, each bit code a side: bit 0 encodes -x side (0) or +x side (1) bit 1 encodes -y side (0) or +y side (1) bit 2 encodes -z side (0) or +z side (2)
  • the -z side first
  • 0: -y -x sides
  • 1: -y +x sides
  • 2: +y -x sides
  • 3: +y +x sides
    *              +y
    * +-+-+        ^
    * |2|3|        |
    * +-+-+  O +z  +-> +x
    * |0|1|
    * +-+-+
    * 
Case with 2^n children:
  • then the +z side, in counter-clockwise
  • 4: -y -x sides
  • 5: -y +x sides
  • 6: +y -x sides
  • 7: +y +x sides
    *              +y
    * +-+-+        ^
    * |6|7|        |
    * +-+-+  O +z  +-> +x
    * |4|5|
    * +-+-+
    * 
Case with 2^n children:
The cases with fewer dimensions are consistent with the octree case:
Case with 2^n children:
  • Quadtree: in counter-clockwise
  • 0: -y -x edges
  • 1: -y +x edges
  • 2: +y -x edges
  • 3: +y +x edges
    *         +y
    * +-+-+   ^
    * |2|3|   |
    * +-+-+  O+-> +x
    * |0|1|
    * +-+-+
    * 
Case with 2^n children:
  • Binary tree:
    * +0+1+  O+-> +x
    * 
Warning
It is not a spatial search object. If you are looking for this kind of octree see vtkCellLocator instead.
Thanks:
This class was written by Philippe Pebay, Joachim Pouderoux and Charles Law, Kitware 2013 This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)

Definition at line 134 of file vtkHyperTree.h.

Member Typedef Documentation

Definition at line 137 of file vtkHyperTree.h.

Constructor & Destructor Documentation

vtkHyperTree::vtkHyperTree ( )
inlineprotected

Definition at line 202 of file vtkHyperTree.h.

Member Function Documentation

static int vtkHyperTree::IsTypeOf ( const char *  type)
static
virtual int vtkHyperTree::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

static vtkHyperTree* vtkHyperTree::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkHyperTree::NewInstanceInternal ( ) const
protectedvirtual
vtkHyperTree* vtkHyperTree::NewInstance ( ) const
virtual void vtkHyperTree::Initialize ( )
pure virtual
virtual vtkHyperTreeCursor* vtkHyperTree::NewCursor ( )
pure virtual
virtual vtkIdType vtkHyperTree::GetNumberOfLeaves ( )
pure virtual
virtual vtkIdType vtkHyperTree::GetNumberOfNodes ( )
pure virtual
virtual vtkIdType vtkHyperTree::GetNumberOfIndex ( )
pure virtual
virtual int vtkHyperTree::GetBranchFactor ( )
pure virtual
virtual int vtkHyperTree::GetDimension ( )
pure virtual
virtual void vtkHyperTree::SetScale ( double  [3])
pure virtual
virtual void vtkHyperTree::GetScale ( double  [3])
pure virtual
virtual double vtkHyperTree::GetScale ( unsigned  int)
pure virtual
virtual vtkIdType vtkHyperTree::GetNumberOfLevels ( )
pure virtual

Return the number of levels.

Postcondition
result_greater_or_equal_to_one: result>=1
virtual void vtkHyperTree::SubdivideLeaf ( vtkHyperTreeCursor leaf)
pure virtual

Subdivide node pointed by cursor, only if its a leaf.

At the end, cursor points on the node that used to be leaf.

Precondition
leaf_exists: leaf!=0
is_a_leaf: leaf->CurrentIsLeaf()
virtual unsigned int vtkHyperTree::GetActualMemorySize ( )
pure virtual

Return the actual memory size in kibibytes (1024 bytes).

NB: Ignores the attribute array.

static VTK_NEWINSTANCE vtkHyperTree* vtkHyperTree::CreateInstance ( unsigned int  branchFactor,
unsigned int  dimension 
)
static

Return an instance of a templated hypertree for given branch factor and dimension This is done to hide templates.

virtual void vtkHyperTree::FindChildParameters ( int  ,
vtkIdType ,
bool &   
)
virtual

Find the Index, Parent Index and IsLeaf() parameters of a child for hypertree.

This is done to hide templates.

virtual void vtkHyperTree::SetGlobalIndexStart ( vtkIdType  )
pure virtual

Set the start global index for the current tree.

The global index of a node will be this index + the node index.

virtual void vtkHyperTree::SetGlobalIndexFromLocal ( vtkIdType  local,
vtkIdType  global 
)
pure virtual

Set the mapping between local & global ids used by HyperTreeGrids.

virtual vtkIdType vtkHyperTree::GetGlobalIndexFromLocal ( vtkIdType  local)
pure virtual

Get the global id of a local node.

Use the mapping function if available or the start global index.


The documentation for this class was generated from the following file: