ActiViz .NET
5.8.0
|
vtkModifiedBSPTree - Generate axis aligned BBox tree for raycasting and other Locator based searches More...
Public Member Functions | |
vtkModifiedBSPTree (IntPtr rawCppThis, bool callDisposalMethod, bool strong) | |
Automatically generated constructor - called from generated code. DO NOT call directly. | |
vtkModifiedBSPTree () | |
Construct with maximum 32 cells per node. (average 16->31) | |
override void | BuildLocator () |
Build Tree. | |
override int | FindCell (IntPtr x) |
Build Tree. | |
override int | FindCell (IntPtr x, double tol2, vtkGenericCell GenCell, IntPtr pcoords, IntPtr weights) |
Build Tree. | |
override void | FreeSearchStructure () |
Free tree memory. | |
override void | GenerateRepresentation (int level, vtkPolyData pd) |
Build Tree. | |
virtual void | GenerateRepresentationLeafs (vtkPolyData pd) |
Build Tree. | |
vtkIdListCollection | GetLeafNodeCellInformation () |
Build Tree. | |
override bool | InsideCellBounds (IntPtr x, int cell_ID) |
Build Tree. | |
override int | IntersectWithLine (IntPtr p1, IntPtr p2, double tol, ref double t, IntPtr x, IntPtr pcoords, ref int subId) |
Build Tree. | |
override int | IntersectWithLine (IntPtr p1, IntPtr p2, double tol, ref double t, IntPtr x, IntPtr pcoords, ref int subId, ref int cellId) |
Build Tree. | |
override int | IntersectWithLine (IntPtr p1, IntPtr p2, double tol, ref double t, IntPtr x, IntPtr pcoords, ref int subId, ref int cellId, vtkGenericCell cell) |
Build Tree. | |
override int | IntersectWithLine (IntPtr p1, IntPtr p2, vtkPoints points, vtkIdList cellIds) |
Build Tree. | |
virtual int | IntersectWithLine (IntPtr p1, IntPtr p2, double tol, vtkPoints points, vtkIdList cellIds) |
Build Tree. | |
override int | IsA (string type) |
Standard Type-Macro. | |
new vtkModifiedBSPTree | NewInstance () |
Standard Type-Macro. | |
Static Public Member Functions | |
static new vtkModifiedBSPTree | New () |
Construct with maximum 32 cells per node. (average 16->31) | |
static new int | IsTypeOf (string type) |
Standard Type-Macro. | |
static new vtkModifiedBSPTree | SafeDownCast (vtkObjectBase o) |
Standard Type-Macro. | |
Public Attributes | |
new const string | MRFullTypeName = "Kitware.VTK.vtkModifiedBSPTree" |
Automatically generated type registration mechanics. | |
Static Public Attributes | |
static new readonly string | MRClassNameKey = "18vtkModifiedBSPTree" |
Automatically generated type registration mechanics. | |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Automatically generated protected Dispose method - called from public Dispose or the C# destructor. DO NOT call directly. | |
Private Member Functions | |
static internal IntPtr | vtkModifiedBSPTree_New (ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount) |
static internal void | vtkModifiedBSPTree_BuildLocator_01 (HandleRef pThis) |
static internal int | vtkModifiedBSPTree_FindCell_02 (HandleRef pThis, IntPtr x) |
static internal int | vtkModifiedBSPTree_FindCell_03 (HandleRef pThis, IntPtr x, double tol2, HandleRef GenCell, IntPtr pcoords, IntPtr weights) |
static internal void | vtkModifiedBSPTree_FreeSearchStructure_04 (HandleRef pThis) |
static internal void | vtkModifiedBSPTree_GenerateRepresentation_05 (HandleRef pThis, int level, HandleRef pd) |
static internal void | vtkModifiedBSPTree_GenerateRepresentationLeafs_06 (HandleRef pThis, HandleRef pd) |
static internal IntPtr | vtkModifiedBSPTree_GetLeafNodeCellInformation_07 (HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount) |
static internal byte | vtkModifiedBSPTree_InsideCellBounds_08 (HandleRef pThis, IntPtr x, int cell_ID) |
static internal int | vtkModifiedBSPTree_IntersectWithLine_09 (HandleRef pThis, IntPtr p1, IntPtr p2, double tol, ref double t, IntPtr x, IntPtr pcoords, ref int subId) |
static internal int | vtkModifiedBSPTree_IntersectWithLine_10 (HandleRef pThis, IntPtr p1, IntPtr p2, double tol, ref double t, IntPtr x, IntPtr pcoords, ref int subId, ref int cellId) |
static internal int | vtkModifiedBSPTree_IntersectWithLine_11 (HandleRef pThis, IntPtr p1, IntPtr p2, double tol, ref double t, IntPtr x, IntPtr pcoords, ref int subId, ref int cellId, HandleRef cell) |
static internal int | vtkModifiedBSPTree_IntersectWithLine_12 (HandleRef pThis, IntPtr p1, IntPtr p2, HandleRef points, HandleRef cellIds) |
static internal int | vtkModifiedBSPTree_IntersectWithLine_13 (HandleRef pThis, IntPtr p1, IntPtr p2, double tol, HandleRef points, HandleRef cellIds) |
static internal int | vtkModifiedBSPTree_IsA_14 (HandleRef pThis, string type) |
static internal int | vtkModifiedBSPTree_IsTypeOf_15 (string type) |
static internal IntPtr | vtkModifiedBSPTree_NewInstance_17 (HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount) |
static internal IntPtr | vtkModifiedBSPTree_SafeDownCast_18 (HandleRef o, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount) |
Static Private Member Functions | |
static | vtkModifiedBSPTree () |
Automatically generated type registration mechanics. |
vtkModifiedBSPTree - Generate axis aligned BBox tree for raycasting and other Locator based searches
Description vtkModifiedBSPTree creates an evenly balanced BSP tree using a top down implementation. Axis aligned split planes are found which evenly divide cells into two buckets. Generally a split plane will intersect some cells and these are usually stored in both child nodes of the current parent. (Or split into separate cells which we cannot consider in this case). Storing cells in multiple buckets creates problems associated with multiple tests against rays and increases the required storage as complex meshes will have many cells straddling a split plane (and further splits may cause multiple copies of these).
During a discussion with Arno Formella in 1998 he suggested using a third child node to store objects which straddle split planes. I've not seen this published (Yes! - see below), but thought it worth trying. This implementation of the BSP tree creates a third child node for storing cells lying across split planes, the third cell may overlap the other two, but the two 'proper' nodes otherwise conform to usual BSP rules.
The advantage of this implementation is cells only ever lie in one node and mailbox testing is avoided. All BBoxes are axis aligned and a ray cast uses an efficient search strategy based on near/far nodes and rejects all BBoxes using simple tests.
For fast raytracing, 6 copies of cell lists are stored in each leaf node each list is in axis sorted order +/- x,y,z and cells are always tested in the direction of the ray dominant axis. Once an intersection is found any cell or BBox with a closest point further than the I-point can be instantly rejected and raytracing stops as soon as no nodes can be closer than the current best intersection point.
The addition of the 'middle' node upsets the optimal balance of the tree, but is a minor overhead during the raytrace. Each child node is contracted such that it tightly fits all cells inside it, enabling further ray/box rejections.
This class is intented for persons requiring many ray tests and is optimized for this purpose. As no cell ever lies in more than one leaf node, and parent nodes do not maintain cell lists, the memory overhead of the sorted cell lists is 6*num_cells*4 for 6 lists of ints, each num_cells in length. The memory requirement of the nodes themselves is usually of minor significance.
Subdividision is controlled by MaxCellsPerNode - any node with more than this number will be subdivided providing a good split plane can be found and the max depth is not exceeded.
The average cells per leaf will usually be around half the MaxCellsPerNode, though the middle node is usually sparsely populated and lowers the average slightly. The middle node will not be created when not needed. Subdividing down to very small cells per node is not generally suggested as then the 6 stored cell lists are effectively redundant.
Values of MaxcellsPerNode of around 16->128 depending on dataset size will usually give good results.
Cells are only sorted into 6 lists once - before tree creation, each node segments the lists and passes them down to the new child nodes whilst maintaining sorted order. This makes for an efficient subdivision strategy.
NB. The following reference has been sent to me {formella-1995-ray, author = "Arno Formella and Christian Gill", title = "{Ray Tracing: A Quantitative Analysis and a New Practical Algorithm}", journal = "{The Visual Computer}", year = "{1995}", month = dec, pages = "{465--476}", volume = "{11}", number = "{9}", publisher = "{Springer}", keywords = "{ray tracing, space subdivision, plane traversal, octree, clustering, benchmark scenes}", annote = "{We present a new method to accelerate the process of finding nearest ray--object intersections in ray tracing. The algorithm consumes an amount of memory more or less linear in the number of objects. The basic ideas can be characterized with a modified BSP--tree and plane traversal. Plane traversal is a fast linear time algorithm to find the closest intersection point in a list of bounding volumes hit by a ray. We use plane traversal at every node of the high outdegree BSP--tree. Our implementation is competitive to fast ray tracing programs. We present a benchmark suite which allows for an extensive comparison of ray tracing algorithms.}", }
Thanks John Biddiscombe for developing and contributing this class
ToDo ------------- Implement intersection heap for testing rays against transparent objects
Style -------------- This class is currently maintained by J. Biddiscombe who has specially requested that the code style not be modified to the kitware standard. Please respect the contribution of this class by keeping the style as close as possible to the author's original.
static Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree | ( | ) | [static, private] |
Automatically generated type registration mechanics.
Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree | ( | IntPtr | rawCppThis, |
bool | callDisposalMethod, | ||
bool | strong | ||
) |
Automatically generated constructor - called from generated code. DO NOT call directly.
Construct with maximum 32 cells per node. (average 16->31)
override void Kitware.VTK.vtkModifiedBSPTree.BuildLocator | ( | ) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkLocator.
override void Kitware.VTK.vtkModifiedBSPTree.Dispose | ( | bool | disposing | ) | [protected] |
Automatically generated protected Dispose method - called from public Dispose or the C# destructor. DO NOT call directly.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override int Kitware.VTK.vtkModifiedBSPTree.FindCell | ( | IntPtr | x | ) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override int Kitware.VTK.vtkModifiedBSPTree.FindCell | ( | IntPtr | x, |
double | tol2, | ||
vtkGenericCell | GenCell, | ||
IntPtr | pcoords, | ||
IntPtr | weights | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override void Kitware.VTK.vtkModifiedBSPTree.FreeSearchStructure | ( | ) | [virtual] |
Free tree memory.
Reimplemented from Kitware.VTK.vtkLocator.
override void Kitware.VTK.vtkModifiedBSPTree.GenerateRepresentation | ( | int | level, |
vtkPolyData | pd | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkLocator.
virtual void Kitware.VTK.vtkModifiedBSPTree.GenerateRepresentationLeafs | ( | vtkPolyData | pd | ) | [virtual] |
Build Tree.
Build Tree.
override bool Kitware.VTK.vtkModifiedBSPTree.InsideCellBounds | ( | IntPtr | x, |
int | cell_ID | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override int Kitware.VTK.vtkModifiedBSPTree.IntersectWithLine | ( | IntPtr | p1, |
IntPtr | p2, | ||
double | tol, | ||
ref double | t, | ||
IntPtr | x, | ||
IntPtr | pcoords, | ||
ref int | subId | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override int Kitware.VTK.vtkModifiedBSPTree.IntersectWithLine | ( | IntPtr | p1, |
IntPtr | p2, | ||
double | tol, | ||
ref double | t, | ||
IntPtr | x, | ||
IntPtr | pcoords, | ||
ref int | subId, | ||
ref int | cellId | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override int Kitware.VTK.vtkModifiedBSPTree.IntersectWithLine | ( | IntPtr | p1, |
IntPtr | p2, | ||
double | tol, | ||
ref double | t, | ||
IntPtr | x, | ||
IntPtr | pcoords, | ||
ref int | subId, | ||
ref int | cellId, | ||
vtkGenericCell | cell | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
override int Kitware.VTK.vtkModifiedBSPTree.IntersectWithLine | ( | IntPtr | p1, |
IntPtr | p2, | ||
vtkPoints | points, | ||
vtkIdList | cellIds | ||
) | [virtual] |
Build Tree.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
virtual int Kitware.VTK.vtkModifiedBSPTree.IntersectWithLine | ( | IntPtr | p1, |
IntPtr | p2, | ||
double | tol, | ||
vtkPoints | points, | ||
vtkIdList | cellIds | ||
) | [virtual] |
Build Tree.
override int Kitware.VTK.vtkModifiedBSPTree.IsA | ( | string | type | ) | [virtual] |
Standard Type-Macro.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
static new int Kitware.VTK.vtkModifiedBSPTree.IsTypeOf | ( | string | type | ) | [static] |
Standard Type-Macro.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
static new vtkModifiedBSPTree Kitware.VTK.vtkModifiedBSPTree.New | ( | ) | [static] |
Construct with maximum 32 cells per node. (average 16->31)
Reimplemented from Kitware.VTK.vtkObject.
Standard Type-Macro.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
static new vtkModifiedBSPTree Kitware.VTK.vtkModifiedBSPTree.SafeDownCast | ( | vtkObjectBase | o | ) | [static] |
Standard Type-Macro.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
static internal void Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_BuildLocator_01 | ( | HandleRef | pThis | ) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_FindCell_02 | ( | HandleRef | pThis, |
IntPtr | x | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_FindCell_03 | ( | HandleRef | pThis, |
IntPtr | x, | ||
double | tol2, | ||
HandleRef | GenCell, | ||
IntPtr | pcoords, | ||
IntPtr | weights | ||
) | [private] |
static internal void Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_FreeSearchStructure_04 | ( | HandleRef | pThis | ) | [private] |
static internal void Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_GenerateRepresentation_05 | ( | HandleRef | pThis, |
int | level, | ||
HandleRef | pd | ||
) | [private] |
static internal void Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_GenerateRepresentationLeafs_06 | ( | HandleRef | pThis, |
HandleRef | pd | ||
) | [private] |
static internal IntPtr Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_GetLeafNodeCellInformation_07 | ( | HandleRef | pThis, |
ref uint | mteStatus, | ||
ref uint | mteIndex, | ||
ref uint | rawRefCount | ||
) | [private] |
static internal byte Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_InsideCellBounds_08 | ( | HandleRef | pThis, |
IntPtr | x, | ||
int | cell_ID | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IntersectWithLine_09 | ( | HandleRef | pThis, |
IntPtr | p1, | ||
IntPtr | p2, | ||
double | tol, | ||
ref double | t, | ||
IntPtr | x, | ||
IntPtr | pcoords, | ||
ref int | subId | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IntersectWithLine_10 | ( | HandleRef | pThis, |
IntPtr | p1, | ||
IntPtr | p2, | ||
double | tol, | ||
ref double | t, | ||
IntPtr | x, | ||
IntPtr | pcoords, | ||
ref int | subId, | ||
ref int | cellId | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IntersectWithLine_11 | ( | HandleRef | pThis, |
IntPtr | p1, | ||
IntPtr | p2, | ||
double | tol, | ||
ref double | t, | ||
IntPtr | x, | ||
IntPtr | pcoords, | ||
ref int | subId, | ||
ref int | cellId, | ||
HandleRef | cell | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IntersectWithLine_12 | ( | HandleRef | pThis, |
IntPtr | p1, | ||
IntPtr | p2, | ||
HandleRef | points, | ||
HandleRef | cellIds | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IntersectWithLine_13 | ( | HandleRef | pThis, |
IntPtr | p1, | ||
IntPtr | p2, | ||
double | tol, | ||
HandleRef | points, | ||
HandleRef | cellIds | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IsA_14 | ( | HandleRef | pThis, |
string | type | ||
) | [private] |
static internal int Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_IsTypeOf_15 | ( | string | type | ) | [private] |
static internal IntPtr Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_New | ( | ref uint | mteStatus, |
ref uint | mteIndex, | ||
ref uint | rawRefCount | ||
) | [private] |
static internal IntPtr Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_NewInstance_17 | ( | HandleRef | pThis, |
ref uint | mteStatus, | ||
ref uint | mteIndex, | ||
ref uint | rawRefCount | ||
) | [private] |
static internal IntPtr Kitware.VTK.vtkModifiedBSPTree.vtkModifiedBSPTree_SafeDownCast_18 | ( | HandleRef | o, |
ref uint | mteStatus, | ||
ref uint | mteIndex, | ||
ref uint | rawRefCount | ||
) | [private] |
new readonly string Kitware.VTK.vtkModifiedBSPTree.MRClassNameKey = "18vtkModifiedBSPTree" [static] |
Automatically generated type registration mechanics.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.
new const string Kitware.VTK.vtkModifiedBSPTree.MRFullTypeName = "Kitware.VTK.vtkModifiedBSPTree" |
Automatically generated type registration mechanics.
Reimplemented from Kitware.VTK.vtkAbstractCellLocator.