vcg::Octree< OBJECT_TYPE, SCALAR_TYPE > Class Template Reference

#include <octree.h>

Inheritance diagram for vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >:
Inheritance graph
[legend]

List of all members.

Classes

struct  Neighbour
struct  ObjectPlaceholder
struct  ObjectReference
struct  ObjectSorter

Public Types

typedef
TemplatedOctree::BoundingBoxType 
BoundingBoxType
typedef TemplatedOctree::CenterType CenterType
typedef
TemplatedOctree::CoordinateType 
CoordType
typedef Octree::InnerNode * InnerNodePointer
typedef Octree::Leaf * LeafPointer
typedef std::vector< Neighbour >
::iterator 
NeighbourIterator
typedef TemplatedOctree::NodeIndex NodeIndex
typedef
TemplatedOctree::NodePointer 
NodePointer
typedef TemplatedOctree::NodeType NodeType
typedef ReferenceType
< OBJECT_TYPE >::Type * 
ObjectPointer
typedef OBJECT_TYPE ObjectType
typedef SCALAR_TYPE ScalarType
typedef vcg::OctreeTemplate
< VoxelType, SCALAR_TYPE > 
TemplatedOctree
typedef VoxelTypeVoxelPointer
typedef vcg::Voxel VoxelType
typedef TemplatedOctree::ZOrderType ZOrderType

Public Member Functions

template<class OBJECT_POINT_DISTANCE_FUNCTOR , class OBJECT_MARKER >
ObjectPointer GetClosest (OBJECT_POINT_DISTANCE_FUNCTOR &distance_functor, OBJECT_MARKER &, const CoordType &query_point, const ScalarType &max_distance, ScalarType &distance, CoordType &point, bool allow_zero_distance=true)
template<class OBJECT_MARKER , class OBJECT_POINTER_CONTAINER >
unsigned int GetInBox (OBJECT_MARKER &, const BoundingBoxType &query_bounding_box, OBJECT_POINTER_CONTAINER &objects)
template<class OBJECT_POINT_DISTANCE_FUNCTOR , class OBJECT_MARKER , class OBJECT_POINTER_CONTAINER , class DISTANCE_CONTAINER , class POINT_CONTAINER >
unsigned int GetInSphere (OBJECT_POINT_DISTANCE_FUNCTOR &distance_functor, OBJECT_MARKER &, const CoordType &sphere_center, const ScalarType &sphere_radius, OBJECT_POINTER_CONTAINER &objects, DISTANCE_CONTAINER &distances, POINT_CONTAINER &points, bool sort_per_distance=false, bool allow_zero_distance=false)
template<class OBJECT_POINT_DISTANCE_FUNCTOR , class OBJECT_MARKER , class OBJECT_POINTER_CONTAINER , class DISTANCE_CONTAINER , class POINT_CONTAINER >
unsigned int GetKClosest (OBJECT_POINT_DISTANCE_FUNCTOR &distance_functor, OBJECT_MARKER &, unsigned int k, const CoordType &query_point, const ScalarType &max_distance, OBJECT_POINTER_CONTAINER &objects, DISTANCE_CONTAINER &distances, POINT_CONTAINER &points, bool sort_per_distance=true, bool allow_zero_distance=true)
 Octree ()
template<class OBJECT_ITERATOR >
void Set (const OBJECT_ITERATOR &bObj, const OBJECT_ITERATOR &eObj)
 ~Octree ()

Protected Member Functions

int AdjustBoundingBox (BoundingBoxType &query_bb, ScalarType &sphere_radius, const ScalarType max_allowed_distance, std::vector< NodePointer > &leaves, const int required_object_count)
template<class OBJECT_POINTER_CONTAINER , class DISTANCE_CONTAINER , class POINT_CONTAINER >
int CopyQueryResults (std::vector< Neighbour > &neighbors, const unsigned int object_count, OBJECT_POINTER_CONTAINER &objects, DISTANCE_CONTAINER &distances, POINT_CONTAINER &points)
bool GuessInitialBoundingBox (const CoordType &query_point, const ScalarType max_distance, ScalarType &sphere_radius, BoundingBoxType &query_bb)
void IncrementMark ()
void IndexInnerNodes (NodePointer n)
bool IsMarked (const ObjectReference *ref) const
void Mark (const ObjectReference *ref)
template<class OBJECT_POINT_DISTANCE_FUNCTOR >
int RetrieveContainedObjects (const CoordType query_point, OBJECT_POINT_DISTANCE_FUNCTOR &distance_functor, const ScalarType max_allowed_distance, bool allow_zero_distance, std::vector< NodePointer > &leaves, std::vector< Neighbour > &neighbors)

Protected Attributes

unsigned char global_mark
unsigned char * marks
std::vector< ObjectReferencesorted_dataset

Detailed Description

template<class OBJECT_TYPE, class SCALAR_TYPE>
class vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >

Definition at line 109 of file octree.h.


Member Typedef Documentation

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::BoundingBoxType vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::BoundingBoxType

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 127 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::CenterType vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::CenterType

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 128 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::CoordinateType vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::CoordType

Reimplemented from vcg::SpatialIndex< OBJECT_TYPE, SCALAR_TYPE >.

Definition at line 129 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef Octree::InnerNode* vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::InnerNodePointer

Definition at line 118 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef Octree::Leaf* vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::LeafPointer

Definition at line 117 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef std::vector< Neighbour >::iterator vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::NeighbourIterator

Definition at line 135 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::NodeIndex vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::NodeIndex

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 133 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::NodePointer vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::NodePointer

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 132 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::NodeType vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::NodeType

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 131 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef ReferenceType<OBJECT_TYPE>::Type* vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::ObjectPointer

Definition at line 119 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef OBJECT_TYPE vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::ObjectType

Definition at line 116 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef SCALAR_TYPE vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::ScalarType

Reimplemented from vcg::SpatialIndex< OBJECT_TYPE, SCALAR_TYPE >.

Definition at line 112 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef vcg::OctreeTemplate< VoxelType, SCALAR_TYPE > vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::TemplatedOctree

Definition at line 124 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef VoxelType* vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::VoxelPointer

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 122 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef vcg::Voxel vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::VoxelType

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 121 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
typedef TemplatedOctree::ZOrderType vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::ZOrderType

Reimplemented from vcg::OctreeTemplate< Voxel, SCALAR_TYPE >.

Definition at line 125 of file octree.h.


Constructor & Destructor Documentation

template<class OBJECT_TYPE, class SCALAR_TYPE>
vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::Octree (  )  [inline]

Definition at line 217 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::~Octree (  )  [inline]

Definition at line 221 of file octree.h.


Member Function Documentation

template<class OBJECT_TYPE, class SCALAR_TYPE>
int vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::AdjustBoundingBox ( BoundingBoxType query_bb,
ScalarType sphere_radius,
const ScalarType  max_allowed_distance,
std::vector< NodePointer > &  leaves,
const int  required_object_count 
) [inline, protected]

Modify the bounding-box used during the query until either at least k points are contained inside the box or the box radius became greater than the threshold distance Return the number of leaves contained inside the bounding-box

Definition at line 617 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_POINTER_CONTAINER , class DISTANCE_CONTAINER , class POINT_CONTAINER >
int vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::CopyQueryResults ( std::vector< Neighbour > &  neighbors,
const unsigned int  object_count,
OBJECT_POINTER_CONTAINER &  objects,
DISTANCE_CONTAINER &  distances,
POINT_CONTAINER &  points 
) [inline, protected]

Copy the results of a query

Definition at line 691 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_POINT_DISTANCE_FUNCTOR , class OBJECT_MARKER >
ObjectPointer vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::GetClosest ( OBJECT_POINT_DISTANCE_FUNCTOR &  distance_functor,
OBJECT_MARKER &  ,
const CoordType query_point,
const ScalarType max_distance,
ScalarType distance,
CoordType point,
bool  allow_zero_distance = true 
) [inline]

Finds the closest object to a given point.

Definition at line 353 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_MARKER , class OBJECT_POINTER_CONTAINER >
unsigned int vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::GetInBox ( OBJECT_MARKER &  ,
const BoundingBoxType query_bounding_box,
OBJECT_POINTER_CONTAINER &  objects 
) [inline]

Returns all the objects lying inside the specified bbox

Definition at line 492 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_POINT_DISTANCE_FUNCTOR , class OBJECT_MARKER , class OBJECT_POINTER_CONTAINER , class DISTANCE_CONTAINER , class POINT_CONTAINER >
unsigned int vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::GetInSphere ( OBJECT_POINT_DISTANCE_FUNCTOR &  distance_functor,
OBJECT_MARKER &  ,
const CoordType sphere_center,
const ScalarType sphere_radius,
OBJECT_POINTER_CONTAINER &  objects,
DISTANCE_CONTAINER &  distances,
POINT_CONTAINER &  points,
bool  sort_per_distance = false,
bool  allow_zero_distance = false 
) [inline]

Returns all the objects contained inside a specified sphere

Definition at line 448 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_POINT_DISTANCE_FUNCTOR , class OBJECT_MARKER , class OBJECT_POINTER_CONTAINER , class DISTANCE_CONTAINER , class POINT_CONTAINER >
unsigned int vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::GetKClosest ( OBJECT_POINT_DISTANCE_FUNCTOR &  distance_functor,
OBJECT_MARKER &  ,
unsigned int  k,
const CoordType query_point,
const ScalarType max_distance,
OBJECT_POINTER_CONTAINER &  objects,
DISTANCE_CONTAINER &  distances,
POINT_CONTAINER &  points,
bool  sort_per_distance = true,
bool  allow_zero_distance = true 
) [inline]

Retrieve the k closest element to the query point

Definition at line 396 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
bool vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::GuessInitialBoundingBox ( const CoordType query_point,
const ScalarType  max_distance,
ScalarType sphere_radius,
BoundingBoxType query_bb 
) [inline, protected]

Guess an initial bounding-box from which starting the research of the closest point(s).

Returns:
true iff it's possibile to find a sphere, centered in query_point and having radius max_distance at most, which collide the octree bounding-box.

Definition at line 588 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
void vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::IncrementMark (  )  [inline, protected]

The expansion factor used to solve the spatial queries The current expansion factor is computed on the basis of the last expansion factor and on the history of these values, through the following heuristic: current_expansion_factor = alpha*last_expansion_factor + (1.0f-alpha)*mean_expansion_factor where alpha = 1.0/3.0;

Definition at line 563 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
void vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::IndexInnerNodes ( NodePointer  n  )  [inline, protected]

When all the leaves are indexed, this procedure is called in order to propagate the indexing information to the inner nodes

Definition at line 719 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
bool vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::IsMarked ( const ObjectReference ref  )  const [inline, protected]

Definition at line 576 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
void vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::Mark ( const ObjectReference ref  )  [inline, protected]

Definition at line 581 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_POINT_DISTANCE_FUNCTOR >
int vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::RetrieveContainedObjects ( const CoordType  query_point,
OBJECT_POINT_DISTANCE_FUNCTOR &  distance_functor,
const ScalarType  max_allowed_distance,
bool  allow_zero_distance,
std::vector< NodePointer > &  leaves,
std::vector< Neighbour > &  neighbors 
) [inline, protected]

Retrieves the objects contained inside the leaves whose distance isn't greater than max_distance. Returns the number of valid objects

Definition at line 652 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
template<class OBJECT_ITERATOR >
void vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::Set ( const OBJECT_ITERATOR &  bObj,
const OBJECT_ITERATOR &  eObj 
) [inline]

Populate the octree

Definition at line 235 of file octree.h.


Member Data Documentation

template<class OBJECT_TYPE, class SCALAR_TYPE>
unsigned char vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::global_mark [protected]

Definition at line 546 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
unsigned char* vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::marks [protected]

Markers used to avoid duplication of the same result during a query

Definition at line 545 of file octree.h.

template<class OBJECT_TYPE, class SCALAR_TYPE>
std::vector< ObjectReference > vcg::Octree< OBJECT_TYPE, SCALAR_TYPE >::sorted_dataset [protected]

Contains pointer to the objects in the dataset. The pointers are sorted so that the object pointed to result ordered in the space

Definition at line 533 of file octree.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:23:03 2013