Skip to content

Commit

Permalink
start updating the AABB-tree to work in both 2D and 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Mar 4, 2024
1 parent d68ef56 commit 006d46b
Show file tree
Hide file tree
Showing 10 changed files with 595 additions and 558 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
\ingroup PkgAABBTreeConcepts
\cgalConcept
The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class
`CGAL::AABB_traits<AABBGeomTraits, AABBPrimitive>`. It provides predicates and constructors to detect
The concept `AABBGeomTraits_3` defines the requirements for the first template parameter of the class
`CGAL::AABB_traits<AABBGeomTraits_3, AABBPrimitive>`. It provides predicates and constructors to detect
and compute intersections between query objects and the primitives stored in the AABB tree.
In addition, it contains predicates and constructors to compute distances between a point query
and the primitives stored in the AABB tree.
Expand All @@ -15,13 +15,13 @@ and the primitives stored in the AABB tree.
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\sa `CGAL::AABB_traits<AABBGeomTraits_3,AABBPrimitive>`
\sa `CGAL::AABB_tree<AABBTraits>`
\sa `AABBPrimitive`
*/

class AABBGeomTraits {
class AABBGeomTraits_3 {
public:

/// \name Types
Expand Down Expand Up @@ -199,5 +199,5 @@ Equal_3 equal_3_object();

/// @}

}; /* end AABBGeomTraits */
}; /* end AABBGeomTraits_3 */

28 changes: 15 additions & 13 deletions AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,48 @@ define the Intersection_distance functor.
class AABBRayIntersectionGeomTraits {
public:
/*!
Type of a 3D ray.
Type of a ray.
*/
typedef unspecified_type Ray_3;
typedef unspecified_type Ray;

/*!
Type of a 3D vector.
Type of a vector.
*/
typedef unspecified_type Vector_3;
typedef unspecified_type Vector;

/*!
A functor object to construct the source point of a ray. Provides the operator:
`Point_3 operator()(const Ray_3&);`
`Point operator()(const Ray&);`
*/
typedef unspecified_type Construct_source_3;
typedef unspecified_type Construct_source;

/*!
*/
Construct_source_3 construct_source_3_object();
Construct_source construct_source_object();

/*!
@todo update me
A model of `CartesianConstIterator3`.
*/
typedef unspecified_type Cartesian_const_iterator_3;
typedef unspecified_type Cartesian_const_iterator;

/*!
@todo update me
A model of `ConstructCartesianConstIterator3`.
*/
typedef unspecified_type Construct_cartesian_const_iterator_3;
typedef unspecified_type Construct_cartesian_const_iterator;

/*!
*/
Construct_source_3 construct_cartesian_const_iterator_3_object();
Construct_source construct_cartesian_const_iterator_object();

/*!
A functor object to construct a vector giving the direction of a ray. Provides the operator:
`Vector_3 operator()(const Ray_3&);`
`Vector operator()(const Ray&);`
*/
typedef unspecified_type Construct_vector_3;
typedef unspecified_type Construct_vector;

/*!
*/
Construct_source_3 construct_vector_3_object();
Construct_source construct_vector_object();
};
25 changes: 8 additions & 17 deletions AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The concept `AABBTraits` provides the geometric primitive types and methods for
\cgalHasModels{CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>}
\cgalHasModelsEnd
\cgalRefines{SearchGeomTraits_3}
\cgalRefines{SearchTraits}
\sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\sa `CGAL::AABB_tree<AABBTraits>`
Expand All @@ -30,7 +30,7 @@ typedef unspecified_type FT;
/*!
Type of a 3D point.
*/
typedef unspecified_type Point_3;
typedef unspecified_type Point;

/*!
Type of primitive.
Expand All @@ -43,19 +43,10 @@ Bounding box type.
*/
typedef unspecified_type Bounding_box;

/*!
enum required for axis selection
*/
enum Axis {
CGAL_X_AXIS,
CGAL_Y_AXIS,
CGAL_Z_AXIS
};

/*!
3D Point and Primitive Id type
*/
typedef std::pair<Point_3, Primitive::Id> Point_and_primitive_id;
typedef std::pair<Point, Primitive::Id> Point_and_primitive_id;

/*!
\deprecated
Expand Down Expand Up @@ -145,21 +136,21 @@ typedef unspecified_type Compare_distance;

/*!
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.
`Point operator()(const Query& query, const Primitive& primitive, const Point & closest);` which returns the closest point to `query`, among `closest` and all points of the primitive.
*/
typedef unspecified_type Closest_point;

/*!
A functor object to compute the squared distance between two points. Provides the operator:
`FT operator()(const Point& query, const Point_3 & p);` which returns the squared distance between `p` and `q`.
`FT operator()(const Point& query, const Point & p);` which returns the squared distance between `p` and `q`.
*/
typedef unspecified_type Squared_distance;

/*!
A functor object to compare two points. Provides the operator:
`bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if `p` is equal to `q`.
`bool operator()(const Point& p, const Point& q);}` which returns `true` if `p` is equal to `q`.
*/
typedef unspecified_type Equal_3;
typedef unspecified_type Equal;
/// @}

/// \name Operations
Expand Down Expand Up @@ -203,7 +194,7 @@ Squared_distance squared_distance_object();
/*!
returns the equal functor.
*/
Equal_3 equal_3_object();
Equal equal_object();

/// @}

Expand Down
19 changes: 12 additions & 7 deletions AABB_tree/doc/AABB_tree/PackageDescription.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

/*!
\addtogroup PkgAABBTreeRef
\cgalPkgDescriptionBegin{3D Fast Intersection and Distance Computation,PkgAABBTree}
\cgalPkgDescriptionBegin{Fast Intersection and Distance Computation,PkgAABBTree}
\cgalPkgPicture{aabb-teaser-thumb.png}
\cgalPkgSummaryBegin
\cgalPkgAuthors{Pierre Alliez, Stéphane Tayeb, and Camille Wormser}
\cgalPkgDesc{The AABB (axis-aligned bounding box) tree component offers a static data structure and algorithms to perform efficient intersection and distance queries on sets of finite 3D geometric objects.}
\cgalPkgManuals{Chapter_3D_Fast_Intersection_and_Distance_Computation,PkgAABBTreeRef}
\cgalPkgManuals{Chapter_Fast_Intersection_and_Distance_Computation,PkgAABBTreeRef}
\cgalPkgSummaryEnd
\cgalPkgShortInfoBegin
\cgalPkgSince{3.5}
Expand All @@ -25,18 +25,23 @@
\cgalCRPSection{Concepts}
- `AABBPrimitive`
- `AABBPrimitiveWithSharedData`
- `AABBGeomTraits`
- `AABBGeomTraits_2`
- `AABBGeomTraits_3`
- `AABBTraits`
- `AABBRayIntersectionGeomTraits`
- `AABBRayIntersectionGeomTraits_2`
- `AABBRayIntersectionGeomTraits_3`
- `AABBRayIntersectionTraits`

\cgalCRPSection{Classes}
- `CGAL::AABB_traits<GeomTraits,Primitive>`
- `CGAL::AABB_traits_2<GeomTraits,Primitive>`
- `CGAL::AABB_traits_3<GeomTraits,Primitive>`
- `CGAL::AABB_tree<AT>`

\cgalCRPSection{Primitives}
- `CGAL::AABB_triangle_primitive<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_segment_primitive<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_triangle_primitive_2<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_segment_primitive_2<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_triangle_primitive_3<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_segment_primitive_3<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,ExternalPropertyMaps,CacheDatum>`
- `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,Vpm,OneHalfedgeGraphPerTree,CacheDatum>`
- `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,Vpm,OneFaceGraphPerTree,CacheDatum>`
Expand Down
2 changes: 1 addition & 1 deletion AABB_tree/doc/AABB_tree/aabb_tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace CGAL {
/*!

\mainpage User Manual
\anchor Chapter_3D_Fast_Intersection_and_Distance_Computation
\anchor Chapter_Fast_Intersection_and_Distance_Computation
\cgalAutoToc

\authors Pierre Alliez, Stephane Tayeb, and Camille Wormser
Expand Down
Loading

0 comments on commit 006d46b

Please sign in to comment.