00001 /**************************************************************************** 00002 * VCGLib o o * 00003 * Visual and Computer Graphics Library o o * 00004 * _ O _ * 00005 * Copyright(C) 2006 \/)\/ * 00006 * Visual Computing Lab /\/| * 00007 * ISTI - Italian National Research Council | * 00008 * \ * 00009 * All rights reserved. * 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 * This program is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00019 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * 00020 * for more details. * 00021 * * 00022 ****************************************************************************/ 00023 /**************************************************************************** 00024 History 00025 00026 $Log: not supported by cvs2svn $ 00027 Revision 1.2 2007/05/04 16:16:40 ganovelli 00028 standardized to component style 00029 00030 Revision 1.1 2006/10/13 14:11:49 cignoni 00031 first version 00032 00033 ****************************************************************************/ 00034 00035 #ifndef __VCG_FACE_PLUS_COMPONENT_RT 00036 #define __VCG_FACE_PLUS_COMPONENT_RT 00037 00038 #include <vcg/space/plane3.h> 00039 00040 namespace vcg { 00041 namespace face { 00042 00043 template <class CoordType> 00044 struct EdgePlaneInfo{ 00045 CoordType edge[3]; 00046 ::vcg::Plane3<typename CoordType::ScalarType> plane; 00047 typename CoordType::ScalarType edgescale; 00048 }; 00049 00050 template <class T> class EdgePlane: public T { 00051 public: 00052 typedef EdgePlaneInfo<typename T::VertexType::CoordType> EdgePlaneType; 00053 00054 typename T::VertexType::CoordType &Edge(const int j) { 00055 return _ep.edge[j]; 00056 } 00057 typename T::VertexType::CoordType cEdge(const int j)const { 00058 return _ep.edge[j]; 00059 } 00060 00061 typename vcg::Plane3<typename T::VertexType::CoordType::ScalarType> &Plane() { 00062 return _ep.plane; 00063 } 00064 typename vcg::Plane3<typename T::VertexType::CoordType::ScalarType> cPlane()const { 00065 return _ep.plane; 00066 } 00067 00068 static bool HasEdgePlane() { return true; } 00069 00070 static void Name(std::vector<std::string> & name){name.push_back(std::string("EdgePlane"));T::Name(name);} 00071 00072 private: 00073 00074 EdgePlaneType _ep; 00075 }; 00076 00077 } // end namespace face 00078 }// end namespace vcg 00079 #endif