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

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

#include <vtkHyperTree.h>

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

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkHyperTreeNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void Initialize (unsigned char branchFactor, unsigned char dimension, unsigned char numberOfChildren)
 Restore the initial state: only one node and one leaf: the root. More...
 
void CopyStructure (vtkHyperTree *ht)
 
virtual vtkHyperTreeFreeze (const char *mode)=0
 JB Return a freeze instance (a priori compact but potentially not changeable). More...
 
unsigned int GetNumberOfLevels () const
 Return the number of levels. More...
 
vtkIdType GetNumberOfVertices () const
 Return the number of all vertices in the tree. More...
 
vtkIdType GetNumberOfNodes () const
 Return the number of nodes (non-leaf vertices) in the tree. More...
 
vtkIdType GetNumberOfLeaves () const
 Return the number of leaf vertices in the tree. More...
 
int GetBranchFactor () const
 Return the branch factor of the tree. More...
 
int GetDimension () const
 Return the dimension of the tree. More...
 
vtkIdType GetNumberOfChildren () const
 Return the number of children per node of the tree. More...
 
std::shared_ptr< vtkHyperTreeGridScalesInitializeScales (const double *scales, bool reinitialize=false) const
 JB mailles par niveau. More...
 
virtual void FindChildParameters (unsigned char ichild, vtkIdType &index_parent, bool &isLeaf)=0
 JB Return the parent index node and this stat return by IsLeaf() JB for this node the Index, Parent Index and IsLeaf() of the child JB of a node in the hypertree. More...
 
virtual unsigned long GetActualMemorySizeBytes ()=0
 Return memory used in bytes. More...
 
unsigned int GetActualMemorySize ()
 Return memory used in kibibytes (1024 bytes). More...
 
void SetGlobalIndexStart (vtkIdType start)
 Set the start global index for the current tree. More...
 
vtkIdType GetGlobalIndexStart () const
 Get the start global index for the current tree. More...
 
virtual void SetGlobalIndexFromLocal (vtkIdType index, vtkIdType global)=0
 JB Set the mapping between a local node identified by index and a global id qui permet de recuperer la valeur du node correspondant car ce global id est l'indice dans ce tableau qui decrit une grandeur. More...
 
virtual vtkIdType GetGlobalIndexFromLocal (vtkIdType index) const =0
 JB Get the global id of a local node identified by index. More...
 
virtual vtkIdType GetGlobalNodeIndexMax () const =0
 JB Returne la valeur maximale atteinte par l'index global. More...
 
virtual bool IsLeaf (vtkIdType index) const =0
 JB Return if a local node identified by index is leaf. More...
 
virtual void SubdivideLeaf (vtkIdType index, unsigned int level)=0
 Subdivide node pointed by cursor, only if its a leaf. More...
 
virtual bool IsTerminalNode (vtkIdType index) const =0
 JB Return if a local node identified by index is a terminal node, c'est-a-dire que this coarse node a toutes ses filles qui sont des feuilles. More...
 
virtual vtkIdType GetElderChildIndex (unsigned int index_parent) const =0
 JB Return the local index node du premier noeud fille d'un parent node identified by index_parent. More...
 
void SetTreeIndex (vtkIdType treeIndex)
 Set/Get tree index in HTG. More...
 
vtkIdType GetTreeIndex () const
 Set/Get tree index in HTG. More...
 
void GetScale (double s[3]) const
 JB Set/Get scale of the tree in each direction for the ground level (0). More...
 
double GetScale (unsigned int d) const
 JB Set/Get scale of the tree in each direction for the ground level (0). More...
 
void SetScales (std::shared_ptr< vtkHyperTreeGridScales > scales) const
 JB. More...
 
bool HasScales () const
 JB. More...
 
std::shared_ptr< vtkHyperTreeGridScalesGetScales () const
 JB. 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 RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool 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...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool 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 vtkTypeBool IsTypeOf (const char *type)
 
static vtkHyperTreeSafeDownCast (vtkObjectBase *o)
 
static vtkHyperTreeCreateInstance (unsigned char branchFactor, unsigned char dimension)
 JB Return an instance of a implementation of a hypertree for given branch JB factor and dimension. 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 ()
 
virtual void InitializePrivate ()=0
 
virtual void PrintSelfPrivate (ostream &os, vtkIndent indent)=0
 
virtual void CopyStructurePrivate (vtkHyperTree *ht)=0
 
- 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=nullptr)
 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 &)
 

Protected Attributes

unsigned char BranchFactor
 
unsigned char Dimension
 
unsigned char NumberOfChildren
 
std::shared_ptr< vtkHyperTreeDataDatas
 
std::shared_ptr< vtkHyperTreeGridScalesScales
 
- 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^d or 3^d children.

An hypertree is a dataset where each node has either exactly f^d children or no child at all if the node is a leaf, where f in {2,3} is the branching factor of the tree and d in {1,2,3} is the dimension of the dataset. Such trees have particular names when f=2: bintree (d=1), quadtree (d=2), and octree (d=2). When f=3, we respectively call them 3-tree, 9-tree, and 27-tree.

The original octree class name came 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 for quick culling of 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 f=2:
  • d=3 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) -z side is first, in counter-clockwise order: 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 f=2:
+z side is last, in counter-clockwise order: 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 f=2:
The cases with fewer dimensions are consistent with the octree case:
Case with f=2:
  • d=2 case (quadtree): in counter-clockwise order: 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 f=2:
  • d=1 case (bintree):
    * +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 class was modified by Guenole Harel and Jacques-Bernard Lekien 2014 This class was modified by Philippe Pebay, 2016 JB This class was simplified and optimized (memory) by Jacques-Bernard Lekien 2018 This work was supported by Commissariat a l'Energie Atomique CEA, DAM, DIF, F-91297 Arpajon, France.

Definition at line 166 of file vtkHyperTree.h.

Member Typedef Documentation

Definition at line 169 of file vtkHyperTree.h.

Constructor & Destructor Documentation

vtkHyperTree::vtkHyperTree ( )
inlineprotected

Definition at line 407 of file vtkHyperTree.h.

Member Function Documentation

static vtkTypeBool vtkHyperTree::IsTypeOf ( const char *  type)
static
virtual vtkTypeBool 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
void vtkHyperTree::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

void vtkHyperTree::Initialize ( unsigned char  branchFactor,
unsigned char  dimension,
unsigned char  numberOfChildren 
)

Restore the initial state: only one node and one leaf: the root.

void vtkHyperTree::CopyStructure ( vtkHyperTree ht)
virtual vtkHyperTree* vtkHyperTree::Freeze ( const char *  mode)
pure virtual

JB Return a freeze instance (a priori compact but potentially not changeable).

Le mode pourra permettre de proposer plusieurs instances freeze possible.

void vtkHyperTree::SetTreeIndex ( vtkIdType  treeIndex)
inline

Set/Get tree index in HTG.

JB Ces services sont a usage interne.

Definition at line 194 of file vtkHyperTree.h.

vtkIdType vtkHyperTree::GetTreeIndex ( ) const
inline

Set/Get tree index in HTG.

JB Ces services sont a usage interne.

Definition at line 197 of file vtkHyperTree.h.

unsigned int vtkHyperTree::GetNumberOfLevels ( ) const
inline

Return the number of levels.

Definition at line 205 of file vtkHyperTree.h.

vtkIdType vtkHyperTree::GetNumberOfVertices ( ) const
inline

Return the number of all vertices in the tree.

Definition at line 215 of file vtkHyperTree.h.

vtkIdType vtkHyperTree::GetNumberOfNodes ( ) const
inline

Return the number of nodes (non-leaf vertices) in the tree.

Definition at line 223 of file vtkHyperTree.h.

vtkIdType vtkHyperTree::GetNumberOfLeaves ( ) const
inline

Return the number of leaf vertices in the tree.

Definition at line 231 of file vtkHyperTree.h.

int vtkHyperTree::GetBranchFactor ( ) const
inline

Return the branch factor of the tree.

Definition at line 239 of file vtkHyperTree.h.

int vtkHyperTree::GetDimension ( ) const
inline

Return the dimension of the tree.

Definition at line 247 of file vtkHyperTree.h.

vtkIdType vtkHyperTree::GetNumberOfChildren ( ) const
inline

Return the number of children per node of the tree.

Definition at line 255 of file vtkHyperTree.h.

void vtkHyperTree::GetScale ( double  s[3]) const

JB Set/Get scale of the tree in each direction for the ground level (0).

double vtkHyperTree::GetScale ( unsigned int  d) const

JB Set/Get scale of the tree in each direction for the ground level (0).

std::shared_ptr<vtkHyperTreeGridScales> vtkHyperTree::InitializeScales ( const double scales,
bool  reinitialize = false 
) const

JB mailles par niveau.

Il est possible de demander la reinitialisation de JB ce systeme de cache ce qui est utilise dans le filtre de symetrisation.

static vtkHyperTree* vtkHyperTree::CreateInstance ( unsigned char  branchFactor,
unsigned char  dimension 
)
static

JB Return an instance of a implementation of a hypertree for given branch JB factor and dimension.

JB This is done for permettre l'utilisation d'implementation differentes JB de l'hypertree. JB Une des possiblites offertes par cela, c'est qu'a partir JB d'une indstance d'une implementation de l'hypertree en definir une autre JB par l'appel a Frozen (par defaut, ce service ne fait rien), la nouvelle JB instance se voulant soit plus compact soit plus rapide, voire les deux.

virtual void vtkHyperTree::FindChildParameters ( unsigned char  ichild,
vtkIdType index_parent,
bool &  isLeaf 
)
pure virtual

JB Return the parent index node and this stat return by IsLeaf() JB for this node the Index, Parent Index and IsLeaf() of the child JB of a node in the hypertree.

JB L'existence de ce service est liee a celle de CreateInstance.

virtual unsigned long vtkHyperTree::GetActualMemorySizeBytes ( )
pure virtual

Return memory used in bytes.

NB: Ignore the attribute array because its size is added by the data set.

unsigned int vtkHyperTree::GetActualMemorySize ( )
inline

Return memory used in kibibytes (1024 bytes).

NB: Ignore the attribute array because its size is added by the data set.

Definition at line 310 of file vtkHyperTree.h.

void vtkHyperTree::SetGlobalIndexStart ( vtkIdType  start)
inline

Set the start global index for the current tree.

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

Definition at line 320 of file vtkHyperTree.h.

vtkIdType vtkHyperTree::GetGlobalIndexStart ( ) const
inline

Get the start global index for the current tree.

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

Definition at line 329 of file vtkHyperTree.h.

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

JB Set the mapping between a local node identified by index and a global id qui permet de recuperer la valeur du node correspondant car ce global id est l'indice dans ce tableau qui decrit une grandeur.

virtual vtkIdType vtkHyperTree::GetGlobalIndexFromLocal ( vtkIdType  index) const
pure virtual

JB Get the global id of a local node identified by index.

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

virtual vtkIdType vtkHyperTree::GetGlobalNodeIndexMax ( ) const
pure virtual

JB Returne la valeur maximale atteinte par l'index global.

virtual bool vtkHyperTree::IsLeaf ( vtkIdType  index) const
pure virtual

JB Return if a local node identified by index is leaf.

virtual void vtkHyperTree::SubdivideLeaf ( vtkIdType  index,
unsigned int  level 
)
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 bool vtkHyperTree::IsTerminalNode ( vtkIdType  index) const
pure virtual

JB Return if a local node identified by index is a terminal node, c'est-a-dire que this coarse node a toutes ses filles qui sont des feuilles.

virtual vtkIdType vtkHyperTree::GetElderChildIndex ( unsigned int  index_parent) const
pure virtual

JB Return the local index node du premier noeud fille d'un parent node identified by index_parent.

void vtkHyperTree::SetScales ( std::shared_ptr< vtkHyperTreeGridScales scales) const
inline

JB.

Definition at line 382 of file vtkHyperTree.h.

bool vtkHyperTree::HasScales ( ) const
inline

JB.

Definition at line 391 of file vtkHyperTree.h.

std::shared_ptr<vtkHyperTreeGridScales> vtkHyperTree::GetScales ( ) const
inline

JB.

Definition at line 400 of file vtkHyperTree.h.

virtual void vtkHyperTree::InitializePrivate ( )
protectedpure virtual
virtual void vtkHyperTree::PrintSelfPrivate ( ostream &  os,
vtkIndent  indent 
)
protectedpure virtual
virtual void vtkHyperTree::CopyStructurePrivate ( vtkHyperTree ht)
protectedpure virtual

Member Data Documentation

unsigned char vtkHyperTree::BranchFactor
protected

Definition at line 421 of file vtkHyperTree.h.

unsigned char vtkHyperTree::Dimension
protected

Definition at line 424 of file vtkHyperTree.h.

unsigned char vtkHyperTree::NumberOfChildren
protected

Definition at line 427 of file vtkHyperTree.h.

std::shared_ptr< vtkHyperTreeData > vtkHyperTree::Datas
protected

Definition at line 430 of file vtkHyperTree.h.

std::shared_ptr<vtkHyperTreeGridScales> vtkHyperTree::Scales
mutableprotected

Definition at line 433 of file vtkHyperTree.h.


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