mirror of https://github.com/CGAL/cgal
Construct_point should grab references whenever possible
This commit is contained in:
parent
def3eb4406
commit
f82396ece2
|
|
@ -27,6 +27,7 @@
|
||||||
#include <boost/random/variate_generator.hpp>
|
#include <boost/random/variate_generator.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <CGAL/internal/Periodic_3_triangulation_iterators_3.h>
|
#include <CGAL/internal/Periodic_3_triangulation_iterators_3.h>
|
||||||
|
#include <CGAL/result_of.h>
|
||||||
#include <CGAL/Periodic_3_triangulation_ds_cell_base_3.h>
|
#include <CGAL/Periodic_3_triangulation_ds_cell_base_3.h>
|
||||||
#include <CGAL/Periodic_3_triangulation_ds_vertex_base_3.h>
|
#include <CGAL/Periodic_3_triangulation_ds_vertex_base_3.h>
|
||||||
#include <CGAL/Periodic_3_triangulation_traits_3.h>
|
#include <CGAL/Periodic_3_triangulation_traits_3.h>
|
||||||
|
|
@ -648,7 +649,8 @@ public:
|
||||||
// but point() -like functions have return type Point
|
// but point() -like functions have return type Point
|
||||||
|
|
||||||
template<typename P> // can be Point or Point_3
|
template<typename P> // can be Point or Point_3
|
||||||
Point_3 construct_point(const P& p) const {
|
typename boost::result_of<const typename Geom_traits::Construct_point_3(const P&)>::type
|
||||||
|
construct_point(const P& p) const {
|
||||||
return geom_traits().construct_point_3_object()(p);
|
return geom_traits().construct_point_3_object()(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@
|
||||||
#include <boost/random/variate_generator.hpp>
|
#include <boost/random/variate_generator.hpp>
|
||||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||||
#include <boost/iterator/zip_iterator.hpp>
|
#include <boost/iterator/zip_iterator.hpp>
|
||||||
|
#include <boost/utility/result_of.hpp>
|
||||||
|
|
||||||
#ifndef CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO
|
#ifndef CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO
|
||||||
#include <CGAL/internal/info_check.h>
|
#include <CGAL/internal/info_check.h>
|
||||||
|
|
@ -295,9 +296,13 @@ public:
|
||||||
Face_handle &fr) const;
|
Face_handle &fr) const;
|
||||||
|
|
||||||
// GEOMETRIC FEATURES AND CONSTRUCTION
|
// GEOMETRIC FEATURES AND CONSTRUCTION
|
||||||
Point_2 construct_point(const Point& p) const;
|
template <typename P> // Point or Point_2
|
||||||
|
typename boost::result_of<const typename Geom_traits::Construct_point_2(const P&)>::type
|
||||||
|
construct_point(const P& p) const { return geom_traits().construct_point_2_object()(p); }
|
||||||
|
|
||||||
const Point& point(Face_handle c, int i) const;
|
const Point& point(Face_handle c, int i) const;
|
||||||
const Point& point(Vertex_handle v) const;
|
const Point& point(Vertex_handle v) const;
|
||||||
|
|
||||||
Segment segment(Face_handle f, int i) const;
|
Segment segment(Face_handle f, int i) const;
|
||||||
Segment segment(const Edge& e) const;
|
Segment segment(const Edge& e) const;
|
||||||
Segment segment(const Edge_circulator& ec) const;
|
Segment segment(const Edge_circulator& ec) const;
|
||||||
|
|
@ -1064,14 +1069,6 @@ is_face(Vertex_handle v1,
|
||||||
return _tds.is_face(v1, v2, v3, fr);
|
return _tds.is_face(v1, v2, v3, fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Gt, class Tds >
|
|
||||||
typename Triangulation_2<Gt, Tds>::Point_2
|
|
||||||
Triangulation_2<Gt, Tds>::
|
|
||||||
construct_point(const Point& p) const
|
|
||||||
{
|
|
||||||
return geom_traits().construct_point_2_object()(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Gt, class Tds >
|
template <class Gt, class Tds >
|
||||||
const typename Triangulation_2<Gt, Tds>::Point&
|
const typename Triangulation_2<Gt, Tds>::Point&
|
||||||
Triangulation_2<Gt, Tds>::
|
Triangulation_2<Gt, Tds>::
|
||||||
|
|
|
||||||
|
|
@ -563,7 +563,8 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template<typename P> // Point or Point_3
|
template<typename P> // Point or Point_3
|
||||||
Point_3 construct_point(const P& p) const
|
typename boost::result_of<const typename Geom_traits::Construct_point_3(const P&)>::type
|
||||||
|
construct_point(const P& p) const
|
||||||
{
|
{
|
||||||
return geom_traits().construct_point_3_object()(p);
|
return geom_traits().construct_point_3_object()(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue