mirror of https://github.com/CGAL/cgal
simplified insert_outside_affine_hull, therefore changed also update_ghost_faces
This commit is contained in:
parent
ac2bea87f4
commit
33c460e584
|
|
@ -181,12 +181,13 @@ void set_radius(double radius){
|
||||||
Vertex_handle insert(const Point &p, Face_handle f = Face_handle() );
|
Vertex_handle insert(const Point &p, Face_handle f = Face_handle() );
|
||||||
Vertex_handle insert_first(const Point &p);
|
Vertex_handle insert_first(const Point &p);
|
||||||
Vertex_handle insert_second(const Point &p);
|
Vertex_handle insert_second(const Point &p);
|
||||||
Vertex_handle insert_outside_affine_hull_regular(const Point& p,bool plane=false);
|
//Vertex_handle insert_outside_affine_hull_regular(const Point& p,bool plane=false);
|
||||||
|
Vertex_handle insert_outside_affine_hull_regular(const Point& p);
|
||||||
//Vertex_handle insert_hole_approach_2(const Point &p, Locate_type lt, Face_handle loc, int li) ;
|
//Vertex_handle insert_hole_approach_2(const Point &p, Locate_type lt, Face_handle loc, int li) ;
|
||||||
Vertex_handle insert_in_plane_triangulation(const Point &p, Locate_type lt, Face_handle loc);
|
Vertex_handle insert_in_plane_triangulation(const Point &p, Locate_type lt, Face_handle loc);
|
||||||
|
|
||||||
bool test_conflict(const Point &p, Face_handle fh) const;
|
bool test_conflict(const Point &p, Face_handle fh) const;
|
||||||
bool update_ghost_faces(Vertex_handle v=Vertex_handle());
|
bool update_ghost_faces(Vertex_handle v=Vertex_handle(), bool first = false);
|
||||||
|
|
||||||
//REMOVAL
|
//REMOVAL
|
||||||
void remove_degree_3(Vertex_handle v, Face_handle f = Face_handle());
|
void remove_degree_3(Vertex_handle v, Face_handle f = Face_handle());
|
||||||
|
|
@ -568,7 +569,8 @@ is_valid(bool verbose, int level ) const //int level
|
||||||
case 2 :
|
case 2 :
|
||||||
for(All_faces_iterator it=all_faces_begin(); it!=all_faces_end(); it++) {
|
for(All_faces_iterator it=all_faces_begin(); it!=all_faces_end(); it++) {
|
||||||
Orientation s = orientation(it->vertex(0)->point(), it->vertex(1)->point(), it->vertex(2)->point());
|
Orientation s = orientation(it->vertex(0)->point(), it->vertex(1)->point(), it->vertex(2)->point());
|
||||||
result = result && ( s == LEFT_TURN || it->is_ghost());
|
//result = result && ( s == LEFT_TURN || it->is_ghost());
|
||||||
|
result = result && (s != NEGATIVE || it->is_ghost());
|
||||||
CGAL_triangulation_assertion(result);
|
CGAL_triangulation_assertion(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -661,47 +663,6 @@ insert_in_plane_triangulation(const Point &p, Locate_type lt, Face_handle loc){
|
||||||
CGAL_triangulation_precondition(!test_dim_up(p));
|
CGAL_triangulation_precondition(!test_dim_up(p));
|
||||||
CGAL_triangulation_precondition(dimension()==1);
|
CGAL_triangulation_precondition(dimension()==1);
|
||||||
|
|
||||||
/*
|
|
||||||
Face_handle f = edges_begin()->first;
|
|
||||||
Face_handle loc;
|
|
||||||
//existing points coplanar with sphere?
|
|
||||||
Orientation pqr = orientation(f->vertex(0)->point(),
|
|
||||||
f->vertex(1)->point(),
|
|
||||||
f->neighbor(0)->vertex(1)->point());
|
|
||||||
if( pqr != ON_ORIENTED_BOUNDARY ){
|
|
||||||
Edges_iterator eit=edges_begin();
|
|
||||||
do{
|
|
||||||
Face_handle f=eit->first;
|
|
||||||
Vertex_handle v1 = f->vertex(0);
|
|
||||||
Vertex_handle v2 = f -> vertex(1);
|
|
||||||
if(orientation(v1->point(), v2->point(), p)==RIGHT_TURN){
|
|
||||||
loc = f;
|
|
||||||
break;
|
|
||||||
|
|
||||||
} eit++;
|
|
||||||
}while( eit!=edges_end());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
Edges_iterator eit=edges_begin();
|
|
||||||
Point po = Point(0,0,0);
|
|
||||||
|
|
||||||
do{
|
|
||||||
Face_handle f=eit->first;
|
|
||||||
Vertex_handle v1 = f->vertex(0);
|
|
||||||
Vertex_handle v2 = f -> vertex(1);
|
|
||||||
|
|
||||||
//ERROR
|
|
||||||
bool conflict = Base::collinear_between(v1->point(), v2->point(), p);
|
|
||||||
//Orientation o=coplanar_orientation(v1->point(), v2->point(), p);
|
|
||||||
//if(o ==RIGHT_TURN){
|
|
||||||
if(conflict){
|
|
||||||
loc = f;
|
|
||||||
break;
|
|
||||||
|
|
||||||
} eit++;
|
|
||||||
}while( eit!=edges_end());
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Vertex_handle v0 = loc->vertex(0);
|
Vertex_handle v0 = loc->vertex(0);
|
||||||
Vertex_handle v1 = loc->vertex(1);
|
Vertex_handle v1 = loc->vertex(1);
|
||||||
|
|
@ -722,7 +683,7 @@ insert_in_plane_triangulation(const Point &p, Locate_type lt, Face_handle loc){
|
||||||
|
|
||||||
delete_face(loc);
|
delete_face(loc);
|
||||||
|
|
||||||
|
update_ghost_faces(v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -756,9 +717,8 @@ typename Regular_triangulation_on_sphere_2<Gt,Tds>::Vertex_handle
|
||||||
Regular_triangulation_on_sphere_2<Gt,Tds>::
|
Regular_triangulation_on_sphere_2<Gt,Tds>::
|
||||||
insert(const Point &p, Locate_type lt, Face_handle loc, int li) {
|
insert(const Point &p, Locate_type lt, Face_handle loc, int li) {
|
||||||
|
|
||||||
//!!!!!!!!!!!!TODO point is valide!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
Vertex_handle v;
|
Vertex_handle v;
|
||||||
|
|
||||||
switch (dimension()){
|
switch (dimension()){
|
||||||
case -2 :
|
case -2 :
|
||||||
return insert_first(p);
|
return insert_first(p);
|
||||||
|
|
@ -770,22 +730,19 @@ insert(const Point &p, Locate_type lt, Face_handle loc, int li) {
|
||||||
return insert_outside_affine_hull_regular(p);
|
return insert_outside_affine_hull_regular(p);
|
||||||
|
|
||||||
|
|
||||||
case 1:
|
case 1:{
|
||||||
if(test_dim_up(p)){
|
if(test_dim_up(p)){
|
||||||
Face_handle f=all_edges_begin()->first;
|
Face_handle f=all_edges_begin()->first;
|
||||||
Vertex_handle v1=f->vertex(0);
|
Vertex_handle v1=f->vertex(0);
|
||||||
Vertex_handle v2=f->vertex(1);
|
Vertex_handle v2=f->vertex(1);
|
||||||
Vertex_handle v3=f->neighbor(0)->vertex(1);
|
Vertex_handle v3=f->neighbor(0)->vertex(1);
|
||||||
Orientation orient=orientation(v1->point(),v2->point(),v3->point()) ;
|
return insert_outside_affine_hull_regular(p);
|
||||||
v = insert_outside_affine_hull_regular(p,orient==COLLINEAR);
|
|
||||||
return v;
|
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
v= insert_in_plane_triangulation(p,lt,loc);
|
return insert_in_plane_triangulation(p,lt,loc);
|
||||||
return v;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
case 2:
|
case 2:{
|
||||||
std::vector<Face_handle> faces;
|
std::vector<Face_handle> faces;
|
||||||
std::vector<Edge> edges;
|
std::vector<Edge> edges;
|
||||||
faces.reserve(32);
|
faces.reserve(32);
|
||||||
|
|
@ -796,163 +753,128 @@ insert(const Point &p, Locate_type lt, Face_handle loc, int li) {
|
||||||
v->set_point(p);
|
v->set_point(p);
|
||||||
delete_faces(faces.begin(), faces.end());
|
delete_faces(faces.begin(), faces.end());
|
||||||
|
|
||||||
|
if( lt != FACE )
|
||||||
//if( lt != FACE )
|
|
||||||
update_ghost_faces(v);
|
update_ghost_faces(v);
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
CGAL_assertion(false);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Gt, class Tds >
|
template <class Gt, class Tds >
|
||||||
typename Triangulation_on_sphere_2<Gt,Tds>::Vertex_handle
|
typename Triangulation_on_sphere_2<Gt,Tds>::Vertex_handle
|
||||||
Regular_triangulation_on_sphere_2<Gt,Tds>::
|
Regular_triangulation_on_sphere_2<Gt,Tds>::
|
||||||
insert_outside_affine_hull_regular(const Point& p,bool plane)
|
insert_outside_affine_hull_regular(const Point& p)
|
||||||
{
|
{
|
||||||
|
if(dimension()==0){
|
||||||
|
Vertex_handle v = vertices_begin();
|
||||||
|
Vertex_handle u=v->face()->neighbor(0)->vertex(0);
|
||||||
|
Vertex_handle nv;
|
||||||
|
|
||||||
if(dimension()==0){
|
//orientation is given by the 2 first points
|
||||||
Vertex_handle v = vertices_begin();
|
if( collinear_between(v->point(),u->point(),p) || orientation(u->point(),v->point(),p) == LEFT_TURN )
|
||||||
Vertex_handle u=v->face()->neighbor(0)->vertex(0);
|
nv=Base::tds().insert_dim_up(v,false);
|
||||||
Vertex_handle nv;
|
else
|
||||||
|
nv=Base::tds().insert_dim_up(v,true);
|
||||||
|
|
||||||
//orientation is given by the 2 first points
|
nv->set_point(p);
|
||||||
if( collinear_between(v->point(),u->point(),p) || orientation(u->point(),v->point(),p) == LEFT_TURN )
|
|
||||||
nv=Base::tds().insert_dim_up(v,false);
|
|
||||||
else
|
|
||||||
nv=Base::tds().insert_dim_up(v,true);
|
|
||||||
nv->set_point(p);
|
|
||||||
|
|
||||||
|
Face_handle f=all_edges_begin()->first;
|
||||||
|
CGAL_triangulation_assertion( orientation(f->vertex(0)->point(), f->vertex(1)->point(),
|
||||||
|
f->neighbor(0)->vertex(1)->point()) != RIGHT_TURN );
|
||||||
|
|
||||||
CGAL_triangulation_assertion( orientation(all_edges_begin()->first->vertex(0)->point(),
|
update_ghost_faces(nv);
|
||||||
all_edges_begin()->first->vertex(1)->point(),
|
return nv;
|
||||||
all_edges_begin()->first->neighbor(0)->vertex(1)->point())
|
}
|
||||||
!= RIGHT_TURN );
|
|
||||||
|
|
||||||
//seting ghost edge if needed
|
else{ //dimension 1
|
||||||
bool done=false;
|
bool conform = false;
|
||||||
All_edges_iterator eit=all_edges_begin();
|
Face_handle f = (all_edges_begin())->first;
|
||||||
do{
|
Face_handle fn=f->neighbor(0);
|
||||||
Face_handle f=eit->first;
|
const Point p0=f->vertex(0)->point();
|
||||||
Face_handle fn=f->neighbor(0);
|
const Point p1=f->vertex(1)->point();
|
||||||
Point q=fn->vertex(1)->point();
|
const Point p2=fn->vertex(1)->point();
|
||||||
if(collinear_between(f->vertex(0)->point(),f->vertex(1)->point(),q)){
|
Orientation orient = orientation(p0, p1, p2);
|
||||||
f->ghost()=true;
|
Orientation orient2 = power_test(p0, p1, p2, p);
|
||||||
}
|
CGAL_triangulation_assertion(orient!=NEGATIVE);
|
||||||
else{
|
|
||||||
f->ghost()=false;
|
|
||||||
}
|
|
||||||
++eit;
|
|
||||||
}while( eit!=all_edges_end() && !done );
|
|
||||||
|
|
||||||
return nv;
|
if(orient2==POSITIVE)
|
||||||
}
|
conform =true;
|
||||||
|
|
||||||
else{ //dimension=1
|
|
||||||
bool conform = false;
|
|
||||||
Face_handle f = (all_edges_begin())->first;
|
|
||||||
|
|
||||||
if(plane){//points coplanar with geom_traits->sphere
|
|
||||||
Vertex_handle v1 = f->vertex(0);
|
|
||||||
Vertex_handle v2 = f->vertex(1);
|
|
||||||
Orientation orient = orientation( f->vertex(0)->point(),f->vertex(1)->point(),p);
|
|
||||||
//conform = ( orient == COUNTERCLOCKWISE);
|
|
||||||
conform = (orient != CLOCKWISE);
|
|
||||||
}
|
|
||||||
|
|
||||||
else{//three vertices non-coplanar with geom_traits->sphere
|
|
||||||
Face_handle fn=f->neighbor(0);
|
|
||||||
|
|
||||||
const Point p0=f->vertex(0)->point();
|
|
||||||
const Point p1=f->vertex(1)->point();
|
|
||||||
const Point p2=fn->vertex(1)->point();
|
|
||||||
|
|
||||||
Orientation orient = orientation(p0, p1, p2);
|
|
||||||
Orientation orient2 = power_test(p0, p1, p2, p);
|
|
||||||
CGAL_triangulation_assertion(orient);
|
|
||||||
if(orient2==POSITIVE)
|
|
||||||
conform =true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//find smalest vertex
|
|
||||||
Vertex_handle w=vertices_begin();
|
|
||||||
All_vertices_iterator vi;
|
|
||||||
for( vi = vertices_begin(); vi != vertices_end(); vi++){
|
|
||||||
if(compare_xyz(w->point(), vi->point())<0)
|
|
||||||
w=vi;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Vertex_handle v = this->_tds.insert_dim_up( f->vertex(0), conform);
|
|
||||||
Vertex_handle v = this->_tds.insert_dim_up( w, conform);
|
|
||||||
v->set_point(p);
|
|
||||||
|
|
||||||
this->_ghost=all_faces_begin();
|
|
||||||
|
|
||||||
|
|
||||||
//seting ghost faces if needed
|
|
||||||
All_faces_iterator fit;
|
|
||||||
for(fit =all_faces_begin(); fit !=all_faces_end(); fit++) {
|
|
||||||
//if(orientation(fit)==NEGATIVE){
|
|
||||||
if(orientation(fit)!=POSITIVE){
|
|
||||||
fit->ghost()=true;
|
|
||||||
this->_ghost=fit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//find smalest vertex
|
||||||
|
Vertex_handle w=vertices_begin();
|
||||||
|
All_vertices_iterator vi;
|
||||||
|
for( vi = vertices_begin(); vi != vertices_end(); vi++){
|
||||||
|
if(compare_xyz(w->point(), vi->point())<0)
|
||||||
|
w=vi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Vertex_handle v = this->_tds.insert_dim_up( w, conform);
|
||||||
|
v->set_point(p);
|
||||||
|
this->_ghost=all_faces_begin();
|
||||||
|
update_ghost_faces(v, true);
|
||||||
|
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template < class Gt, class Tds >
|
template < class Gt, class Tds >
|
||||||
bool
|
bool
|
||||||
Regular_triangulation_on_sphere_2<Gt,Tds>::
|
Regular_triangulation_on_sphere_2<Gt,Tds>::
|
||||||
update_ghost_faces(Vertex_handle v)
|
update_ghost_faces(Vertex_handle v, bool first)
|
||||||
{
|
{
|
||||||
bool neg_found=false;
|
bool neg_found=false;
|
||||||
if(dimension()==1){
|
if(dimension()==1){
|
||||||
All_edges_iterator eit=all_edges_begin();
|
All_edges_iterator eit=all_edges_begin();
|
||||||
do{
|
for (; eit!=all_edges_end(); eit++){
|
||||||
Face_handle f=eit->first;
|
Face_handle f=eit->first;
|
||||||
Face_handle fn=f->neighbor(0);
|
Face_handle fn=f->neighbor(0);
|
||||||
Point q=fn->vertex(1)->point();
|
Point q=fn->vertex(1)->point();
|
||||||
if(collinear_between(f->vertex(0)->point(),f->vertex(1)->point(),q)){
|
if(collinear_between(f->vertex(0)->point(),f->vertex(1)->point(),q)){
|
||||||
f->ghost()=true;
|
f->ghost()=true;
|
||||||
neg_found = true;
|
neg_found = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
f->ghost()=false;
|
f->ghost()=false;
|
||||||
++eit;
|
}
|
||||||
}while( eit!=all_edges_end());
|
}
|
||||||
}
|
|
||||||
else{//dimension==2
|
else{//dimension==2
|
||||||
|
if (first){ //first time dimension 2
|
||||||
|
All_faces_iterator fi = all_faces_begin();
|
||||||
|
for(;fi!=all_faces_end();fi++){
|
||||||
|
if(orientation(fi)!=POSITIVE){
|
||||||
|
fi->ghost()=true;
|
||||||
|
neg_found=true;
|
||||||
|
this->_ghost=fi;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fi->ghost()=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Face_circulator fc=incident_faces(v,v->face());
|
else { //not first
|
||||||
Face_circulator done(fc);
|
Face_circulator fc=incident_faces(v,v->face());
|
||||||
|
Face_circulator done(fc);
|
||||||
do{
|
do{
|
||||||
//if(orientation(fc)==NEGATIVE){
|
|
||||||
if(orientation(fc)!=POSITIVE){
|
if(orientation(fc)!=POSITIVE){
|
||||||
fc->ghost()=true;
|
fc->ghost()=true;
|
||||||
neg_found=true;
|
neg_found=true;
|
||||||
this->_ghost=fc;
|
this->_ghost=fc;
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
fc->ghost()=false;
|
fc->ghost()=false;
|
||||||
}
|
}while(++fc!=done);
|
||||||
}while(++fc!=done);
|
}
|
||||||
|
|
||||||
}
|
|
||||||
return neg_found;
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return neg_found;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------REMOVAL----------------------------------------------------//
|
//-------------------------------------------------------------------------------REMOVAL----------------------------------------------------//
|
||||||
template < class Gt, class Tds >
|
template < class Gt, class Tds >
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -356,6 +356,11 @@ Orientation coplanar_orientation(const Point& p, const Point& q,const Point& r,
|
||||||
return _tds.mirror_index(v,i);
|
return _tds.mirror_index(v,i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Edge mirror_edge(const Edge e) const
|
||||||
|
{
|
||||||
|
return _tds.mirror_edge(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------TEMPLATE MEMBERS--------------------------------------*/
|
/*---------------------------------------------------------------------TEMPLATE MEMBERS--------------------------------------*/
|
||||||
|
|
@ -561,15 +566,15 @@ locate_edge(const Point& p, Locate_type& lt, int& li, bool plane)const
|
||||||
f=eit->first;
|
f=eit->first;
|
||||||
Vertex_handle v1 = f->vertex(0);
|
Vertex_handle v1 = f->vertex(0);
|
||||||
Vertex_handle v2 = f -> vertex(1);
|
Vertex_handle v2 = f -> vertex(1);
|
||||||
if(!f->is_ghost())
|
//if(!f->is_ghost())
|
||||||
if(orientation(v1->point(), v2->point(), p)==RIGHT_TURN){
|
if(orientation(v1->point(), v2->point(), p)==RIGHT_TURN){
|
||||||
lt=EDGE;
|
lt=EDGE;
|
||||||
li=2;
|
li=2;
|
||||||
test_distance( p, (*eit).first, lt, li);
|
test_distance( p, (*eit).first, lt, li);
|
||||||
return (*eit).first;
|
return (*eit).first;
|
||||||
}
|
}
|
||||||
if(f->is_ghost())
|
//if(f->is_ghost())
|
||||||
loc = f;
|
//loc = f;
|
||||||
}//end for
|
}//end for
|
||||||
|
|
||||||
test_distance(p, loc, lt, li);
|
test_distance(p, loc, lt, li);
|
||||||
|
|
@ -591,8 +596,7 @@ switch (dimension()){
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
case 1:{
|
case 1:{
|
||||||
show_face(f);
|
Vertex_handle v0 = f->vertex(0);
|
||||||
Vertex_handle v0 = f->vertex(0);
|
|
||||||
Vertex_handle v1= f->neighbor(0)->vertex(0);
|
Vertex_handle v1= f->neighbor(0)->vertex(0);
|
||||||
if (is_too_close(v0->point(),p)||is_too_close(v1->point(),p) )
|
if (is_too_close(v0->point(),p)||is_too_close(v1->point(),p) )
|
||||||
lt = TOO_CLOSE;
|
lt = TOO_CLOSE;
|
||||||
|
|
|
||||||
|
|
@ -88,17 +88,6 @@ bool are_equal(RTOS triA, RTOS triB){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -131,14 +120,9 @@ int main(int argc, char* argv[])
|
||||||
points.resize(5);
|
points.resize(5);
|
||||||
|
|
||||||
Vertex_handle v1 = rtos.insert(p1);
|
Vertex_handle v1 = rtos.insert(p1);
|
||||||
rtos.is_valid();
|
Vertex_handle v4 = rtos.insert(p4);
|
||||||
Vertex_handle v4 = rtos.insert(p4);
|
|
||||||
rtos.is_valid();
|
|
||||||
Vertex_handle v2 = rtos.insert(p2);
|
Vertex_handle v2 = rtos.insert(p2);
|
||||||
rtos.show_all();
|
Vertex_handle v5 = rtos.insert(p5);
|
||||||
|
|
||||||
Vertex_handle v5 = rtos.insert(p5);
|
|
||||||
rtos.show_all();
|
|
||||||
Vertex_handle v3 = rtos.insert(p3);
|
Vertex_handle v3 = rtos.insert(p3);
|
||||||
rtos.is_valid();
|
rtos.is_valid();
|
||||||
|
|
||||||
|
|
@ -156,7 +140,7 @@ std::random_shuffle(points.begin(), points.end());
|
||||||
std::cout<<points.at(i)<<std::endl;
|
std::cout<<points.at(i)<<std::endl;
|
||||||
rtos2.insert(points.at(i));
|
rtos2.insert(points.at(i));
|
||||||
}
|
}
|
||||||
|
rtos2.is_valid();
|
||||||
are_equal(rtos, rtos2);
|
are_equal(rtos, rtos2);
|
||||||
//rtos.remove(v1);
|
//rtos.remove(v1);
|
||||||
//rtos.remove(v2);
|
//rtos.remove(v2);
|
||||||
|
|
@ -188,19 +172,23 @@ std::random_shuffle(points.begin(), points.end());
|
||||||
|
|
||||||
Point_3 p27 = Point_3(radius, 0 ,0);
|
Point_3 p27 = Point_3(radius, 0 ,0);
|
||||||
points2.push_back(p27);
|
points2.push_back(p27);
|
||||||
Vertex_handle v0 = rtos.insert(p0);
|
|
||||||
|
// Vertex_handle v0 = rtos.insert(p0);
|
||||||
|
|
||||||
|
|
||||||
Vertex_handle v21 = rtos.insert(p21);
|
Vertex_handle v21 = rtos.insert(p21);
|
||||||
Vertex_handle v22 = rtos.insert(p22);
|
Vertex_handle v22 = rtos.insert(p22);
|
||||||
Vertex_handle v23 = rtos.insert(p23);
|
Vertex_handle v23 = rtos.insert(p23);
|
||||||
rtos.show_vertex(v23);
|
rtos.show_all();
|
||||||
|
Vertex_handle v26 = rtos.insert(p26);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Vertex_handle v24 = rtos.insert(p24);
|
Vertex_handle v24 = rtos.insert(p24);
|
||||||
Vertex_handle v25 = rtos.insert(p25);
|
Vertex_handle v25 = rtos.insert(p25);
|
||||||
Vertex_handle v26 = rtos.insert(p26);
|
rtos.is_valid();
|
||||||
|
//Vertex_handle v = rtos.insert(p26);
|
||||||
|
Vertex_handle v0 = rtos.insert(p0);
|
||||||
//Vertex_handle v27 = rtos.insert(p27);
|
//Vertex_handle v27 = rtos.insert(p27);
|
||||||
rtos.is_valid();
|
rtos.is_valid();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,18 +33,6 @@ typedef RTOS::Edge Edge;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool is_ok(K::Point_3 p, std::vector<K::Point_3> po, double minDist2, int ind)
|
|
||||||
{
|
|
||||||
bool ok= true;
|
|
||||||
for(int j= 0; j<ind; j++){
|
|
||||||
|
|
||||||
if( squared_distance(p, po.at(j))<=minDist2 ){
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool has_face(Face_handle fh, Vertex_handle v0, Vertex_handle v1, Vertex_handle v2){
|
bool has_face(Face_handle fh, Vertex_handle v0, Vertex_handle v1, Vertex_handle v2){
|
||||||
|
|
@ -52,8 +40,6 @@ bool has_face(Face_handle fh, Vertex_handle v0, Vertex_handle v1, Vertex_handle
|
||||||
|
|
||||||
|
|
||||||
for(int i=0;i<=2; i++){
|
for(int i=0;i<=2; i++){
|
||||||
std::cout<<v0->point()<<std::endl;
|
|
||||||
std::cout<<fh->vertex(i)->point()<<std::endl;
|
|
||||||
test1 = (v0->point()==fh->vertex(i)->point());
|
test1 = (v0->point()==fh->vertex(i)->point());
|
||||||
if(test1)
|
if(test1)
|
||||||
break;
|
break;
|
||||||
|
|
@ -104,7 +90,7 @@ bool are_equal(RTOS triA, RTOS triB){
|
||||||
int main(){
|
int main(){
|
||||||
int nu_of_pts;
|
int nu_of_pts;
|
||||||
double radius;
|
double radius;
|
||||||
nu_of_pts =100000;
|
nu_of_pts =10000;
|
||||||
radius=6000000;
|
radius=6000000;
|
||||||
//radius = 1;
|
//radius = 1;
|
||||||
//double minDist = radius*2e-25;
|
//double minDist = radius*2e-25;
|
||||||
|
|
@ -165,18 +151,15 @@ int main(){
|
||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
//====insert new points============
|
//====insert new points============
|
||||||
|
rtos.insert(points.begin(),points.end());
|
||||||
|
|
||||||
|
|
||||||
for (int count=0; count<nu_of_pts; count++) {
|
t.stop();
|
||||||
//std::cout<< "================= point number "<< count+1 <<" =================="<<std::endl;
|
std::cout<<"running time"<< t.time()<<std::endl;
|
||||||
K::Point_3 p = points.at(count);
|
|
||||||
Vertex_handle v = rtos.insert(p);
|
|
||||||
vertices.push_back(v);
|
|
||||||
|
|
||||||
}
|
|
||||||
//rtos.is_valid();
|
|
||||||
|
|
||||||
|
rtos.is_valid();
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
//*****second triangulation*******
|
//*****second triangulation*******
|
||||||
std::random_shuffle(points.begin(), points.end());
|
std::random_shuffle(points.begin(), points.end());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue