Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

FinalMeshItemsT.hh

00001 //=============================================================================
00002 //                                                                            
00003 //                               OpenMesh                                     
00004 //        Copyright (C) 2003 by Computer Graphics Group, RWTH Aachen          
00005 //                           www.openmesh.org                                 
00006 //                                                                            
00007 //-----------------------------------------------------------------------------
00008 //                                                                            
00009 //                                License                                     
00010 //                                                                            
00011 //   This library is free software; you can redistribute it and/or modify it 
00012 //   under the terms of the GNU Library General Public License as published  
00013 //   by the Free Software Foundation, version 2.                             
00014 //                                                                             
00015 //   This library is distributed in the hope that it will be useful, but       
00016 //   WITHOUT ANY WARRANTY; without even the implied warranty of                
00017 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         
00018 //   Library General Public License for more details.                          
00019 //                                                                            
00020 //   You should have received a copy of the GNU Library General Public         
00021 //   License along with this library; if not, write to the Free Software       
00022 //   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 
00023 //                                                                            
00024 //-----------------------------------------------------------------------------
00025 //                                                                            
00026 //   $Revision: 1.12 $
00027 //   $Date: 2004/01/08 15:50:42 $
00028 //                                                                            
00029 //=============================================================================
00030 
00031 #ifndef OPENMESH_MESH_ITEMS_HH
00032 #define OPENMESH_MESH_ITEMS_HH
00033 
00034 
00035 //== INCLUDES =================================================================
00036 
00037 
00038 #include <OpenMesh/Core/System/config.h>
00039 #include <OpenMesh/Core/Utils/GenProg.hh>
00040 #include <OpenMesh/Core/Utils/vector_traits.hh>
00041 #include <OpenMesh/Core/Mesh/Kernels/Common/Handles.hh>
00042 
00043 
00044 //== NAMESPACES ===============================================================
00045 
00046 
00047 namespace OpenMesh {
00048 
00049 
00050 //== CLASS DEFINITION =========================================================
00051 
00053 template 
00054 <
00055   class InternalItems, 
00056   class Traits,
00057   bool  IsTriMesh
00058 >
00059 struct FinalMeshItemsT
00060 {
00061 
00062   //--- build Refs structure ---
00063 #ifndef DOXY_IGNORE_THIS
00064   struct Refs
00065   {
00066     typedef typename Traits::Point            Point;
00067     typedef typename vector_traits<Point>::value_type Scalar;
00068 
00069     typedef typename Traits::Normal           Normal;
00070     typedef typename Traits::Color            Color;
00071     typedef typename Traits::TexCoord         TexCoord;
00072 
00073     typedef OpenMesh::VertexHandle    VertexHandle;
00074     typedef OpenMesh::HalfedgeHandle  HalfedgeHandle;
00075     typedef OpenMesh::EdgeHandle      EdgeHandle;
00076     typedef OpenMesh::FaceHandle      FaceHandle;
00077   };
00078 #endif
00079 
00080 
00081 
00082   //--- export Refs types ---
00083 
00084   typedef typename Refs::Point           Point;
00085   typedef typename Refs::Scalar          Scalar;
00086   typedef typename Refs::Normal          Normal;
00087   typedef typename Refs::Color           Color;
00088   typedef typename Refs::TexCoord        TexCoord;
00089 
00090 
00091 
00092   //--- get attribute bits from Traits ---
00093 
00094   enum Attribs
00095   { 
00096     VAttribs = Traits::VertexAttributes,
00097     HAttribs = Traits::HalfedgeAttributes,
00098     EAttribs = Traits::EdgeAttributes,
00099     FAttribs = Traits::FaceAttributes 
00100   };
00101          
00102   
00103   
00104   //--- merge internal items with traits items ---
00105 
00106   typedef typename InternalItems::Vertex                     InternalVertex;
00107   typedef typename Traits::template VertexT<InternalVertex, Refs>  Vertex;
00108 
00109 
00110   typedef typename GenProg::IF<
00111     (bool)(HAttribs & Attributes::PrevHalfedge),
00112     typename InternalItems::Halfedge_with_prev,
00113     typename InternalItems::Halfedge_without_prev
00114   >::Result   InternalHalfedge;
00115   typedef typename Traits::template HalfedgeT<InternalHalfedge, Refs>
00116     Halfedge;
00117 
00118 
00119   typedef typename InternalItems::template Edge<Halfedge>      InternalEdge;
00120   typedef typename Traits::template EdgeT<InternalEdge, Refs>  Edge;
00121 
00122 
00123   typedef typename InternalItems::template Face<IsTriMesh>     InternalFace;
00124   typedef typename Traits::template FaceT<InternalFace, Refs>  Face;
00125 };
00126 
00127 
00128 //=============================================================================
00129 } // namespace OpenMesh
00130 //=============================================================================
00131 #endif // OPENMESH_MESH_ITEMS_HH defined
00132 //=============================================================================
00133 

acg pic Project OpenMesh, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .