sm_const_decorator.h
来自「CGAL is a collaborative effort of severa」· C头文件 代码 · 共 482 行 · 第 1/2 页
H
482 行
// 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.//// $Source: /CVSROOT/CGAL/Packages/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h,v $// $Revision: 1.12.2.2 $ $Date: 2004/12/08 20:10:06 $// $Name: $//// 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_CONST_DECORATOR_H #define CGAL_SM_CONST_DECORATOR_H#include <CGAL/basic.h>#include <CGAL/circulator.h>#include <CGAL/Unique_hash_map.h>#include <CGAL/Nef_2/Object_index.h>#include <CGAL/Nef_S2/SM_iteration.h>#include <CGAL/Nef_S2/SM_decorator_traits.h>#include <string>#include <list>#include <sstream>#undef CGAL_NEF_DEBUG#define CGAL_NEF_DEBUG 67#include <CGAL/Nef_2/debug.h>CGAL_BEGIN_NAMESPACEtemplate <typename Map_>class SM_const_decorator { typedef SM_const_decorator<Map_> Self;public: typedef Map_ Map; typedef const Map_ Sphere_map; typedef SM_decorator_const_traits<Map> Decorator_traits;/*{\Mdefinition ...}*//*{\Mtypes 5}*/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.}*/typedef void* GenPtr;// typedef typename Map::Constructor_const_parameter Constructor_parameter;typedef typename Map::SVertex_const_handle SVertex_const_handle;typedef typename Map::SVertex_const_iterator SVertex_const_iterator;typedef typename Map::SHalfedge_const_handle SHalfedge_const_handle; typedef typename Map::SHalfedge_const_iterator SHalfedge_const_iterator;typedef typename Map::SHalfloop_const_handle SHalfloop_const_handle;typedef typename Map::SHalfloop_const_iterator SHalfloop_const_iterator;typedef typename Map::SFace_const_handle SFace_const_handle;typedef typename Map::SFace_const_iterator SFace_const_iterator;/*{\Mtext Local types are handles, iterators and circulators of thefollowing kind: |SVertex_handle|, |SVertex_iterator|, |SHalfedge_handle|,|SHalfedge_iterator|, |SHalfloop_handle|, |SHalfloop_iterator|,|SFace_handle|, |SFace_iterator|. Additionally the followingcirculators are defined.}*/typedef typename Map::SHalfedge_around_svertex_const_circulator SHalfedge_around_svertex_const_circulator;/*{\Mtypemember circulating the adjacency list of an vertex |v|.}*/typedef typename Map::SHalfedge_around_sface_const_circulator SHalfedge_around_sface_const_circulator;/*{\Mtypemember circulating the face cycle of an face |f|.}*/typedef typename Map::SFace_cycle_const_iterator SFace_cycle_const_iterator;/*{\Mtypemember iterating all sface cycles of an sface |f|.The iterator has method |bool is_svertex()|, |bool is_shalfedge()|,|bool is_shalfloop()|, and can be converted to the correspondinghandles |SVertex_const_handle|, |SHalfedge_const_handle|, or |SHalfloop_const_handle|.}*/protected: const Map* psm_; void set_sm(const Map* W) { psm_ = W; }public:/*{\Mcreation 3}*/SM_const_decorator() : psm_(0) {}SM_const_decorator(const Self& D) : psm_(D.psm_) {}Self& operator=(const Self& D) { psm_=D.psm_; return *this; }SM_const_decorator(const Map* M) : psm_(M) {}/*{\Mcreate constructs a plane map decorator exploring |M|.}*//*{\Moperations 4 4}*/const Map* sphere_map() const { return psm_; }SVertex_const_handle source(SHalfedge_const_handle e) const/*{\Mop returns the source of |e|.}*/{ return e->source(); }SVertex_const_handle target(SHalfedge_const_handle e) const/*{\Mop returns the target of |e|.}*/{ return e->twin()->source(); }SHalfedge_const_handle twin(SHalfedge_const_handle e) const/*{\Mop returns the twin of |e|.}*/{ return e->twin(); }SHalfloop_const_handle twin(SHalfloop_const_handle l) const /*{\Mop returns the twin of |l|.}*/{ return l->twin(); }bool is_isolated(SVertex_const_handle v) const/*{\Mop returns |true| when |v| is linked to the interior of a face.}*/{ return (SHalfedge_const_handle(v->out_sedge()) == SHalfedge_const_handle()); }SHalfedge_const_handle first_out_edge(SVertex_const_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_const_handle last_out_edge(SVertex_const_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/*{\Mop returns the edge after |e| in the cyclic ordered adjacency list of |source(e)|.}*/{ return e->sprev()->twin(); }SHalfedge_const_handle cyclic_adj_pred(SHalfedge_const_handle e) const/*{\Mop returns the edge before |e| in the cyclic ordered adjacency list of |source(e)|.}*/{ return e->twin()->snext(); }SHalfedge_const_handle next(SHalfedge_const_handle e) const/*{\Mop returns the next edge in the face cycle containing |e|.}*/{ return e->snext(); }SHalfedge_const_handle previous(SHalfedge_const_handle e) const/*{\Mop returns the previous edge in the face cycle containing |e|.}*/{ return e->sprev(); }SFace_const_handle face(SHalfedge_const_handle e) const/*{\Mop returns the face incident to |e|.}*/{ return e->incident_sface(); }SFace_const_handle face(SHalfloop_const_handle l) const/*{\Mop returns the face incident to |l|.}*/{ return l->incident_sface(); }SFace_const_handle face(SVertex_const_handle v) const/*{\Mop returns the face incident to |v|. \precond |is_isolated(v)|.}*/{ return v->incident_sface(); }/*{\Mtext \headerline{Iteration} \setopdims{3.3cm}{0cm}}*/ SVertex_const_iterator svertices_begin() const{ return psm_->svertices_begin(); }SVertex_const_iterator svertices_end() const{ return psm_->svertices_end(); }SHalfedge_const_iterator shalfedges_begin() const{ return psm_->shalfedges_begin(); }SHalfedge_const_iterator shalfedges_end() const{ return psm_->shalfedges_end(); }SFace_const_iterator sfaces_begin() const{ return psm_->sfaces_begin(); }SFace_const_iterator sfaces_end() const{ return psm_->sfaces_end(); }SHalfloop_const_iterator shalfloops_begin() const{ return psm_->shalfloops_begin(); }SHalfloop_const_iterator shalfloops_end() const{ return psm_->shalfloops_end(); }SHalfloop_const_handle shalfloop() const/*{\Mop returns access to the loop.}*/{ return psm_->shalfloop(); }bool has_shalfloop() const/*{\Mop returns true iff there is a loop.}*/{ return psm_->has_shalfloop(); }SHalfedge_around_svertex_const_circulator out_edges(SVertex_const_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_const_circulator(first_out_edge(v)); }SFace_cycle_const_iterator sface_cycles_begin(SFace_const_handle f) const/*{\Mop returns an iterator for all bounding face cycles of |f|.The iterator is is convertable to |SVertex_const_handle|, |SHalfloop_const_handle|, or |SHalfedge_const_handle|.}*/{ return f->boundary_entry_objects_.begin(); }SFace_cycle_const_iterator sface_cycles_end(SFace_const_handle f) const/*{\Mop returns the past the end iterator of |f|.}*/{ return f->boundary_entry_objects_.end(); }/*{\Mtext \headerline{Statistics and Integrity}}*/Size_type number_of_svertices() const /*{\Mop returns the number of vertices.}*/{ return psm_->number_of_svertices(); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?