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

📄 sm_decorator.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 3 页
字号:
// Copyright (c) 1997-2002  Max-Planck-Institute Saarbruecken (Germany).// All rights reserved.//// This file is part of CGAL (www.cgal.org); you may redistribute it under// the terms of the Q Public License version 1.0.// See the file LICENSE.QPL distributed with CGAL.//// Licensees holding a valid commercial license may use this file in// accordance with the commercial license agreement provided with the software.//// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.//// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.3-branch/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h $// $Id: SM_decorator.h 29399 2006-03-11 18:34:06Z glisse $// //// Author(s)     : Michael Seel       <seel@mpi-sb.mpg.de>//                 Miguel Granados    <granados@mpi-sb.mpg.de>//                 Susan Hert         <hert@mpi-sb.mpg.de>//                 Lutz Kettner       <kettner@mpi-sb.mpg.de>//                 Peter Hachenberger <hachenberger@mpi-sb.mpg.de>#ifndef CGAL_SM_DECORATOR_H #define CGAL_SM_DECORATOR_H#include <CGAL/basic.h>#include <CGAL/Nef_S2/SM_const_decorator.h>#undef CGAL_NEF_DEBUG#define CGAL_NEF_DEBUG  23#include <CGAL/Nef_2/debug.h>#include <CGAL/Nef_S2/SM_decorator_traits.h>#include <CGAL/Nef_S2/Sphere_map.h>#include <CGAL/Nef_S2/Normalizing.h>#include <CGAL/Unique_hash_map.h>#include <CGAL/IO/Verbose_ostream.h>CGAL_BEGIN_NAMESPACE/*{\Moptions print_title=yes }*/ /*{\Moptions outfile=SM_decorator.man }*//*{\Manpage {SM_decorator}{Sphere_map}{Topological sphere map decorator}{D}}*/template <typename Map_>class SM_decorator{ public:typedef Map_              Map;typedef Map_              Sphere_map;typedef SM_decorator<Map> Self;typedef SM_decorator_traits<Map>  Decorator_traits;/*{\Mdefinition ...}*//*{\Mtypes 5}*/typedef CGAL::SM_const_decorator<Map>   SM_const_decorator;typedef typename Map::Sphere_kernel    Sphere_kernel;/*{\Mtypemember spherical geometry.}*/typedef typename Map::Sphere_point     Sphere_point;/*{\Mtypemember embedding vertices.}*/typedef typename Map::Sphere_segment   Sphere_segment;/*{\Mtypemember embedding edges.}*/typedef typename Map::Sphere_circle    Sphere_circle;/*{\Mtypemember embedding loops.}*/typedef typename Map::Sphere_direction Sphere_direction;/*{\Mtypemember embedding directions.}*/typedef typename Map::Mark   Mark;/*{\Mtypemember attributes of objects (vertices, edges, faces).}*/typedef size_t Size_type;/*{\Mtypemember size type.}*/enum { BEFORE = -1, AFTER = 1 };/*{\Menum insertion order labels.}*/typedef typename Sphere_kernel::Aff_transformation_3 Aff_transformation_3;typedef void*  GenPtr;typedef typename Map::SVertex                   SVertex;typedef typename Map::SVertex_handle            SVertex_handle;typedef typename Map::SVertex_iterator          SVertex_iterator;typedef typename Map::SVertex_const_handle      SVertex_const_handle;typedef typename Map::SVertex_const_iterator    SVertex_const_iterator;typedef typename Map::SHalfedge                 SHalfedge;typedef typename Map::SHalfedge_handle          SHalfedge_handle;typedef typename Map::SHalfedge_iterator        SHalfedge_iterator;typedef typename Map::SHalfedge_const_handle    SHalfedge_const_handle;typedef typename Map::SHalfedge_const_iterator  SHalfedge_const_iterator;typedef typename Map::SFace                     SFace;typedef typename Map::SFace_handle              SFace_handle;typedef typename Map::SFace_iterator            SFace_iterator;typedef typename Map::SFace_const_handle        SFace_const_handle;typedef typename Map::SFace_const_iterator      SFace_const_iterator;typedef typename Map::SHalfloop                 SHalfloop;typedef typename Map::SHalfloop_handle          SHalfloop_handle;typedef typename Map::SHalfloop_iterator        SHalfloop_iterator;typedef typename Map::SHalfloop_const_handle    SHalfloop_const_handle;typedef typename Map::SHalfloop_const_iterator  SHalfloop_const_iterator;typedef typename Map::Object_handle             Object_handle;typedef typename Map::SHalfedge_around_svertex_circulator                      SHalfedge_around_svertex_circulator;typedef typename Map::SHalfedge_around_sface_circulator                      SHalfedge_around_sface_circulator;typedef typename Map::SFace_cycle_iterator      SFace_cycle_iterator;/*{\Mtypemember iterating all face cycles of an face |f|.The iterator has method |bool is_svertex()|, |bool is_shalfedge()|,|bool is_shalfloop()|, and can be converted to the correspondinghandles |SVertex_handle|, |SHalfedge_handle|, or |SHalfloop_handle|.}*/protected:   Map* psm_;public:/*{\Mcreation 3}*/SM_decorator() : psm_(0) {}SM_decorator(const Self& D) : psm_(D.psm_) {}Self& operator=(const Self& D) { psm_=D.psm_; return *this; }SM_decorator(Map* M) : psm_(M) {} /*{\Moperations 4 4}*/Map* sphere_map() const { return psm_; }Map* map() { return psm_; }const Map* map() const { return psm_; }bool is_isolated(SVertex_const_handle v) const{ return (v->out_sedge() == SHalfedge_handle()); }bool is_isolated(SVertex_handle v) const/*{\Mop returns |true| when |v| is linked to the interior of a face.}*/{ return (v->out_sedge() == SHalfedge_handle()); }SHalfedge_const_handle first_out_edge(SVertex_const_handle v) const{ return v->out_sedge(); }SHalfedge_const_handle last_out_edge(SVertex_const_handle v) const{ return cap(v->out_sedge()); }SHalfedge_handle first_out_edge(SVertex_handle v) const/*{\Mop returns one edge with source |v|. It's the starting point for  the circular iteration over the edges with source |v|.  \precond |!is_isolated(v)|.}*/{ return v->out_sedge(); }SHalfedge_handle last_out_edge(SVertex_handle v) const/*{\Mop returns one edge with source |v|. \precond |!is_isolated(v)|.}*/{ return cap(v->out_sedge()); }SHalfedge_const_handle cyclic_adj_succ(SHalfedge_const_handle e) const{ return e->sprev()->twin(); }SHalfedge_const_handle cyclic_adj_pred(SHalfedge_const_handle e) const{ return e->twin()->snext(); }SHalfedge_handle cyclic_adj_succ(SHalfedge_handle e) const/*{\Mop returns the edge after |e| in the cyclic ordered adjacency list of  |e->source()|.}*/{ return e->sprev()->twin(); }SHalfedge_handle cyclic_adj_pred(SHalfedge_handle e) const/*{\Mop returns the edge before |e| in the cyclic ordered adjacency list of  |e->source()|.}*/{ return e->twin()->snext(); }bool has_shalfloop() const/*{\Mop returns true iff there is a loop.}*/{ return psm_->has_shalfloop(); }/*{\Mtext \headerline{Iteration} \setopdims{3.3cm}{0cm}}*/  SVertex_iterator svertices_begin() const{ return psm_->svertices_begin(); }SVertex_iterator svertices_end() const{ return psm_->svertices_end(); }SHalfedge_iterator shalfedges_begin() const{ return psm_->shalfedges_begin(); }SHalfedge_iterator shalfedges_end() const{ return psm_->shalfedges_end(); }SFace_iterator sfaces_begin() const{ return psm_->sfaces_begin(); }SFace_iterator sfaces_end() const{ return psm_->sfaces_end(); }SHalfloop_iterator shalfloops_begin() const{ return psm_->shalfloops_begin(); }SHalfloop_iterator shalfloops_end() const{ return psm_->shalfloops_end(); }SHalfloop_handle& shalfloop(){ return psm_->shalfloop(); }SHalfloop_const_handle shalfloop() const{ return psm_->shalfloop(); }Size_type number_of_svertices() const /*{\Mop returns the number of vertices.}*/{ return psm_->number_of_svertices(); }Size_type number_of_shalfedges() const /*{\Mop returns the number of halfedges.}*/{ return psm_->number_of_shalfedges(); }Size_type number_of_sedges() const /*{\Mop returns the number of edges.}*/{ return number_of_shalfedges()/2; }Size_type number_of_shalfloops() const /*{\Mop returns the number of halfloops.}*/{ return psm_->number_of_shalfloops(); }Size_type number_of_sloops() const /*{\Mop returns the number of loops.}*/{ return psm_->number_of_shalfloops()/2; }Size_type number_of_sfaces() const    /*{\Mop returns the number of faces.}*/{ return psm_->number_of_sfaces(); }SFace_cycle_iterator sface_cycles_begin(SFace_handle f) const/*{\Mop returns an iterator for all bounding face cycles of |f|.The iterator is is convertable to |SVertex_handle|, |SHalfloop_handle|, or |SHalfedge_handle|.}*/{ return f->boundary_entry_objects().begin(); }SFace_cycle_iterator sface_cycles_end(SFace_handle f) const/*{\Mop returns the past the end iterator of |f|.}*/{ return f->boundary_entry_objects_.end(); }SHalfedge_around_svertex_circulator   out_edges(SVertex_handle v) const/*{\Mop returns a circulator for the cyclic adjacency list of |v|.\precond the adjacency list is not empty.}*/{ return SHalfedge_around_svertex_circulator(first_out_edge(v)); }/*{\Mtext \headerline{Update Operations}}*/void clear() const/*{\Mop reintializes |P| to the empty map.}*/{ psm_->clear(); }bool is_closed_at_source(SHalfedge_handle e) const/*{\Mop returns |true| when |e->sprev() == e->twin()|.}*/{ return e->sprev() == e->twin(); }bool is_closed_at_target(SHalfedge_handle e) const/*{\Mop returns |true| when |e->snext() == e->twin()|.}*/{ return e->snext() == e->twin(); }SHalfedge_handle cas(SHalfedge_handle e) const { return cyclic_adj_succ(e); } SHalfedge_handle cap(SHalfedge_handle e) const{ return cyclic_adj_pred(e); }template <typename H>void make_twins(H h1, H h2) const{ h1->twin() = h2; h2->twin() = h1; }SVertex_handle new_svertex(const Sphere_point& p = Sphere_point())/*{\Mop creates a new vertex.}*/{ return map()->new_svertex(p); }SHalfedge_handle new_shalfedge_pair() {/*{\Xop creates a new edge pair. No connectivity is provided.}*/  return map()->new_shalfedge_pair();}SHalfloop_handle new_shalfloop_pair()/*{\Mop creates a new loop pair.\precond No sloop pair exists in the local graph.}*/ { CGAL_assertion(!has_shalfloop());  return map()->new_shalfloop_pair(); }SFace_handle new_sface()/*{\Mop creates a new face.}*/{ return map()->new_sface(); }void delete_vertex_only(SVertex_handle v)/*{\Mop deletes |v| without any connectivity update.}*/{ map()->delete_svertex(v); }void delete_edge_pair_only(SHalfedge_handle e)/*{\Mop deletes |e| and its twin without any connectivity update.}*/{ map()->delete_shalfedge_pair(e); }void delete_halfedge_only(SHalfedge_handle e)/*{\Mop deletes |e| without its twin and without any connectivity update.}*/{ map()->delete_shalfedge(e); }void delete_face_only(SFace_handle f) /*{\Mop deletes |f| without any connectivity update.}*/{ map()->delete_sface(f); }void delete_loop_only()/*{\Mop deletes the loop and its twin without any connectivity update.}*/ { map()->delete_shalfloop_pair(); }template <typename H>bool is_sm_boundary_object(H h) const{ return map()->is_sm_boundary_object(h); }template <typename H>void store_sm_boundary_object(H h, SFace_handle f) {  CGAL_assertion(!map()->is_sm_boundary_object(h));

⌨️ 快捷键说明

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