/******************************************************************************* * CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps * * version 0.1 * * Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg * * * * This library is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by the * * Free Software Foundation; either version 2.1 of the License, or (at your * * option) any later version. * * * * This library is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * * Web site: http://cgogn.unistra.fr/ * * Contact information: cgogn@unistra.fr * * * *******************************************************************************/ namespace CGoGN { /// INLINE FUNCTIONS template inline void Map2::init() { MAP::addInvolution() ; } template inline Map2::Map2() : Map1() { init() ; } template inline std::string Map2::mapTypeName() const { return "Map2" ; } template inline unsigned int Map2::dimension() const { return 2 ; } template inline void Map2::clear(bool removeAttrib) { ParentMap::clear(removeAttrib) ; if (removeAttrib) init() ; } template inline void Map2::update_topo_shortcuts() { ParentMap::update_topo_shortcuts(); // m_phi2 = getRelation("phi2"); } /*! @name Basic Topological Operators * Access and Modification *************************************************************************/ template inline Dart Map2::phi2(Dart d) const { return MAP::getInvolution<0>(d); } template template inline Dart Map2::phi(Dart d) const { assert( (N > 0) || !"negative parameters not allowed in template multi-phi"); if (N < 10) { switch(N) { case 1 : return ParentMap::phi1(d) ; case 2 : return phi2(d) ; default : assert(!"Wrong multi-phi relation value") ; return d ; } } switch(N%10) { case 1 : return phi1(phi(d)) ; case 2 : return phi2(phi(d)) ; default : assert(!"Wrong multi-phi relation value") ; return d ; } } template inline Dart Map2::alpha0(Dart d) const { return phi2(d) ; } template inline Dart Map2::alpha1(Dart d) const { return phi2(this->phi_1(d)) ; } template inline Dart Map2::alpha_1(Dart d) const { return phi1(phi2(d)) ; } template inline Dart Map2::phi2_1(Dart d) const { return phi2(this->phi_1(d)) ; } template inline Dart Map2::phi12(Dart d) const { return phi1(phi2(d)) ; } template inline void Map2::phi2sew(Dart d, Dart e) { MAP::involutionSew<0>(d,e); } template inline void Map2::phi2unsew(Dart d) { MAP::involutionUnsew<0>(d); } /*! @name Topological Queries * Return or set various topological information *************************************************************************/ template inline bool Map2::sameVertex(Dart d, Dart e) const { return sameOrientedVertex(d, e) ; } template inline bool Map2::sameEdge(Dart d, Dart e) const { return d == e || phi2(d) == e ; } template inline bool Map2::isBoundaryEdge(Dart d) const { return this->isBoundaryMarked2(d) || this->isBoundaryMarked2(phi2(d)); } template inline bool Map2::sameOrientedFace(Dart d, Dart e) const { return ParentMap::sameCycle(d, e) ; } template inline bool Map2::sameFace(Dart d, Dart e) const { return sameOrientedFace(d, e) ; } template inline unsigned int Map2::faceDegree(Dart d) const { return ParentMap::cycleDegree(d) ; } template inline int Map2::checkFaceDegree(Dart d, unsigned int le) const { return ParentMap::checkCycleDegree(d,le) ; } template inline bool Map2::sameVolume(Dart d, Dart e) const { return sameOrientedVolume(d, e) ; } /*! @name Cell Functors * Apply functors to all darts of a cell *************************************************************************/ template inline bool Map2::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread) const { return ParentMap::foreach_dart_of_cc(d, f, thread); } template inline bool Map2::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread) const { return foreach_dart_of_cc(d, f, thread); } template inline bool Map2::foreach_dart_of_vertex1(Dart d, FunctorType& f, unsigned int thread) const { return ParentMap::foreach_dart_of_vertex(d,f,thread); } template inline bool Map2::foreach_dart_of_edge1(Dart d, FunctorType& f, unsigned int thread) const { return ParentMap::foreach_dart_of_edge(d,f,thread); } } // namespace CGoGN