|
| |
returns
the intersection result of and by means of the polymorphic
wrapper type Object. The returned object can be tested for the
intersection result and assigned by means of the operation bool assign(T& t, Object o). Precondition: The objects are of the same dimension. |
The possible value for types Type1 and Type2 and the possible return values wrapped in Object are the following:
The following example demonstrates the most common use of intersection routines.
#include <CGAL/intersections_d.h> template <class R> void foo(Segment_d<R> seg, Line_d<R> lin) { Point_d<R> ipnt; Segment_d<R> iseg; Object result = intersection(seg, lin); if ( assign(ipnt, result) ) { // handle the point intersection case. } else if ( assign(iseg, result) ) { // handle the segment intersection case. } else { // handle the no intersection case. } }