⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snc_sphere_map.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 2 页
字号:
    operator SHalfedge_handle() const     { SHalfedge_handle e; CGAL::assign(e,Ibase::operator*()); return e; }    operator SHalfloop_handle() const     { SHalfloop_handle l; CGAL::assign(l,Ibase::operator*()); return l; }    operator Object_handle() const { return Ibase::operator*(); }    Object_handle& operator*() const { return Ibase::operator*(); }    Object_handle  operator->() const     { this->CGAL_nef_assertion_msg(0,"not impl."); return Object_handle(); }  };  class SFace_cycle_const_iterator : public Object_const_iterator   /*{\Mtypemember a generic iterator to an object in the boundary  of a facet. Convertible to |Object_handle|.}*/  { typedef Object_const_iterator Ibase;  public:    SFace_cycle_const_iterator() : Ibase() {}    SFace_cycle_const_iterator(const Ibase& b) : Ibase(b) {}    SFace_cycle_const_iterator(const SFace_cycle_const_iterator& i)       : Ibase(i) {}      bool is_svertex() const     { SVertex_handle v; return CGAL::assign(v,Ibase::operator*()); }    bool is_shalfedge() const    { SHalfedge_handle e; return CGAL::assign(e,Ibase::operator*()); }    bool is_shalfloop() const    { SHalfloop_handle l; return CGAL::assign(l,Ibase::operator*()); }    operator SVertex_const_handle() const     { SVertex_handle v; CGAL::assign(v,Ibase::operator*());       return SVertex_const_handle(v); }    operator SHalfedge_const_handle() const     { SHalfedge_handle e; CGAL::assign(e,Ibase::operator*());       return SHalfedge_const_handle(e); }    operator SHalfloop_const_handle() const     { SHalfloop_handle l; CGAL::assign(l,Ibase::operator*());       return SHalfloop_const_handle(l); }    operator Object_handle() const { return Ibase::operator*(); }    const Object_handle& operator*() const { return Ibase::operator*(); }    Object_handle  operator->() const     { this->CGAL_nef_assertion_msg(0,"not impl."); return Object_handle(); }  };  SFace_cycle_const_iterator sface_cycles_begin(SFace_const_handle f) const  { return f->sface_cycles_begin(); }  SFace_cycle_const_iterator sface_cycles_end(SFace_const_handle f) const  { return f->sface_cycles_end(); }  SFace_cycle_iterator sface_cycles_begin(SFace_handle f) const  { return f->sface_cycles_begin(); }  SFace_cycle_iterator sface_cycles_end(SFace_handle f) const  { return f->sface_cycles_end(); }    typedef CircFromIt<        SHalfedge_const_iterator,         move_shalfedge_around_svertex<SHalfedge_const_iterator> >         SHalfedge_around_svertex_const_circulator;  typedef CircFromIt<        SHalfedge_const_iterator,         move_shalfedge_around_sface<SHalfedge_const_iterator> >         SHalfedge_around_sface_const_circulator;  typedef CircFromIt<        SHalfedge_iterator,         move_shalfedge_around_svertex<SHalfedge_iterator> >         SHalfedge_around_svertex_circulator;  typedef CircFromIt<        SHalfedge_iterator,         move_shalfedge_around_sface<SHalfedge_iterator> >         SHalfedge_around_sface_circulator;  bool empty() const {    return this->number_of_svertices() == 0 &&      this->number_of_shalfedges() == 0 &&      this->number_of_shalfloops() == 0 &&      this->number_of_sfaces() == 0;  }  /*  bool has_shalfloop() const {    return shalfloop_ != 0;  }  SHalfloop_handle shalfloop() const {     return shalfloop_;   }  */  template <typename H>  void make_twins(H h1, H h2) {     h1->twin() = h2;     h2->twin() = h1;   }    SVertex_handle new_svertex(const Sphere_point& p, 			   Mark m = Mark()) {       SVertex_iterator sv;    if (this->svertices_begin() == this->sncp()->svertices_end()) {      sv = this->sncp()->new_halfedge_only();      init_range(sv);    }    else {      SVertex_iterator svn = this->svertices_end();      sv =  this->sncp()->new_halfedge_only(svn);      this->svertices_last() = sv;    }    sv->point() = p;     sv->mark() = m;    sv->center_vertex() = Vertex_handle((SNC_in_place_list_sm<Self>*) this);    CGAL_NEF_TRACEN("new_svertex "<<&*sv);    return sv;  }  /*  SFace_handle new_sface() {    SFace_iterator sf =  this->sncp()->new_sface_only();    if ( this->sfaces_begin() == this->sncp()->sfaces_end()) init_range(sf);    else this->sfaces_last() = sf;    sf->center_vertex() = Vertex_handle((SNC_in_place_list_sm<Self>*) this);    return sf;   }  */  SFace_handle new_sface() {    SFace_iterator sf;    if ( this->sfaces_begin() == this->sncp()->sfaces_end()) {      sf =  this->sncp()->new_sface_only();      init_range(sf);    } else {      SFace_iterator sfn = this->sfaces_end();      sf =  this->sncp()->new_sface_only(sfn);      this->sfaces_last() = sf;    }    sf->center_vertex() = Vertex_handle((SNC_in_place_list_sm<Self>*) this);    return sf;   }  /*  SHalfedge_handle new_shalfedge_pair() {    SHalfedge_iterator se = this->sncp()->new_shalfedge_only();    SHalfedge_iterator set = this->sncp()->new_shalfedge_only();    if(this->shalfedges_begin() == this->sncp()->shalfedges_end())       init_range(se);    this->shalfedges_last() = set;    make_twins(se,set);    return se;   }  */  SHalfedge_handle new_shalfedge_pair() {    SHalfedge_iterator se, set;    if(this->shalfedges_begin() == this->sncp()->shalfedges_end()) {      se = this->sncp()->new_shalfedge_only();      set = this->sncp()->new_shalfedge_only();      init_range(se);    } else {      SHalfedge_iterator sen = this->shalfedges_end();      se = this->sncp()->new_shalfedge_only(sen);      set = this->sncp()->new_shalfedge_only(sen);    }    this->shalfedges_last() = set;    make_twins(se,set);    return se;   }  SHalfloop_handle new_shalfloop_pair() {    //    CGAL_assertion( !cv->has_shalfloop() );    CGAL_assertion( !this->has_shalfloop() );    SHalfloop_iterator sl =  this->sncp()->new_shalfloop_only();    SHalfloop_iterator slt = this->sncp()->new_shalfloop_only();    make_twins(sl,slt);    //    cv->shalfloop() = sl;    this->shalfloop() = sl;    return sl;   }  void delete_svertex(SVertex_handle v) {    if (this->svertices_begin() == this->svertices_last() )       { CGAL_assertion(v == this->svertices_begin());       init_range(this->sncp()->svertices_end()); }    else if (this->svertices_begin() == v ) ++(this->svertices_begin());    else if (this->svertices_last() == v ) --(this->svertices_last());    this->sncp()->delete_halfedge_only(v);  }  void delete_shalfedge(SHalfedge_handle e) {    if ( this->shalfedges_begin() == this->shalfedges_last() )       { CGAL_assertion( e == this->shalfedges_begin() );       init_range(this->sncp()->shalfedges_end()); }    else if (this->shalfedges_begin() == e ) ++(this->shalfedges_begin());    else if (this->shalfedges_last() == e ) --(this->shalfedges_last());    this->sncp()->delete_shalfedge_only(e);  }  void delete_shalfedge_pair(SHalfedge_handle e) {     delete_shalfedge(e->twin());     delete_shalfedge(e);   }  void delete_sface(SFace_handle f) {    if (this->sfaces_begin() == this->sfaces_last() )       { CGAL_assertion( f == this->sfaces_begin() );       init_range(this->sncp()->sfaces_end()); }    else if (this->sfaces_begin() == f ) ++(this->sfaces_begin());    else if (this->sfaces_last() == f )  --(this->sfaces_last());    this->sncp()->delete_sface_only(f);   }  void delete_shalfloop_pair() {    CGAL_assertion(this->has_shalfloop() );    this->sncp()->delete_shalfloop_only(this->shalfloop()->twin());      this->sncp()->delete_shalfloop_only(this->shalfloop());      this->shalfloop() = this->sncp()->shalfloops_end();  } protected:  bool            destruct;};  // SNC_sphere_mapCGAL_END_NAMESPACE#endif //  CGAL_SNC_SPHERE_MAP_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -