49 #ifndef OPENMESH_MESH_ITEMS_HH 50 #define OPENMESH_MESH_ITEMS_HH 57 #include <OpenMesh/Core/Utils/GenProg.hh> 58 #include <OpenMesh/Core/Utils/vector_traits.hh> 59 #include <OpenMesh/Core/Mesh/Handles.hh> 71 template <
class Traits,
bool IsTriMesh>
75 #ifndef DOXY_IGNORE_THIS 78 typedef typename Traits::Point Point;
94 typedef typename Refs::Point Point;
95 typedef typename Refs::Scalar Scalar;
127 typedef typename Traits::template VertexT<ITraits, Refs> VertexData;
128 typedef typename Traits::template HalfedgeT<ITraits, Refs> HalfedgeData;
129 typedef typename Traits::template EdgeT<ITraits, Refs> EdgeData;
130 typedef typename Traits::template FaceT<ITraits, Refs> FaceData;
134 #ifndef DOXY_IGNORE_THIS 137 template<
typename Lhs,
typename Rhs>
struct TypeEquality;
138 template<
typename Lhs>
struct TypeEquality<Lhs, Lhs> {};
140 template<
typename LhsTraits,
typename RhsTraits>
struct ItemsEquality {
141 TypeEquality<typename LhsTraits::Point, typename RhsTraits::Point> te1;
142 TypeEquality<typename LhsTraits::Scalar, typename RhsTraits::Scalar> te2;
143 TypeEquality<typename LhsTraits::Normal, typename RhsTraits::Normal> te3;
144 TypeEquality<typename LhsTraits::Color, typename RhsTraits::Color> te4;
145 TypeEquality<typename LhsTraits::TexCoord1D, typename RhsTraits::TexCoord1D> te5;
146 TypeEquality<typename LhsTraits::TexCoord2D, typename RhsTraits::TexCoord2D> te6;
147 TypeEquality<typename LhsTraits::TexCoord3D, typename RhsTraits::TexCoord3D> te7;
148 TypeEquality<typename LhsTraits::TextureIndex, typename RhsTraits::TextureIndex> te8;
183 template<
typename LhsMeshT,
typename RhsMeshT>
struct MeshCast;
185 template<
typename LhsMeshT,
typename RhsMeshT>
187 static LhsMeshT &cast(RhsMeshT &rhs) {
188 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
189 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
190 return reinterpret_cast<LhsMeshT&
>(rhs);
194 template<
typename LhsMeshT,
typename RhsMeshT>
195 struct MeshCast<const LhsMeshT&,
const RhsMeshT&> {
196 static const LhsMeshT &cast(
const RhsMeshT &rhs) {
197 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
198 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
199 return reinterpret_cast<const LhsMeshT&
>(rhs);
203 template<
typename LhsMeshT,
typename RhsMeshT>
205 static LhsMeshT *cast(RhsMeshT *rhs) {
206 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
207 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
208 return reinterpret_cast<LhsMeshT*
>(rhs);
212 template<
typename LhsMeshT,
typename RhsMeshT>
213 struct MeshCast<const LhsMeshT*,
const RhsMeshT*> {
214 static const LhsMeshT *cast(
const RhsMeshT *rhs) {
215 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
216 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
217 return reinterpret_cast<const LhsMeshT*
>(rhs);
225 #endif // OPENMESH_MESH_ITEMS_HH defined
Add texture index (faces)
Add normals to mesh item (vertices/faces)
Add 3D texture coordinates (vertices, halfedges)
#define HalfedgeAttributes(_i)
Macro for defining the halfedge attributes. See Specifying your MyMesh.
Handle for a edge entity.
#define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Add 1D texture coordinates (vertices, halfedges)
Handle for a halfedge entity.
Handle for a vertex entity.
Add colors to mesh item (vertices/faces/edges)
Add 2D texture coordinates (vertices, halfedges)
Handle for a face entity.
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.
#define EdgeAttributes(_i)
Macro for defining the edge attributes. See Specifying your MyMesh.
Cast a mesh with different but identical traits into each other.
Definition of the mesh entities (items).