From d5964d15b85d7749499bc3fd13b0bc37a74d9db2 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Sat, 6 May 2006 17:05:18 +0000 Subject: [PATCH] - Added license and history - On invert face also swap the texture coordinates if the mesh has them --- src/meshlabplugins/meshfilter/invert_faces.h | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/meshlabplugins/meshfilter/invert_faces.h b/src/meshlabplugins/meshfilter/invert_faces.h index 4efe556ee..5487c9329 100644 --- a/src/meshlabplugins/meshfilter/invert_faces.h +++ b/src/meshlabplugins/meshfilter/invert_faces.h @@ -1,3 +1,36 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program 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 General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +// History + +/* + * $Log$ + * Revision 1.3 2006/05/06 17:05:18 mariolatronico + * - Added license and history + * - On invert face also swap the texture coordinates if the + * mesh has them + * + */ + #ifndef __VCGLIB_INVERT_FACES #define __VCGLIB_INVERT_FACES @@ -21,6 +54,13 @@ namespace vcg{ { swap((*fi).V1(0), (*fi).V2(0)); + // swap also texture coordinates + if (MESH_TYPE::HasPerWedgeTexture()) { + swap((*fi).WT(0),(*fi).WT(1)); + swap((*fi).WT(1),(*fi).WT(2)); + swap((*fi).WT(2),(*fi).WT(0)); + + } } vcg::tri::UpdateNormals::PerVertexNormalizedPerFace(m); vcg::tri::UpdateTopology::FaceFace(m);