SbBSPTree - Online Linux Manual Page
Section : 3
Updated : Mon Jan 25 2021
Source : Version 2.5.0
Note : Coin
NAMESbBSPTree − The SbBSPTree class provides a binary space partitioning container.
SYNOPSIS
#include <Inventor/SbBSPTree.h>
Public Member FunctionsSbBSPTree (const int maxnodepts=64, const int initsize=4)
~SbBSPTree ()
int numPoints () const
SbVec3f getPoint (const int idx) const
void getPoint (const int idx, SbVec3f &pt) const
void * getUserData (const int idx) const
void setUserData (const int idx, void *const data)
int addPoint (const SbVec3f &pt, void *const userdata=NULL)
int removePoint (const SbVec3f &pt)
void removePoint (const int idx)
int findPoint (const SbVec3f &pos) const
int findClosest (const SbVec3f &pos) const
void clear (const int initsize=4)
void findPoints (const SbSphere &sphere, SbIntList &array) const
int findClosest (const SbSphere &sphere, SbIntList &array) const
const SbBox3f & getBBox () const
const SbVec3f * getPointsArrayPtr () const
void findPoints (const SbSphere &sphere, SbList< int > &array) const
int findClosest (const SbSphere &sphere, SbList< int > &array) const
Friendsclass coin_bspnode
Detailed DescriptionThe SbBSPTree class provides a binary space partitioning container. This class can be used to organize searches for 3D points or normals in a set in O(log(n)) time. Note: SbBSPTree is an extension to the original Open Inventor API.
Constructor & Destructor Documentation
SbBSPTree::SbBSPTree (const int maxnodepts = 64, const int initsize = 4)Constructor with maxnodepts specifying the maximum number of points in a node before it must be split, and initsize is the number of initially allocated points in the growable points array. If you know approximately the number of points which will be added to the tree, it will help the performance if you supply this in initsize.
SbBSPTree::~SbBSPTree ()Destructor. Frees used memory.
Member Function Documentation
int SbBSPTree::numPoints () constReturns the number of points in the BSP tree. References SbList< Type >::getLength().
SbVec3f SbBSPTree::getPoint (const int idx) constReturns the point at index idx. See also SbBSPTree::numPoints() References SbList< Type >::getLength().
void SbBSPTree::getPoint (const int idx, SbVec3f & pt) constThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. References SbList< Type >::getLength().
void * SbBSPTree::getUserData (const int idx) constReturns the user data for the point at index idx. See also SbBSPTree::addPoint() SbBSPTree::numPoints() References SbList< Type >::getLength().
void SbBSPTree::setUserData (const int idx, void *const data)Sets the user data for the point at index idx to data. See also SbBSPTree::addPoint() SbBSPTree::numPoints() References SbList< Type >::getLength().
int SbBSPTree::addPoint (const SbVec3f & pt, void *const data = NULL)Adds a new point pt to the BSP tree, and returns the index to the new point. The user data for that point will be set to data. If the point already exists in the BSP tree, the index to the old point will be returned. The user data for that point will not be changed. See also SbBSPTree::findPoint() References SbList< Type >::append(), SbBox3f::extendBy(), and SbList< Type >::getLength().
int SbBSPTree::removePoint (const SbVec3f & pt)Removes the point with coordinates pt, and returns the index to the removed point. -1 is returned if no point with those coordinates could be found. Referenced by removePoint().
void SbBSPTree::removePoint (const int idx)Removes the point at index idx. See also SbBSPTree::numPoints() References SbList< Type >::getLength(), and removePoint().
int SbBSPTree::findPoint (const SbVec3f & pos) constWill search the tree, and return the index to the point with coordinates matching pos. If no such point can be found, -1 is returned.
int SbBSPTree::findClosest (const SbVec3f & pos) constThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. References SbList< Type >::getLength(), SbBox3f::getMax(), SbBox3f::getMin(), SbVec3f::length(), SbSphere::setRadius(), and SbList< Type >::truncate().
void SbBSPTree::clear (const int initsize = 4)Will empty all points from the BSP tree. References SbBox3f::makeEmpty(), and SbList< Type >::truncate().
void SbBSPTree::findPoints (const SbSphere & sphere, SbIntList & array) constWill return indices to all points inside sphere. Since Coin 2.3 Referenced by findClosest().
int SbBSPTree::findClosest (const SbSphere & sphere, SbIntList & arr) constWill return the index to the point closest to the center of sphere. Indices to all points inside the sphere is returned in arr. If no points can be found inside the sphere, -1 is returned. Since Coin 2.3 References findPoints(), SbSphere::getCenter(), and SbPList::getLength().
const SbBox3f & SbBSPTree::getBBox () constWill return the bounding box of all points in the BSP tree.
const SbVec3f * SbBSPTree::getPointsArrayPtr (void) constReturns a pointer to the array of points inserted into the BPS tree. References SbList< Type >::getArrayPtr().
void SbBSPTree::findPoints (const SbSphere & sphere, SbList< int > & array) constWARNING: Please don't use this function. It can cause hard to find bugs on the Windows platform if your application is linked against a different CRT than your Coin DLL. Use void findPoints(const SbSphere &sphere, SbIntList & array) instead.
int SbBSPTree::findClosest (const SbSphere & sphere, SbList< int > & arr) constWARNING: Please don't use this function. It can cause hard to find bugs on the Windows platform if your application is linked against a different CRT than your Coin DLL. Use int findClosest(const SbSphere &sphere, SbIntList & arr) instead. References findPoints(), SbSphere::getCenter(), and SbList< Type >::getLength().
AuthorGenerated automatically by Doxygen for Coin from the source code. 0
Johanes Gumabo
Data Size : 33,497 byte
man-SbBSPTree.3coin2Build : 2025-03-22, 13:26 :
Visitor Screen : x
Visitor Counter ( page / site ) : 4 / 2,083,944
Visitor ID : :
Visitor IP : 216.73.216.62 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 37.751000 x -97.822000 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : :
Provider Province : , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 25.03.22
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.