OpenMesh
|
00001 /*===========================================================================*\ 00002 * * 00003 * OpenMesh * 00004 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen * 00005 * www.openmesh.org * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * This file is part of OpenMesh. * 00009 * * 00010 * OpenMesh is free software: you can redistribute it and/or modify * 00011 * it under the terms of the GNU Lesser General Public License as * 00012 * published by the Free Software Foundation, either version 3 of * 00013 * the License, or (at your option) any later version with the * 00014 * following exceptions: * 00015 * * 00016 * If other files instantiate templates or use macros * 00017 * or inline functions from this file, or you compile this file and * 00018 * link it with other files to produce an executable, this file does * 00019 * not by itself cause the resulting executable to be covered by the * 00020 * GNU Lesser General Public License. This exception does not however * 00021 * invalidate any other reasons why the executable file might be * 00022 * covered by the GNU Lesser General Public License. * 00023 * * 00024 * OpenMesh is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU Lesser General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU LesserGeneral Public * 00030 * License along with OpenMesh. If not, * 00031 * see <http://www.gnu.org/licenses/>. * 00032 * * 00033 \*===========================================================================*/ 00034 00035 /*===========================================================================*\ 00036 * * 00037 * $Revision: 362 $ * 00038 * $Date: 2011-01-26 10:21:12 +0100 (Mi, 26 Jan 2011) $ * 00039 * * 00040 \*===========================================================================*/ 00041 00042 #ifndef OPENMESH_MESH_ITEMS_HH 00043 #define OPENMESH_MESH_ITEMS_HH 00044 00045 00046 //== INCLUDES ================================================================= 00047 00048 00049 #include <OpenMesh/Core/System/config.h> 00050 #include <OpenMesh/Core/Utils/GenProg.hh> 00051 #include <OpenMesh/Core/Utils/vector_traits.hh> 00052 #include <OpenMesh/Core/Mesh/Handles.hh> 00053 00054 00055 //== NAMESPACES =============================================================== 00056 00057 00058 namespace OpenMesh { 00059 00060 00061 //== CLASS DEFINITION ========================================================= 00062 00064 template <class Traits, bool IsTriMesh> 00065 struct FinalMeshItemsT 00066 { 00067 //--- build Refs structure --- 00068 #ifndef DOXY_IGNORE_THIS 00069 struct Refs 00070 { 00071 typedef typename Traits::Point Point; 00072 typedef typename vector_traits<Point>::value_type Scalar; 00073 00074 typedef typename Traits::Normal Normal; 00075 typedef typename Traits::Color Color; 00076 typedef typename Traits::TexCoord1D TexCoord1D; 00077 typedef typename Traits::TexCoord2D TexCoord2D; 00078 typedef typename Traits::TexCoord3D TexCoord3D; 00079 typedef typename Traits::TextureIndex TextureIndex; 00080 typedef OpenMesh::VertexHandle VertexHandle; 00081 typedef OpenMesh::FaceHandle FaceHandle; 00082 typedef OpenMesh::EdgeHandle EdgeHandle; 00083 typedef OpenMesh::HalfedgeHandle HalfedgeHandle; 00084 }; 00085 #endif 00086 //--- export Refs types --- 00087 typedef typename Refs::Point Point; 00088 typedef typename Refs::Scalar Scalar; 00089 typedef typename Refs::Normal Normal; 00090 typedef typename Refs::Color Color; 00091 typedef typename Refs::TexCoord1D TexCoord1D; 00092 typedef typename Refs::TexCoord2D TexCoord2D; 00093 typedef typename Refs::TexCoord3D TexCoord3D; 00094 typedef typename Refs::TextureIndex TextureIndex; 00095 00096 //--- get attribute bits from Traits --- 00097 enum Attribs 00098 { 00099 VAttribs = Traits::VertexAttributes, 00100 HAttribs = Traits::HalfedgeAttributes, 00101 EAttribs = Traits::EdgeAttributes, 00102 FAttribs = Traits::FaceAttributes 00103 }; 00104 //--- merge internal items with traits items --- 00105 00106 00107 /* 00108 typedef typename GenProg::IF< 00109 (bool)(HAttribs & Attributes::PrevHalfedge), 00110 typename InternalItems::Halfedge_with_prev, 00111 typename InternalItems::Halfedge_without_prev 00112 >::Result InternalHalfedge; 00113 */ 00114 //typedef typename InternalItems::Vertex InternalVertex; 00115 //typedef typename InternalItems::template Edge<Halfedge> InternalEdge; 00116 //typedef typename InternalItems::template Face<IsTriMesh> InternalFace; 00117 class ITraits 00118 {}; 00119 00120 typedef typename Traits::template VertexT<ITraits, Refs> VertexData; 00121 typedef typename Traits::template HalfedgeT<ITraits, Refs> HalfedgeData; 00122 typedef typename Traits::template EdgeT<ITraits, Refs> EdgeData; 00123 typedef typename Traits::template FaceT<ITraits, Refs> FaceData; 00124 }; 00125 00126 00127 //============================================================================= 00128 } // namespace OpenMesh 00129 //============================================================================= 00130 #endif // OPENMESH_MESH_ITEMS_HH defined 00131 //============================================================================= 00132