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

📄 iterator_tools.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
字号:
// 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_2/include/CGAL/Nef_2/iterator_tools.h $// $Id: iterator_tools.h 28567 2006-02-16 14:30:13Z lsaboret $// //// Author(s)     : Michael Seel <seel@mpi-sb.mpg.de>#ifndef CGAL_ITERATORTOOLS_H#define CGAL_ITERATORTOOLS_H#include <CGAL/basic.h>#include <CGAL/circulator.h>CGAL_BEGIN_NAMESPACEtemplate <typename Iter, typename Move> class CircFromIt : public Iter {    // Ptr  node;    // The internal node ptr inherited from It.    typedef CircFromIt<Iter,Move> Self;public:    typedef typename Iter::iterator_category Icategory;    typedef I_Circulator_from_iterator_traits<Icategory> CTraits;    typedef typename CTraits::iterator_category iterator_category;    CircFromIt() : Iter(0) {}    CircFromIt(Iter i) : Iter(i) {}// OPERATIONS Forward Category// ---------------------------    bool operator==( CGAL_NULL_TYPE p ) const {      CGAL_assertion( p == NULL );      return Iter::operator==( Iter(NULL) );    }    bool operator!=( CGAL_NULL_TYPE p ) const {      return !(*this == p);    }    bool operator==( const Self& i ) const {      return Iter::operator==(i);    }    bool operator!=( const Self& i) const {        return !(*this == i);    }    Self& operator++() {      Move move;      move.forward(*this);      return *this;    }    Self  operator++(int) {      CircFromIt tmp = *this;      ++*this;      return tmp;    }// OPERATIONS Bidirectional Category// ---------------------------------    Self& operator--() {      Move move;      move.backward(*this);      return *this;    }    Self  operator--(int) {      CircFromIt tmp = *this;      --*this;      return tmp;    }};template <typename Iter, typename Pnt> class PntItFromVertIt : public Iter {public:  typedef PntItFromVertIt<Iter,Pnt> Self;  typedef Iter Base;  typedef Pnt  value_type;  typedef const Pnt* pointer;  typedef const Pnt& reference;  PntItFromVertIt() : Base() {}  PntItFromVertIt(Iter it) : Base(it) {}  PntItFromVertIt(const Self& it) : Base(it) {}  reference operator*() const   { return Base::operator*().point(); }  pointer operator->() const   { return &(operator*()); }  Self& operator++() { return (Self&)Base::operator++(); }  Self operator++(int) { Self tmp=*this; ++*this; return tmp; }};template <class H>std::string PH(H h){ if (h == H()) return "nil"; return h->debug(); }CGAL_END_NAMESPACE#endif // CGAL_ITERATORTOOLS_H

⌨️ 快捷键说明

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