AABBTraits

Definition

The concept AABBTraits provides the geometric primitive types and methods for the class AABB_tree<AT>.

Types

AABBTraits::FT
Value type of the Squared_distance functor.


AABBTraits::Point_3
Type of a 3D point.


AABBTraits::Primitive
Type of primitive. Must be a model of the concept AABBPrimitive.


AABBTraits::Bounding_box
Bounding box type.


AABBTraits::enum Axis { X_AXIS, Y_AXIS, Z_AXIS }

typedef std::pair<Point_3, Primitive::Id>
Point_and_primitive_id;

typedef std::pair<Object, Primitive::Id>
Object_and_primitive_id;
During the construction of the AABB_tree, the primitives are sorted according to some comparison functions related to the x, y or z coordinate axis:
AABBTraits::Split_primitives_along_x_axis
A functor object to split a range of primitives into two sub-ranges along the X-axis. Provides the operator: void operator()(InputIterator first, InputIterator beyond); Iterator InputIterator must be a model of RandomAccessIterator and have Primitive as value type. The operator is used for determining the primitives assigned to the two children nodes of a given node, assuming that the goal is to split the X-dimension of the bounding box of the node. The primitives assigned to this node are passed as argument to the operator. It should modify the iterator range in such a way that its first half and its second half correspond to the two children nodes.


AABBTraits::Split_primitives_along_y_axis
A functor object to split a range of primitives into two sub-ranges along the Y-axis. See Split_primitives_along_x_axis for the detailed description.


AABBTraits::Split_primitives_along_z_axis
A functor object to split a range of primitives into two sub-ranges along the Z-axis. See Split_primitives_along_x_axis for the detailed description.


AABBTraits::Compute_bbox
A functor object to compute the bounding box of a set of primitives. Provides the operator: Bounding_box operator()(Input_iterator begin, Input_iterator beyond); Iterator InputIterator must have Primitive as value type.


AABBTraits::Splitting_direction
A functor object to specify the direction along which the bounding box should be split: Axis operator()(const Bounding_box& bbox); which returns the direction used for splitting bbox. It is usually the axis aligned with the longest edge of bbox.

The following predicates are required for each type Query for which the class AABB_tree<AT> may receive an intersection detection or computation query.
AABBTraits::Do_intersect
A functor object to compute intersection predicates between the query and the nodes of the tree. Provides the operators: bool operator()(const Query & q, const Bounding_box & box); which returns true iff the query intersects the bounding box, and bool operator()(const Query & q, const Primitive & primitive); which returns true iff the query intersects the primitive.


AABBTraits::Intersect
A functor object to compute the intersection of a query and a primitive. Provides the operator: boost::optional<Object_and_primitive_id> operator()(const Query & q, const Primitive& primitive); which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.

The following predicates are required for each type Query for which the class AABB_tree<AT> may receive a distance query.
AABBTraits::Compare_distance
A functor object to compute distance comparisons between the query and the nodes of the tree. Provides the operators: bool operator()(const Query & query, const Bounding_box& box, const Point & closest); which returns true iff the bounding box is closer to query than closest is, and bool operator()(const Query & query, const Primitive & primitive, const Point & closest); which returns true iff primitive is closer to the query than closest is.


AABBTraits::Closest_point
A functor object to compute closest point from the query on a primitive. Provides the operator: Point_3 operator()(const Query& query, const Primitive& primitive, const Point_3 & closest); which returns the closest point to query, among closest and all points of the primitive.


AABBTraits::Squared_distance
A functor object to compute the squared distance between the query and a point. Provides the operator: FT operator()(const Query& query, const Point_3 & p); which returns the squared distance between query and p.

Operations

Split_primitives_along_x_axis traits.split_primitives_along_x_axis_object ()
Returns the primitive splitting functor for the X axis.

Split_primitives_along_y_axis traits.split_primitives_along_y_axis_object ()
Returns the primitive splitting functor for the Y axis.

Split_primitives_along_z_axis traits.split_primitives_along_z_axis_object ()
Returns the primitive splitting functor for the Z axis.

Compute_bbox traits.compute_bbox_object () Returns the bounding box constructor.

Do_intersect traits.do_intersect_object () Returns the intersection detection functor.

Intersect traits.intersect_object () Returns the intersection constructor.

Compare_distance traits.compare_distance_object () Returns the distance comparison functor.

Closest_point traits.closest_point_object () Returns the closest point constructor.

Has Models

AABB_traits<GeomTraits,TrianglePrimitive>.

See Also

AABB_traits<GeomTraits,TrianglePrimitive>
AABB_tree<AT> AABBPrimitive