/******************************************************************************* * 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 * * * *******************************************************************************/ #ifndef __SUBDIVISION_H__ #define __SUBDIVISION_H__ #include #include #include "Algo/Geometry/centroid.h" namespace CGoGN { namespace Algo { namespace Surface { namespace Modelisation { /** * Triangule a face with central vertex * @param d dart of face * @return a dart of the central vertex */ template Dart trianguleFace(typename PFP::MAP& map, Dart d); /** * Triangule all the faces of the mesh */ template void trianguleFaces(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected = allDarts) ; template void trianguleFaces(typename PFP::MAP& map, VertexAttribute& position, const FunctorSelect& selected = allDarts) ; /** * Triangule all the faces of the mesh * positions for new vertices are given as face attribute */ template void trianguleFaces( typename PFP::MAP& map, VertexAttribute& position, const FaceAttribute& positionF, const FunctorSelect& selected = allDarts) ; /** * Quadrangule a face with central vertex * warning: edges are considered here as already cut !! * A face with 2n edges give n quads * @param d dart of face with belong to a vertex introduce when cutting the edge * @return a dart of central point */ template Dart quadranguleFace(typename PFP::MAP& map, Dart d); /** * Quadrangule all the faces of the mesh */ template void quadranguleFaces(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected = allDarts) ; template void quadranguleFaces(typename PFP::MAP& map, VertexAttribute& position, const FunctorSelect& selected = allDarts) ; /** * Catmull-Clark subdivision scheme */ template void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected = allDarts) ; template void CatmullClarkSubdivision(typename PFP::MAP& map, VertexAttribute& position, const FunctorSelect& selected = allDarts) ; /** * Loop subdivision scheme */ template void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected = allDarts) ; template void LoopSubdivision(typename PFP::MAP& map, VertexAttribute& position, const FunctorSelect& selected = allDarts) ; template void TwoNPlusOneSubdivision(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected = allDarts) ; /** * Doo-Sabin subdivision scheme */ template void DooSabin(typename PFP::MAP& map, VertexAttribute& position); ///** // * Reverse the orientation of the map // * NOW IN THE MAP // */ //template //void Sqrt3Subdivision(typename PFP::MAP& map, typename PFP::TVEC3& position, const FunctorSelect& selected = allDarts) ; ///** // * Sqrt(3) subdivision scheme // */ //template //void Sqrt3Subdivision(typename PFP::MAP& map, typename PFP::TVEC3& position, const FunctorSelect& selected = allDarts) ; template void computeDual(typename PFP::MAP& map, VertexAttribute& position); template void computeBoundaryConstraintDual(typename PFP::MAP& map, VertexAttribute& position); template void computeBoundaryConstraintKeepingOldVerticesDual(typename PFP::MAP& map, VertexAttribute& position); } // namespace Modelisation } // namespace Surface } // namespace Algo } // namespace CGoGN #include "Algo/Modelisation/subdivision.hpp" #endif