mirror of https://github.com/CGAL/cgal
ome minor changes; added a private method find_level in the hierarchy
that computes the maximum level of a vertex in the hierarchy
This commit is contained in:
parent
47dd688b4d
commit
a22d1dfd82
|
|
@ -814,7 +814,8 @@ insert_segment(const Site_2& t, Vertex_handle vnear,
|
|||
if ( number_of_vertices() == 0 ) {
|
||||
Vertex_handle v0 = insert_first( t.source() );
|
||||
Vertex_handle v1 = insert_second( t.target() );
|
||||
return insert_third(v0, v1);
|
||||
Vertex_handle vs = insert_third(v0, v1);
|
||||
return vs;
|
||||
} else {
|
||||
Vertex_handle v0, v1;
|
||||
if ( number_of_vertices() == 1 ) {
|
||||
|
|
@ -829,10 +830,11 @@ insert_segment(const Site_2& t, Vertex_handle vnear,
|
|||
}
|
||||
|
||||
Storage_site_2 ss = create_storage_site(v0, v1);
|
||||
return insert_segment2( t, ss, v0, false );
|
||||
// insert_point( t.source_site(), Vertex_handle() );
|
||||
// insert_point( t.target_site(), Vertex_handle() );
|
||||
}
|
||||
// we do not add vs in the vertex list; it is inserted inside
|
||||
// the method insert_segment2
|
||||
vs = insert_segment2( t, ss, v0, false );
|
||||
return vs;
|
||||
} // if ( number_of_vertices() == 0 ) {
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -871,8 +873,8 @@ insert_segment2(const Site_2& t, const Storage_site_2& ss,
|
|||
} else {
|
||||
vnearest = vnear;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
CGAL_assertion( vnearest != Vertex_handle() );
|
||||
// MK: add here code that checks if the inserted segment has already
|
||||
// been inserted; MAYBE THIS IS NOT NEEDED; I ALREADY DO IT IN
|
||||
|
|
@ -971,12 +973,15 @@ insert_segment2(const Site_2& t, const Storage_site_2& ss,
|
|||
// segments are found
|
||||
if ( vcross.first ) {
|
||||
if ( t.is_segment() ) {
|
||||
Intersections_tag itag;
|
||||
return insert_intersecting_segment(ss, t, vcross.second,
|
||||
Intersections_tag());
|
||||
itag);
|
||||
// return vcross.second;
|
||||
}
|
||||
}
|
||||
|
||||
// no intersecting segment has been found; we insert the segment as
|
||||
// usual...
|
||||
Vertex_handle v = create_vertex(ss);
|
||||
|
||||
retriangulate_conflict_region(v, l, fm);
|
||||
|
|
|
|||
|
|
@ -919,10 +919,22 @@ protected:
|
|||
// Vertex_handle insert_third(const Point_2& p0, const Point_2& p1);
|
||||
Vertex_handle insert_third(Vertex_handle v0, Vertex_handle v1);
|
||||
|
||||
Vertex_handle insert_point(const Point_2& p, Vertex_handle vnear);
|
||||
Vertex_handle insert_point(const Storage_site_2& ss,
|
||||
const Site_2& t, Vertex_handle vnear);
|
||||
|
||||
Vertex_handle insert_segment(const Site_2& t, Vertex_handle vnear,
|
||||
bool insert_endpoints);
|
||||
|
||||
Vertex_handle insert_segment2(const Site_2& t,
|
||||
const Storage_site_2& ss,
|
||||
Vertex_handle vnear, bool insert_endpoints);
|
||||
|
||||
template<class ITag>
|
||||
Vertex_handle insert_intersecting_segment(const Storage_site_2& ss,
|
||||
const Site_2& t,
|
||||
Vertex_handle v, ITag tag)
|
||||
Vertex_handle v,
|
||||
ITag tag)
|
||||
{
|
||||
return insert_intersecting_segment_with_tag(ss, t, v, tag);
|
||||
}
|
||||
|
|
@ -937,15 +949,7 @@ protected:
|
|||
const Site_2& t,
|
||||
Vertex_handle v, Tag_true);
|
||||
|
||||
Vertex_handle insert_point(const Point_2& p, Vertex_handle vnear);
|
||||
Vertex_handle insert_point(const Storage_site_2& ss,
|
||||
const Site_2& t, Vertex_handle vnear);
|
||||
|
||||
Vertex_handle insert_segment(const Site_2& t, Vertex_handle vnear,
|
||||
bool insert_endpoints);
|
||||
Vertex_handle insert_segment2(const Site_2& t,
|
||||
const Storage_site_2& ss,
|
||||
Vertex_handle vnear, bool insert_endpoints);
|
||||
|
||||
// methods for insertion
|
||||
void initialize_conflict_region(const Face_handle& f, List& l);
|
||||
|
|
|
|||
|
|
@ -251,6 +251,8 @@ private:
|
|||
Vertex_handle vnear[svd_hierarchy_2__maxlevel],
|
||||
bool force_point) const;
|
||||
int random_level();
|
||||
|
||||
size_type find_level(Vertex_handle v) const;
|
||||
};
|
||||
|
||||
template<class Gt, class STag, class PC, class DS, class LTag>
|
||||
|
|
@ -605,6 +607,16 @@ random_level()
|
|||
return l;
|
||||
}
|
||||
|
||||
template<class Gt, class STag, class PC, class DS, class LTag>
|
||||
inline typename
|
||||
Segment_Voronoi_diagram_hierarchy_2<Gt,STag,PC,DS,LTag>::size_type
|
||||
Segment_Voronoi_diagram_hierarchy_2<Gt,STag,PC,DS,LTag>::
|
||||
find_level(Vertex_handle v) const
|
||||
{
|
||||
size_type level = 0;
|
||||
while ( v->up() != Vertex_handle() ) { level++; }
|
||||
return level;
|
||||
}
|
||||
|
||||
template<class Gt, class STag, class PC, class DS, class LTag>
|
||||
bool
|
||||
|
|
|
|||
Loading…
Reference in New Issue