OpenMesh

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FinalMeshItemsT.hh
1 /*===========================================================================*\
2 * *
3 * OpenMesh *
4 * Copyright (C) 2001-2012 by Computer Graphics Group, RWTH Aachen *
5 * www.openmesh.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenMesh. *
9 * *
10 * OpenMesh is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenMesh is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenMesh. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34
35 /*===========================================================================*\
36 * *
37 * $Revision: 736 $ *
38 * $Date: 2012-10-08 09:30:49 +0200 (Mo, 08 Okt 2012) $ *
39 * *
40 \*===========================================================================*/
41
42 #ifndef OPENMESH_MESH_ITEMS_HH
43 #define OPENMESH_MESH_ITEMS_HH
44
45
46 //== INCLUDES =================================================================
47
48
49 #include <OpenMesh/Core/System/config.h>
50 #include <OpenMesh/Core/Utils/GenProg.hh>
51 #include <OpenMesh/Core/Utils/vector_traits.hh>
52 #include <OpenMesh/Core/Mesh/Handles.hh>
53
54
55 //== NAMESPACES ===============================================================
56
57
58 namespace OpenMesh {
59
60
61 //== CLASS DEFINITION =========================================================
62
64 template <class Traits, bool IsTriMesh>
65 struct FinalMeshItemsT
66 {
67 //--- build Refs structure ---
68 #ifndef DOXY_IGNORE_THIS
69 struct Refs
70 {
71 typedef typename Traits::Point Point;
72 typedef typename vector_traits<Point>::value_type Scalar;
73
74 typedef typename Traits::Normal Normal;
75 typedef typename Traits::Color Color;
76 typedef typename Traits::TexCoord1D TexCoord1D;
77 typedef typename Traits::TexCoord2D TexCoord2D;
78 typedef typename Traits::TexCoord3D TexCoord3D;
79 typedef typename Traits::TextureIndex TextureIndex;
80 typedef OpenMesh::VertexHandle VertexHandle;
81 typedef OpenMesh::FaceHandle FaceHandle;
82 typedef OpenMesh::EdgeHandle EdgeHandle;
83 typedef OpenMesh::HalfedgeHandle HalfedgeHandle;
84 };
85 #endif
86 //--- export Refs types ---
87 typedef typename Refs::Point Point;
88 typedef typename Refs::Scalar Scalar;
89 typedef typename Refs::Normal Normal;
90 typedef typename Refs::Color Color;
91 typedef typename Refs::TexCoord1D TexCoord1D;
92 typedef typename Refs::TexCoord2D TexCoord2D;
93 typedef typename Refs::TexCoord3D TexCoord3D;
94 typedef typename Refs::TextureIndex TextureIndex;
95
96 //--- get attribute bits from Traits ---
97 enum Attribs
98 {
99 VAttribs = Traits::VertexAttributes,
100 HAttribs = Traits::HalfedgeAttributes,
101 EAttribs = Traits::EdgeAttributes,
102 FAttribs = Traits::FaceAttributes
103 };
104 //--- merge internal items with traits items ---
105
106
107 /*
108 typedef typename GenProg::IF<
109 (bool)(HAttribs & Attributes::PrevHalfedge),
110 typename InternalItems::Halfedge_with_prev,
111 typename InternalItems::Halfedge_without_prev
112 >::Result InternalHalfedge;
113 */
114 //typedef typename InternalItems::Vertex InternalVertex;
115 //typedef typename InternalItems::template Edge<Halfedge> InternalEdge;
116 //typedef typename InternalItems::template Face<IsTriMesh> InternalFace;
117 class ITraits
118 {};
119
120 typedef typename Traits::template VertexT<ITraits, Refs> VertexData;
121 typedef typename Traits::template HalfedgeT<ITraits, Refs> HalfedgeData;
122 typedef typename Traits::template EdgeT<ITraits, Refs> EdgeData;
123 typedef typename Traits::template FaceT<ITraits, Refs> FaceData;
124 };
125
126
127 //=============================================================================
128 } // namespace OpenMesh
129 //=============================================================================
130 #endif // OPENMESH_MESH_ITEMS_HH defined
131 //=============================================================================
132