44 #ifndef OPENMESH_MESH_ITEMS_HH 45 #define OPENMESH_MESH_ITEMS_HH 52 #include <OpenMesh/Core/Utils/GenProg.hh> 53 #include <OpenMesh/Core/Utils/vector_traits.hh> 54 #include <OpenMesh/Core/Mesh/Handles.hh> 66 template <
class Traits,
bool IsTriMesh>
70 #ifndef DOXY_IGNORE_THIS 73 typedef typename Traits::Point Point;
76 typedef typename Traits::Normal Normal;
89 typedef typename Refs::Point Point;
90 typedef typename Refs::Scalar Scalar;
91 typedef typename Refs::Normal Normal;
122 typedef typename Traits::template VertexT<ITraits, Refs> VertexData;
123 typedef typename Traits::template HalfedgeT<ITraits, Refs> HalfedgeData;
124 typedef typename Traits::template EdgeT<ITraits, Refs> EdgeData;
125 typedef typename Traits::template FaceT<ITraits, Refs> FaceData;
129 #ifndef DOXY_IGNORE_THIS 132 template<
typename Lhs,
typename Rhs>
struct TypeEquality;
133 template<
typename Lhs>
struct TypeEquality<Lhs, Lhs> {};
135 template<
typename LhsTraits,
typename RhsTraits>
struct ItemsEquality {
136 TypeEquality<typename LhsTraits::Point, typename RhsTraits::Point> te1;
137 TypeEquality<typename LhsTraits::Scalar, typename RhsTraits::Scalar> te2;
138 TypeEquality<typename LhsTraits::Normal, typename RhsTraits::Normal> te3;
139 TypeEquality<typename LhsTraits::Color, typename RhsTraits::Color> te4;
140 TypeEquality<typename LhsTraits::TexCoord1D, typename RhsTraits::TexCoord1D> te5;
141 TypeEquality<typename LhsTraits::TexCoord2D, typename RhsTraits::TexCoord2D> te6;
142 TypeEquality<typename LhsTraits::TexCoord3D, typename RhsTraits::TexCoord3D> te7;
143 TypeEquality<typename LhsTraits::TextureIndex, typename RhsTraits::TextureIndex> te8;
178 template<
typename LhsMeshT,
typename RhsMeshT>
struct MeshCast;
180 template<
typename LhsMeshT,
typename RhsMeshT>
182 static LhsMeshT &cast(RhsMeshT &rhs) {
183 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
184 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
185 return reinterpret_cast<LhsMeshT&
>(rhs);
189 template<
typename LhsMeshT,
typename RhsMeshT>
190 struct MeshCast<const LhsMeshT&,
const RhsMeshT&> {
191 static const LhsMeshT &cast(
const RhsMeshT &rhs) {
192 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
193 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
194 return reinterpret_cast<const LhsMeshT&
>(rhs);
198 template<
typename LhsMeshT,
typename RhsMeshT>
200 static LhsMeshT *cast(RhsMeshT *rhs) {
201 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
202 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
203 return reinterpret_cast<LhsMeshT*
>(rhs);
207 template<
typename LhsMeshT,
typename RhsMeshT>
208 struct MeshCast<const LhsMeshT*,
const RhsMeshT*> {
209 static const LhsMeshT *cast(
const RhsMeshT *rhs) {
210 (void)
sizeof(TM::ItemsEquality<typename LhsMeshT::MeshItemsT, typename RhsMeshT::MeshItemsT>);
211 (void)
sizeof(TM::TypeEquality<typename LhsMeshT::ConnectivityT, typename RhsMeshT::ConnectivityT>);
212 return reinterpret_cast<const LhsMeshT*
>(rhs);
220 #endif // OPENMESH_MESH_ITEMS_HH defined Handle for a edge entity.
Handle for a face entity.
Add 3D texture coordinates (vertices, halfedges)
Handle for a halfedge entity.
Add texture index (faces)
Add 2D texture coordinates (vertices, halfedges)
Handle for a vertex entity.
Add colors to mesh item (vertices/faces/edges)
#define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Definition of the mesh entities (items).
#define EdgeAttributes(_i)
Macro for defining the edge attributes. See Specifying your MyMesh.
Cast a mesh with different but identical traits into each other.
Add 1D texture coordinates (vertices, halfedges)
#define HalfedgeAttributes(_i)
Macro for defining the halfedge attributes. See Specifying your MyMesh.
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.