- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# Core/Mesh/Kernels/Common/FinalMeshItemsT.hh

    00001 //=============================================================================
    00002 //
    00003 //                               OpenMesh
    00004 //      Copyright (C) 2001-2005 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.2 $
    00027 //   $Date: 2005-12-21 13:51:57 $
    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.hh>
    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::TexCoord1D       TexCoord1D;
    00072     typedef typename Traits::TexCoord2D       TexCoord2D;
    00073     typedef typename Traits::TexCoord3D       TexCoord3D;
    00074
    00075     typedef OpenMesh::VertexHandle    VertexHandle;
    00076     typedef OpenMesh::HalfedgeHandle  HalfedgeHandle;
    00077     typedef OpenMesh::EdgeHandle      EdgeHandle;
    00078     typedef OpenMesh::FaceHandle      FaceHandle;
    00079   };
    00080 #endif
    00081
    00082
    00083
    00084   //--- export Refs types ---
    00085
    00086   typedef typename Refs::Point           Point;
    00087   typedef typename Refs::Scalar          Scalar;
    00088   typedef typename Refs::Normal          Normal;
    00089   typedef typename Refs::Color           Color;
    00090   typedef typename Refs::TexCoord1D      TexCoord1D;
    00091   typedef typename Refs::TexCoord2D      TexCoord2D;
    00092   typedef typename Refs::TexCoord3D      TexCoord3D;
    00093
    00094
    00095
    00096   //--- get attribute bits from Traits ---
    00097
    00098   enum Attribs
    00099   {
    00100     VAttribs = Traits::VertexAttributes,
    00101     HAttribs = Traits::HalfedgeAttributes,
    00102     EAttribs = Traits::EdgeAttributes,
    00103     FAttribs = Traits::FaceAttributes
    00104   };
    00105
    00106
    00107
    00108   //--- merge internal items with traits items ---
    00109
    00110   typedef typename InternalItems::Vertex                     InternalVertex;
    00111   typedef typename Traits::template VertexT<InternalVertex, Refs>  Vertex;
    00112
    00113
    00114   typedef typename GenProg::IF<
    00115     (bool)(HAttribs & Attributes::PrevHalfedge),
    00116     typename InternalItems::Halfedge_with_prev,
    00117     typename InternalItems::Halfedge_without_prev
    00118   >::Result   InternalHalfedge;
    00119   typedef typename Traits::template HalfedgeT<InternalHalfedge, Refs>
    00120     Halfedge;
    00121
    00122
    00123   typedef typename InternalItems::template Edge<Halfedge>      InternalEdge;
    00124   typedef typename Traits::template EdgeT<InternalEdge, Refs>  Edge;
    00125
    00126
    00127   typedef typename InternalItems::template Face<IsTriMesh>     InternalFace;
    00128   typedef typename Traits::template FaceT<InternalFace, Refs>  Face;
    00129 };
    00130
    00131
    00132 //=============================================================================
    00133 } // namespace OpenMesh
    00134 //=============================================================================
    00135 #endif // OPENMESH_MESH_ITEMS_HH defined
    00136 //=============================================================================
    00137