VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkKdNode Class Reference

This class represents a single spatial region in an 3D axis aligned binary spatial partitioning. It is assumed the region bounds some set of points. Regions are represented as nodes in a binary tree. More...

#include <vtkKdNode.h>

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

Public Types

typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkKdNodeNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual double GetDivisionPosition ()
 
void SetDataBounds (float *v)
 
void SetMinBounds (const double *mb)
 
void SetMaxBounds (const double *mb)
 
void SetMinDataBounds (const double *mb)
 
void SetMaxDataBounds (const double *mb)
 
void AddChildNodes (vtkKdNode *left, vtkKdNode *right)
 
void DeleteChildNodes ()
 
int IntersectsRegion (vtkPlanesIntersection *pi, int useDataBounds)
 
int ContainsPoint (double x, double y, double z, int useDataBounds)
 
double GetDistance2ToBoundary (double x, double y, double z, int useDataBounds)
 
double GetDistance2ToInnerBoundary (double x, double y, double z)
 
virtual void SetDim (int)
 
virtual int GetDim ()
 
virtual void SetNumberOfPoints (int)
 
virtual int GetNumberOfPoints ()
 
void SetBounds (double x1, double x2, double y1, double y2, double z1, double z2)
 
void SetBounds (const double b[6])
 
void GetBounds (double *b) const
 
void SetDataBounds (double x1, double x2, double y1, double y2, double z1, double z2)
 
void GetDataBounds (double *b) const
 
doubleGetMinBounds ()
 
doubleGetMaxBounds ()
 
doubleGetMinDataBounds ()
 
doubleGetMaxDataBounds ()
 
virtual void SetID (int)
 
virtual int GetID ()
 
virtual int GetMinID ()
 
virtual int GetMaxID ()
 
virtual void SetMinID (int)
 
virtual void SetMaxID (int)
 
virtual vtkKdNodeGetLeft ()
 
void SetLeft (vtkKdNode *left)
 
virtual vtkKdNodeGetRight ()
 
void SetRight (vtkKdNode *right)
 
virtual vtkKdNodeGetUp ()
 
void SetUp (vtkKdNode *up)
 
int IntersectsBox (double x1, double x2, double y1, double y2, double z1, double z2, int useDataBounds)
 
int IntersectsSphere2 (double x, double y, double z, double rSquared, int useDataBounds)
 
int IntersectsCell (vtkCell *cell, int useDataBounds, int cellRegion=-1, double *cellBounds=NULL)
 
int ContainsBox (double x1, double x2, double y1, double y2, double z1, double z2, int useDataBounds)
 
double GetDistance2ToBoundary (double x, double y, double z, double *boundaryPt, int useDataBounds)
 
void PrintNode (int depth)
 
void PrintVerboseNode (int depth)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
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)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkKdNodeSafeDownCast (vtkObjectBase *o)
 
static vtkKdNodeNew ()
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkKdNode ()
 
 ~vtkKdNode ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- 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

This class represents a single spatial region in an 3D axis aligned binary spatial partitioning. It is assumed the region bounds some set of points. Regions are represented as nodes in a binary tree.

See also
vtkKdTree vtkOBSPCuts
Tests:
vtkKdNode (Tests)

Definition at line 44 of file vtkKdNode.h.

Member Typedef Documentation

Definition at line 47 of file vtkKdNode.h.

Constructor & Destructor Documentation

vtkKdNode::vtkKdNode ( )
protected
vtkKdNode::~vtkKdNode ( )
protected

Member Function Documentation

static int vtkKdNode::IsTypeOf ( const char *  type)
static
virtual int vtkKdNode::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 vtkObject.

static vtkKdNode* vtkKdNode::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkKdNode::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkObject.

vtkKdNode* vtkKdNode::NewInstance ( ) const
void vtkKdNode::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

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.

static vtkKdNode* vtkKdNode::New ( )
static
virtual void vtkKdNode::SetDim ( int  )
virtual

Set/Get the dimension along which this region is divided. (0 - x, 1 - y, 2 - z, 3 - leaf node (default)).

virtual int vtkKdNode::GetDim ( )
virtual

Set/Get the dimension along which this region is divided. (0 - x, 1 - y, 2 - z, 3 - leaf node (default)).

virtual double vtkKdNode::GetDivisionPosition ( )
virtual

Get the location of the division plane along the axis the region is divided. See also GetDim(). The result is undertermined if this node is not divided (a leaf node).

virtual void vtkKdNode::SetNumberOfPoints ( int  )
virtual

Set/Get the number of points contained in this region.

virtual int vtkKdNode::GetNumberOfPoints ( )
virtual

Set/Get the number of points contained in this region.

void vtkKdNode::SetBounds ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2 
)

Set/Get the bounds of the spatial region represented by this node. Caller allocates storage for 6-vector in GetBounds.

void vtkKdNode::SetBounds ( const double  b[6])
inline

Set/Get the bounds of the spatial region represented by this node. Caller allocates storage for 6-vector in GetBounds.

Definition at line 74 of file vtkKdNode.h.

void vtkKdNode::GetBounds ( double b) const

Set/Get the bounds of the spatial region represented by this node. Caller allocates storage for 6-vector in GetBounds.

void vtkKdNode::SetDataBounds ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2 
)

Set/Get the bounds of the points contained in this spatial region. This may be smaller than the bounds of the region itself. Caller allocates storage for 6-vector in GetDataBounds.

void vtkKdNode::GetDataBounds ( double b) const

Set/Get the bounds of the points contained in this spatial region. This may be smaller than the bounds of the region itself. Caller allocates storage for 6-vector in GetDataBounds.

void vtkKdNode::SetDataBounds ( float v)

Given a pointer to NumberOfPoints points, set the DataBounds of this node to the bounds of these points.

double* vtkKdNode::GetMinBounds ( )
inline

Get a pointer to the 3 bound minima (xmin, ymin and zmin) or the 3 bound maxima (xmax, ymax, zmax). Don't free this pointer.

Definition at line 96 of file vtkKdNode.h.

double* vtkKdNode::GetMaxBounds ( )
inline

Get a pointer to the 3 bound minima (xmin, ymin and zmin) or the 3 bound maxima (xmax, ymax, zmax). Don't free this pointer.

Definition at line 97 of file vtkKdNode.h.

void vtkKdNode::SetMinBounds ( const double mb)

Set the xmin, ymin and zmin value of the bounds of this region

void vtkKdNode::SetMaxBounds ( const double mb)

Set the xmax, ymax and zmax value of the bounds of this region

double* vtkKdNode::GetMinDataBounds ( )
inline

Get a pointer to the 3 data bound minima (xmin, ymin and zmin) or the 3 data bound maxima (xmax, ymax, zmax). Don't free this pointer.

Definition at line 109 of file vtkKdNode.h.

double* vtkKdNode::GetMaxDataBounds ( )
inline

Get a pointer to the 3 data bound minima (xmin, ymin and zmin) or the 3 data bound maxima (xmax, ymax, zmax). Don't free this pointer.

Definition at line 110 of file vtkKdNode.h.

void vtkKdNode::SetMinDataBounds ( const double mb)

Set the xmin, ymin and zmin value of the bounds of this data within this region

void vtkKdNode::SetMaxDataBounds ( const double mb)

Set the xmax, ymax and zmax value of the bounds of this data within this region

virtual void vtkKdNode::SetID ( int  )
virtual

Set/Get the ID associated with the region described by this node. If this is not a leaf node, this value should be -1.

virtual int vtkKdNode::GetID ( )
virtual

Set/Get the ID associated with the region described by this node. If this is not a leaf node, this value should be -1.

virtual int vtkKdNode::GetMinID ( )
virtual

If this node is not a leaf node, there are leaf nodes below it whose regions represent a partitioning of this region. The IDs of these leaf nodes form a contigous set. Set/Get the range of the IDs of the leaf nodes below this node. If this is already a leaf node, these values should be the same as the ID.

virtual int vtkKdNode::GetMaxID ( )
virtual

If this node is not a leaf node, there are leaf nodes below it whose regions represent a partitioning of this region. The IDs of these leaf nodes form a contigous set. Set/Get the range of the IDs of the leaf nodes below this node. If this is already a leaf node, these values should be the same as the ID.

virtual void vtkKdNode::SetMinID ( int  )
virtual

If this node is not a leaf node, there are leaf nodes below it whose regions represent a partitioning of this region. The IDs of these leaf nodes form a contigous set. Set/Get the range of the IDs of the leaf nodes below this node. If this is already a leaf node, these values should be the same as the ID.

virtual void vtkKdNode::SetMaxID ( int  )
virtual

If this node is not a leaf node, there are leaf nodes below it whose regions represent a partitioning of this region. The IDs of these leaf nodes form a contigous set. Set/Get the range of the IDs of the leaf nodes below this node. If this is already a leaf node, these values should be the same as the ID.

void vtkKdNode::AddChildNodes ( vtkKdNode left,
vtkKdNode right 
)

Add the left and right children.

void vtkKdNode::DeleteChildNodes ( )

Delete the left and right children.

virtual vtkKdNode* vtkKdNode::GetLeft ( )
virtual

Set/Get a pointer to the left child of this node.

void vtkKdNode::SetLeft ( vtkKdNode left)

Set/Get a pointer to the left child of this node.

virtual vtkKdNode* vtkKdNode::GetRight ( )
virtual

Set/Get a pointer to the right child of this node.

void vtkKdNode::SetRight ( vtkKdNode right)

Set/Get a pointer to the right child of this node.

virtual vtkKdNode* vtkKdNode::GetUp ( )
virtual

Set/Get a pointer to the parent of this node.

void vtkKdNode::SetUp ( vtkKdNode up)

Set/Get a pointer to the parent of this node.

int vtkKdNode::IntersectsBox ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2,
int  useDataBounds 
)

Return 1 if this spatial region intersects the axis-aligned box given by the bounds passed in. Use the possibly smaller bounds of the points within the region if useDataBounds is non-zero.

int vtkKdNode::IntersectsSphere2 ( double  x,
double  y,
double  z,
double  rSquared,
int  useDataBounds 
)

Return 1 if this spatial region intersects a sphere described by it's center and the square of it's radius. Use the possibly smaller bounds of the points within the region if useDataBounds is non-zero.

int vtkKdNode::IntersectsRegion ( vtkPlanesIntersection pi,
int  useDataBounds 
)

A vtkPlanesIntersection object represents a convex 3D region bounded by planes, and it is capable of computing intersections of boxes with itself. Return 1 if this spatial region intersects the spatial region described by the vtkPlanesIntersection object. Use the possibly smaller bounds of the points within the region if useDataBounds is non-zero.

int vtkKdNode::IntersectsCell ( vtkCell cell,
int  useDataBounds,
int  cellRegion = -1,
double cellBounds = NULL 
)

Return 1 if the cell specified intersects this region. If you already know the ID of the region containing the cell's centroid, provide that as an argument. If you already know the bounds of the cell, provide that as well, in the form of xmin,xmax,ymin,ymax,zmin, zmax. Either of these may speed the calculation. Use the possibly smaller bounds of the points within the region if useDataBounds is non-zero.

int vtkKdNode::ContainsBox ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2,
int  useDataBounds 
)

Return 1 if this spatial region entirely contains a box specified by it's bounds. Use the possibly smaller bounds of the points within the region if useDataBounds is non-zero.

int vtkKdNode::ContainsPoint ( double  x,
double  y,
double  z,
int  useDataBounds 
)

Return 1 if this spatial region entirely contains the given point. Use the possibly smaller bounds of the points within the region if useDataBounds is non-zero.

double vtkKdNode::GetDistance2ToBoundary ( double  x,
double  y,
double  z,
int  useDataBounds 
)

Calculate the distance squared from any point to the boundary of this region. Use the boundary of the points within the region if useDataBounds is non-zero.

double vtkKdNode::GetDistance2ToBoundary ( double  x,
double  y,
double  z,
double boundaryPt,
int  useDataBounds 
)

Calculate the distance squared from any point to the boundary of this region. Use the boundary of the points within the region if useDataBounds is non-zero. Set boundaryPt to the point on the boundary.

double vtkKdNode::GetDistance2ToInnerBoundary ( double  x,
double  y,
double  z 
)

Calculate the distance from the specified point (which is required to be inside this spatial region) to an interior boundary. An interior boundary is one that is not also an boundary of the entire space partitioned by the tree of vtkKdNode's.

void vtkKdNode::PrintNode ( int  depth)

For debugging purposes, print out this node.

void vtkKdNode::PrintVerboseNode ( int  depth)

For debugging purposes, print out this node.


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