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

📄 hds_items.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 2 页
字号:
// Copyright (c) 1997-2000  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_2/include/CGAL/Nef_2/HDS_items.h $// $Id: HDS_items.h 35755 2007-01-18 14:07:04Z fcacciola $// //// Author(s)     : Michael Seel <seel@mpi-sb.mpg.de>#ifndef CGAL_HDS_ITEMS_H#define CGAL_HDS_ITEMS_H#include <CGAL/basic.h>#include <CGAL/tags.h>#include <list>#include <boost/optional.hpp>#include <boost/none.hpp>namespace CGAL {template <typename Refs >struct Halfedge__base {    typedef typename Refs::Halfedge_handle Halfedge_handle;    typedef typename Refs::Halfedge_const_handle Halfedge_const_handle;protected:    Halfedge_handle opp; public:    Halfedge_handle       opposite()                        { return opp; }    Halfedge_const_handle opposite() const                  { return opp; }    void                  set_opposite(Halfedge_handle h)   { opp = h; }};//#ifndef CGAL_USE_LEDA//#define LEDA_MEMORY(t) //#endiftemplate <typename Refs, typename Traits>class Nef_vertex_2 {public:    typedef Refs           HalfedgeDS;    typedef Nef_vertex_2   Base;    typedef CGAL::Tag_true Supports_vertex_halfedge;    typedef CGAL::Tag_true Supports_vertex_point;    typedef typename Refs::Vertex_handle         Vertex_handle;    typedef typename Refs::Vertex_const_handle   Vertex_const_handle;    typedef typename Refs::Halfedge_handle       Halfedge_handle;    typedef typename Refs::Halfedge_const_handle Halfedge_const_handle;    typedef typename Refs::Face_handle           Face_handle;    typedef typename Refs::Face_const_handle     Face_const_handle;    typedef typename Refs::Halfedge              Halfedge;    typedef typename Refs::Face                  Face;    typedef void*                                GenPtr;    typedef typename Traits::Point Point;   // geometric embedding    typedef typename Traits::Mark  Mark;    // information    typedef typename std::list<Vertex_handle>::iterator iv_iterator;private:    Halfedge_handle              _h;    Face_handle                  _f;    Point                        _p;    boost::optional<iv_iterator> _ivit;    Mark                         _m;    GenPtr                       _i;public:    Nef_vertex_2() : _h(),_f(),_ivit(),_m(0),_i((GenPtr)0xABCD) {}    // constructs an uninitialized vertex concerning embedding     // and mark. All links are initialized by their default value.    Nef_vertex_2( const Point& p) :         _h(),_f(),_p(p),_ivit(),_m(0),_i((GenPtr)0xABCD) {}    // constructs a vertex with embedding |p| and mark |m|.    //  All links are initialized by their default value.    bool is_isolated() const  { return _h == Halfedge_handle(); }    // returns true iff |\Mvar| is isolated, else false.              Halfedge_handle halfedge() { return _h; }    /*{\Mop returns an incident halfedge. \precond |!is_isolated()|.}*/    Halfedge_const_handle halfedge() const { return _h; }    void set_halfedge(Halfedge_handle h) { _h=h; }    /*{\Mop makes |h| the entry point into the adjacency cycle of       |\Mvar|.}*/    Face_handle face() { return _f; }    /*{\Mop returns the incident face if |is_isolated()|.}*/    Face_const_handle face() const { return _f; }    void set_face(Face_handle f) { _f=f; }    /*{\Mop makes |f| the incident face of |\Mvar|.}*/    Point& point() { return _p; }    /*{\Mop returns the embedding point of |\Mvar|.}*/    const Point& point() const { return _p; }    Mark& mark() { return _m; }    /*{\Mop returns the mark of |\Mvar|.}*/    const Mark& mark() const { return _m; }    GenPtr& info() { return _i; }    /*{\Mop returns a generic information slot of |\Mvar|.}*/    const GenPtr& info() const { return _i; }    iv_iterator ivit() const { return *_ivit; }    void set_ivit(iv_iterator it) { _ivit = it; }    void reset_ivit() { _ivit = boost::none; }};template <typename Refs, typename Traits>class Nef_halfedge_2 {public:    typedef Refs           HalfedgeDS;    typedef Nef_halfedge_2 Base;    typedef Nef_halfedge_2 Base_base;    typedef CGAL::Tag_true Supports_halfedge_prev;    typedef CGAL::Tag_true Supports_halfedge_vertex;    typedef CGAL::Tag_true Supports_halfedge_face;    typedef typename Refs::Vertex_handle         Vertex_handle;    typedef typename Refs::Vertex_const_handle   Vertex_const_handle;    typedef typename Refs::Halfedge_handle       Halfedge_handle;    typedef typename Refs::Halfedge_const_handle Halfedge_const_handle;    typedef typename Refs::Face_handle           Face_handle;    typedef typename Refs::Face_const_handle     Face_const_handle;    typedef typename Refs::Vertex                Vertex;    typedef typename Refs::Face                  Face;    typedef void*                                GenPtr;    typedef typename std::list<Halfedge_handle>::iterator fc_iterator;    typedef typename Traits::Mark  Mark;  // information protected:    Halfedge_handle              opp, prv, nxt;    Vertex_handle                _v;    Face_handle                  _f;        boost::optional<fc_iterator> _fcit;    Mark                         _m;    GenPtr                       _i;public:           Nef_halfedge_2() :         opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0),_i((GenPtr)0xABCD) {}    /*{\Mcreate constructs an uninitialized halfedge concerning embedding       and mark. All links are initialized by their default value.}*/       Halfedge_handle       opposite()                        { return opp; }    /*{\Mop returns the twin of |\Mvar|.}*/    Halfedge_const_handle opposite() const                  { return opp; }    void                  set_opposite(Halfedge_handle h)   { opp = h; }    /*{\Mop makes |h| the twin of |\Mvar|.}*/    Halfedge_handle       prev()                            { return prv; }    /*{\Mop returns the previous edge of the face cycle of |\Mvar|.}*/    Halfedge_const_handle prev() const                      { return prv; }    void                  set_prev(Halfedge_handle h)       { prv = h; }    /*{\Mop makes |h| the previous edge in the face cycle of |\Mvar|.}*/    Halfedge_handle       next()                            { return nxt; }    /*{\Mop returns the next edge of the face cycle of |\Mvar|.}*/    Halfedge_const_handle next() const                      { return nxt; }    void                  set_next(Halfedge_handle h)       { nxt = h; }    /*{\Mop makes |h| the next edge in the face cycle of |\Mvar|.}*/    Vertex_handle         vertex()                     { return _v; }    /*{\Mop returns the vertex incident to the halfedge |\Mvar|.}*/    Vertex_const_handle   vertex() const               { return _v; }    void                  set_vertex(Vertex_handle v)  { _v = v; }    /*{\Mop makes |v| the vertex incident to |\Mvar|.}*/    Face_handle           face()                       { return _f; }    /*{\Mop returns the face incident to the halfedge |\Mvar|.}*/    Face_const_handle     face() const                 { return _f; }    void                  set_face(Face_handle f)      { _f = f; }    /*{\Mop makes |f| the face incident to |\Mvar|.}*/    bool is_border() const { return _f == Face_handle(); }    Mark& mark() { return _m; }    /*{\Mop returns the mark of |\Mvar|.}*/    const Mark& mark() const { return _m; }    GenPtr&       info()       { return _i; }

⌨️ 快捷键说明

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