mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/releases/CGAL-4.13-branch' into HEAD
This commit is contained in:
commit
0651c97fdd
|
|
@ -221,16 +221,17 @@ public:
|
|||
Orientation_2 orientation_2_object ()const{return Orientation_2(vpm_,static_cast<const Btt*>(this)->orientation_2_object() );}
|
||||
};
|
||||
|
||||
typedef Proj_traits_3<typename Base_traits::Traits_xy_3> Traits_xy_3;
|
||||
typedef Proj_traits_3<typename Base_traits::Traits_yz_3> Traits_yz_3;
|
||||
typedef Proj_traits_3<typename Base_traits::Traits_xz_3> Traits_xz_3;
|
||||
typedef internal::Convex_hull_3::Projection_traits<Base_traits> Base_PTraits;
|
||||
typedef Proj_traits_3<typename Base_PTraits::Traits_xy_3> Traits_xy_3;
|
||||
typedef Proj_traits_3<typename Base_PTraits::Traits_yz_3> Traits_yz_3;
|
||||
typedef Proj_traits_3<typename Base_PTraits::Traits_xz_3> Traits_xz_3;
|
||||
|
||||
Traits_xy_3 construct_traits_xy_3_object()const
|
||||
{return Traits_xy_3(vpm_, static_cast<const Base_traits*>(this)->construct_traits_xy_3_object());}
|
||||
{return Traits_xy_3(vpm_, Base_PTraits(static_cast<const Base_traits&>(*this)).construct_traits_xy_3_object());}
|
||||
Traits_yz_3 construct_traits_yz_3_object()const
|
||||
{return Traits_yz_3(vpm_, static_cast<const Base_traits*>(this)->construct_traits_yz_3_object());}
|
||||
{return Traits_yz_3(vpm_, Base_PTraits(static_cast<const Base_traits&>(*this)).construct_traits_yz_3_object());}
|
||||
Traits_xz_3 construct_traits_xz_3_object()const
|
||||
{return Traits_xz_3(vpm_, static_cast<const Base_traits*>(this)->construct_traits_xz_3_object());}
|
||||
{return Traits_xz_3(vpm_, Base_PTraits(static_cast<const Base_traits&>(*this)).construct_traits_xz_3_object());}
|
||||
|
||||
typename boost::property_traits<PointPropertyMap>::reference
|
||||
get_point(const typename boost::property_traits<PointPropertyMap>::key_type& k) const
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ public:
|
|||
return Constraint_id(NULL);
|
||||
}
|
||||
// protects against inserting twice the same constraint
|
||||
Constraint_id cid = hierarchy.insert_constraint(va, vb);
|
||||
Constraint_id cid = hierarchy.insert_constraint_old_API(va, vb);
|
||||
if (va != vb && (cid != Constraint_id(NULL)) ) insert_subconstraint(va,vb);
|
||||
|
||||
return cid;
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ public:
|
|||
|
||||
// insert/remove
|
||||
void add_Steiner(T va, T vb, T vx);
|
||||
Vertex_list* insert_constraint_old_API(T va, T vb);
|
||||
Vertex_list* insert_constraint(T va, T vb);
|
||||
void append_constraint(Constraint_id cid, T va, T vb);
|
||||
void swap(Constraint_id first, Constraint_id second);
|
||||
|
|
@ -868,6 +869,34 @@ typename Polyline_constraint_hierarchy_2<T,Compare,Data>::Vertex_list*
|
|||
Polyline_constraint_hierarchy_2<T,Compare,Data>::
|
||||
insert_constraint(T va, T vb){
|
||||
Edge he = make_edge(va, vb);
|
||||
Vertex_list* children = new Vertex_list;
|
||||
Context_list* fathers;
|
||||
|
||||
typename Sc_to_c_map::iterator scit = sc_to_c_map.find(he);
|
||||
if(scit == sc_to_c_map.end()){
|
||||
fathers = new Context_list;
|
||||
sc_to_c_map.insert(std::make_pair(he,fathers));
|
||||
} else {
|
||||
fathers = scit->second;
|
||||
}
|
||||
|
||||
children->push_front(Node(va, true)); // was he.first
|
||||
children->push_back(Node(vb, true)); // was he.second
|
||||
constraint_set.insert(children);
|
||||
Context ctxt;
|
||||
ctxt.enclosing = children;
|
||||
ctxt.pos = children->skip_begin();
|
||||
fathers->push_front(ctxt);
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
template <class T, class Compare, class Data>
|
||||
typename Polyline_constraint_hierarchy_2<T,Compare,Data>::Vertex_list*
|
||||
Polyline_constraint_hierarchy_2<T,Compare,Data>::
|
||||
insert_constraint_old_API(T va, T vb){
|
||||
Edge he = make_edge(va, vb);
|
||||
|
||||
// First, check if the constraint was already inserted.
|
||||
// If it was not, then the iterator to the lower bound will serve as
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Constrained_triangulation_plus_2.h>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
|
||||
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
|
||||
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
|
||||
typedef CGAL::Exact_predicates_tag Itag;
|
||||
typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS, Itag> Triangulation;
|
||||
typedef CGAL::Constrained_triangulation_plus_2<Triangulation> Delaunay;
|
||||
|
||||
typedef K::Point_2 Point_2;
|
||||
|
||||
int main()
|
||||
{
|
||||
Delaunay dt;
|
||||
|
||||
dt.insert(Point_2(0,0));
|
||||
dt.insert(Point_2(10,0));
|
||||
dt.insert(Point_2(0,10));
|
||||
dt.insert(Point_2(10,10));
|
||||
|
||||
std::vector<Point_2> vec_constraint;
|
||||
|
||||
vec_constraint.push_back(Point_2(1, 2));
|
||||
vec_constraint.push_back(Point_2(2, 2));
|
||||
vec_constraint.push_back(Point_2(3, 2));
|
||||
|
||||
dt.insert_constraint(vec_constraint.begin(), vec_constraint.end());
|
||||
|
||||
dt.insert_constraint(vec_constraint.begin(), vec_constraint.end());
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue