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

📄 snc_list.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 3 页
字号:
  typedef CircFromIt<SHalfedge_iterator,           move_shalfedge_around_facet<SHalfedge_iterator> >           SHalfedge_around_facet_circulator;  class Halffacet_cycle_iterator : public Object_iterator   { typedef Object_iterator Ibase;  public:    Halffacet_cycle_iterator() : Ibase() {}    Halffacet_cycle_iterator(const Ibase& b) : Ibase(b) {}    Halffacet_cycle_iterator(const Halffacet_cycle_iterator& i)       : Ibase(i) {}      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 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     { CGAL_assertion_msg(0,"not impl."); }  };  class Halffacet_cycle_const_iterator : public Object_const_iterator   { typedef Object_const_iterator Ibase;  public:    Halffacet_cycle_const_iterator() : Ibase() {}    Halffacet_cycle_const_iterator(const Ibase& b) : Ibase(b) {}    Halffacet_cycle_const_iterator(const Halffacet_cycle_const_iterator& i)       : Ibase(i) {}      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 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*(); }    Object_handle& operator*() const { return Ibase::operator*(); }    Object_handle  operator->() const     { CGAL_assertion_msg(0,"not impl."); }  };  class Shell_entry_iterator : public Object_iterator   { typedef Object_iterator Ibase;   public:    Shell_entry_iterator() : Ibase() {}    Shell_entry_iterator(const Ibase& b) : Ibase(b) {}    Shell_entry_iterator(const Shell_entry_iterator& i) : Ibase(i) {}      operator SFace_handle() const     { SFace_handle f;       CGAL_assertion( CGAL::assign(f,Ibase::operator*()) );      CGAL::assign(f,Ibase::operator*()); return f; }    operator Object_handle() const { return Ibase::operator*(); }    Object_handle& operator*() const { return Ibase::operator*(); }    Object_handle  operator->() const     { CGAL_nef_assertion_msg(0,"not impl."); }  };  class Shell_entry_const_iterator : public Object_const_iterator   { typedef Object_const_iterator Ibase;   public:    Shell_entry_const_iterator() : Ibase() {}    Shell_entry_const_iterator(const Ibase& b) : Ibase(b) {}    Shell_entry_const_iterator(const Shell_entry_const_iterator& i) :      Ibase(i) {}      operator SFace_const_handle() const     { SFace_handle f;       CGAL_assertion( CGAL::assign(f,Ibase::operator*()) );      CGAL::assign(f,Ibase::operator*());       return SFace_const_handle(f); }    operator Object_handle() const { return Ibase::operator*(); }    Object_handle& operator*() const { return Ibase::operator*(); }    Object_handle  operator->() const     { CGAL_nef_assertion_msg(0,"not impl."); }  }; private:  Vertex_alloc vertex_allocator;  Vertex* get_vertex_node( const Vertex& t) {    Vertex* p = vertex_allocator.allocate(1);    vertex_allocator.construct( p, Vertex());    return p;  }  void put_vertex_node( Vertex* p) {    vertex_allocator.destroy(p);    vertex_allocator.deallocate( p, 1);  }  Halffacet_alloc halffacet_allocator;  Halffacet* get_halffacet_node( const Halffacet& t) {    Halffacet* p = halffacet_allocator.allocate(1);    halffacet_allocator.construct( p, Halffacet());    return p;  }  void put_halffacet_node( Halffacet* p) {    halffacet_allocator.destroy(p);    halffacet_allocator.deallocate( p, 1);  }  Volume_alloc volume_allocator;  Volume* get_volume_node( const Volume& t) {    Volume* p = volume_allocator.allocate(1);    volume_allocator.construct( p, Volume());    return p;  }  void put_volume_node( Volume* p) {    volume_allocator.destroy(p);    volume_allocator.deallocate( p, 1);  } public:  SNC_list() :     boundary_item_(undef_),    vertices_(), halffacets_(), volumes_() {}  ~SNC_list() { clear(); }  SNC_list(const Self& D) :     boundary_item_(undef_),    vertices_(D.vertices_),     halffacets_(D.halffacets_),    volumes_(D.volumes_) {     pointer_update(D);   }  Self& operator=(const Self& D) {    if ( this == &D )      return *this;    clear();    boundary_item_.clear(undef_);    vertices_ = D.vertices_;    halffacets_ = D.halffacets_;    volumes_ = D.volumes_;    pointer_update(D);    return *this;  }  void clear() {     Base::clear();    boundary_item_.clear();    vertices_.destroy();    halffacets_.destroy();    volumes_.destroy();  }  Vertex_const_iterator vertices_begin() const      {return vertices_.begin();}  Vertex_const_iterator vertices_end() const        {return vertices_.end();}  Halfedge_const_iterator halfedges_begin() const   {return svertices_.begin();}  Halfedge_const_iterator halfedges_end() const     {return svertices_.end();}  Halffacet_const_iterator halffacets_begin() const {return halffacets_.begin();}  Halffacet_const_iterator halffacets_end() const   {return halffacets_.end();}  Volume_const_iterator   volumes_begin() const     {return volumes_.begin();}  Volume_const_iterator   volumes_end() const       {return volumes_.end();}  Vertex_iterator    vertices_begin()   { return vertices_.begin();}  Vertex_iterator    vertices_end()     { return vertices_.end();}  Halfedge_iterator  halfedges_begin()  { return halfedges_.begin();}  Halfedge_iterator  halfedges_end()    { return halfedges_.end();}  Halffacet_iterator halffacets_begin() { return halffacets_.begin();}  Halffacet_iterator halffacets_end()   { return halffacets_.end();}  Volume_iterator    volumes_begin()    { return volumes_.begin();}  Volume_iterator    volumes_end()      { return volumes_.end();}  Size_type number_of_vertices() const   { return vertices_.size(); }  Size_type number_of_halfedges() const  { return svertices_.size(); }  Size_type number_of_edges() const      { return svertices_.size()/2; }  Size_type number_of_halffacets() const { return halffacets_.size();}  Size_type number_of_facets() const     { return halffacets_.size()/2;}  Size_type number_of_volumes() const    { return volumes_.size();}  template <typename H>  bool is_boundary_object(H h)   { return boundary_item_[h]!=undef_; }  template <typename H>  Object_iterator& boundary_item(H h)  { return boundary_item_[h]; }  template <typename H>  void store_boundary_item(H h, Object_iterator o)  { boundary_item_[h] = o; }  template <typename H>  void undef_boundary_item(H h)  { CGAL_assertion(boundary_item_[h]!=undef_);    boundary_item_[h] = undef_; }  void reset_iterator_hash(Object_iterator it)  { SVertex_handle sv;    SHalfedge_handle se;    SHalfloop_handle sl;    if ( CGAL::assign(se,*it) ) {       if( is_boundary_object(se)) 	undef_boundary_item(se);       return;     }    if ( CGAL::assign(sl,*it) ) {       if( is_boundary_object(sl)) 	undef_boundary_item(sl);      return;     }    if ( CGAL::assign(sv,*it) ) {       if( is_boundary_object(sv)) 	undef_boundary_item(sv);       return;     }  }  void reset_object_list(Object_list& L)  { Object_iterator oit;    CGAL_forall_iterators(oit,L) reset_iterator_hash(oit);    L.clear();  }  Vertex_handle new_vertex(const Point_3& p = Point_3(), Mark m = Mark()) {     Vertex_handle vh = new_vertex_only();    vh->point() = p;    vh->mark() = m;    vh->sncp() = this;    vh->svertices_begin() = vh->svertices_last() = svertices_end();    vh->shalfedges_begin() = vh->shalfedges_last() = shalfedges_end();    vh->sfaces_begin() = vh->sfaces_last() = sfaces_end();    vh->shalfloop() = shalfloops_end();    return vh;  }  Halfedge_handle new_halfedge_pair(Vertex_handle v1, Vertex_handle v2,				    Mark m = Mark()) {     SM_decorator D1(&*v1);    SM_decorator D2(&*v2);    SVertex_handle e1 = D1.new_vertex();    SVertex_handle e2 = D2.new_vertex();    make_twins(e1,e2);    e1->mark() = m;    return e1;  }  Halffacet_handle new_halffacet_pair(const Plane_3& h = Plane_3(), 				      Mark m = Mark()) {    Halffacet_handle f1 = new_halffacet_only();    Halffacet_handle f2 = new_halffacet_only();    f1->supporting_plane_ = h; f2->supporting_plane_ = h.opposite();    make_twins(f1,f2);    f1->mark() = f2->mark() = m;

⌨️ 快捷键说明

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