Skip to content

Commit

Permalink
Merge remote-tracking branch 'cgal/5.6.x-branch'
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Dec 18, 2023
2 parents ec9de37 + ee1fa58 commit 89d3d74
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ intersection(const typename K::Plane_3& plane1,
typename K::Line_3,
typename K::Plane_3> > result_type;

typedef typename K::Point_3 Point_3;
typedef typename K::Line_3 Line_3;
typedef typename K::Plane_3 Plane_3;

auto res = intersection_point(plane1,plane2,plane3, k);
if (res)
return result_type(*res);

// Intersection between plane1 and plane2 can either be
// a line, a plane, or empty.
typename Intersection_traits<K, Plane_3, Plane_3>::result_type
Expand All @@ -97,26 +100,19 @@ intersection(const typename K::Plane_3& plane1,
{
if(const Line_3* l = intersect_get<Line_3>(o12))
{
// either point or line
typename Intersection_traits<K, Plane_3, Line_3>::result_type
v = internal::intersection(plane3, *l, k);
if(v)
{
if(const Point_3* p = intersect_get<Point_3>(v))
return result_type(*p);
else if(const Line_3* l = intersect_get<Line_3>(v))
return result_type(*l);
}
if (internal::do_intersect(*l, plane3, k))
return result_type(*l);
}
else if(const Plane_3 *pl = intersect_get<Plane_3>(o12))
else
{
CGAL_assertion(intersect_get<Plane_3>(o12) != nullptr);
// either line or plane
typename Intersection_traits<K, Plane_3, Plane_3>::result_type
v = internal::intersection(plane3, *pl, k);
v = internal::intersection(plane3, plane1, k);
if(v)
{
if(const Plane_3* p = intersect_get<Plane_3>(v))
return result_type(*p);
if( intersect_get<Plane_3>(v)!=nullptr)
return result_type(plane1);
else if(const Line_3* l = intersect_get<Line_3>(v))
return result_type(*l);
}
Expand Down
17 changes: 5 additions & 12 deletions Kernel_23/test/Kernel_23/include/CGAL/_test_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,19 @@
#ifndef CGAL__TEST_IO_H
#define CGAL__TEST_IO_H

#include <fstream>
#include <sstream>
#include <cassert>

#ifndef TEST_FILENAME
# define TEST_FILENAME "Test_IO.out"
#endif

template <class T>
void
_test_io_for(const T& t)
{
{
std::ofstream oFile(TEST_FILENAME, std::ios::out);
oFile << t << std::endl;
}
std::stringstream ss;
ss << t << std::endl;

std::ifstream iFile(TEST_FILENAME, std::ios::in);
T u = t;
iFile >> u;
assert(!iFile.fail());
ss >> u;
assert(! ss.fail() );
assert(u == t);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ self_intersections_impl(const FaceRange& face_range,
* @tparam FaceRange a model of `ConstRange` with value type `boost::graph_traits<TriangleMesh>::%face_descriptor`.
* @tparam TriangleMesh a model of `FaceListGraph`
* @tparam FacePairOutputIterator a model of `OutputIterator` holding objects of type
* `std::pair<boost::graph_traits<TriangleMesh>::%face_descriptor, boost::graph_traits<TriangleMesh>::%face_descriptor>`
* `std::pair<boost::graph_traits<TriangleMesh>::%face_descriptor, boost::graph_traits<TriangleMesh>::%face_descriptor>`.
* It does not need to be thread-safe.
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
*
* @param face_range the range of faces to check for self-intersection.
Expand Down Expand Up @@ -596,7 +597,8 @@ self_intersections(const FaceRange& face_range,
* Possible values are `Sequential_tag`, `Parallel_tag`, and `Parallel_if_available_tag`.
* @tparam TriangleMesh a model of `FaceListGraph`
* @tparam FacePairOutputIterator a model of `OutputIterator` holding objects of type
* `std::pair<boost::graph_traits<TriangleMesh>::%face_descriptor, boost::graph_traits<TriangleMesh>::%face_descriptor>`
* `std::pair<boost::graph_traits<TriangleMesh>::%face_descriptor, boost::graph_traits<TriangleMesh>::%face_descriptor>`.
* It does not need to be thread-safe.
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
*
* @param tmesh the triangulated surface mesh to be checked
Expand Down

0 comments on commit 89d3d74

Please sign in to comment.