\hypertarget{a00806}{\section{Open\+Mesh\+:\+:Mesh\+Cast$<$ Lhs\+Mesh\+T, Rhs\+Mesh\+T $>$ Struct Template Reference}
\label{a00806}\index{Open\+Mesh\+::\+Mesh\+Cast$<$ Lhs\+Mesh\+T, Rhs\+Mesh\+T $>$@{Open\+Mesh\+::\+Mesh\+Cast$<$ Lhs\+Mesh\+T, Rhs\+Mesh\+T $>$}}
}


Cast a mesh with different but identical traits into each other.  




{\ttfamily \#include $<$libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Core/\+Mesh/\+Final\+Mesh\+Items\+T.\+hh$>$}



\subsection{Detailed Description}
\subsubsection*{template$<$typename Lhs\+Mesh\+T, typename Rhs\+Mesh\+T$>$struct Open\+Mesh\+::\+Mesh\+Cast$<$ Lhs\+Mesh\+T, Rhs\+Mesh\+T $>$}

Cast a mesh with different but identical traits into each other. 

Note that there exists a syntactically more convenient global method \hyperlink{a03368_ac0f75aab1c554cfcdf72a61c09d1ab36}{mesh\+\_\+cast()}.

Example\+: 
\begin{DoxyCode}
\textcolor{keyword}{struct }TriTraits1 : \textcolor{keyword}{public} \hyperlink{a00492}{OpenMesh::DefaultTraits} \{
  \textcolor{keyword}{typedef} \hyperlink{a03368_aca56e7eac7bf182bfff4ea1841d2cea2}{Vec3d} Point;
\};
\textcolor{keyword}{struct }TriTraits2 : \textcolor{keyword}{public} \hyperlink{a00492}{OpenMesh::DefaultTraits} \{
  \textcolor{keyword}{typedef} \hyperlink{a03368_aca56e7eac7bf182bfff4ea1841d2cea2}{Vec3d} Point;
\};
\textcolor{keyword}{struct }TriTraits3 : \textcolor{keyword}{public} \hyperlink{a00492}{OpenMesh::DefaultTraits} \{
  \textcolor{keyword}{typedef} \hyperlink{a01411}{Vec3f} Point;
\};

TriMesh\_ArrayKernelT<TriTraits1> a;
TriMesh\_ArrayKernelT<TriTraits2> &b = MeshCast<TriMesh\_ArrayKernelT<TriTraits2>&, 
      TriMesh\_ArrayKernelT<TriTraits1>&>::cast(a); \textcolor{comment}{// OK}
TriMesh\_ArrayKernelT<TriTraits3> &c = MeshCast<TriMesh\_ArrayKernelT<TriTraits3>&, 
      TriMesh\_ArrayKernelT<TriTraits1>&>::cast(a); \textcolor{comment}{// ERROR}
\end{DoxyCode}


\begin{DoxySeeAlso}{See also}
\hyperlink{a03368_ac0f75aab1c554cfcdf72a61c09d1ab36}{mesh\+\_\+cast()}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em rhs} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}


Definition at line 183 of file Final\+Mesh\+Items\+T.\+hh.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Core/\+Mesh/Final\+Mesh\+Items\+T.\+hh\end{DoxyCompactItemize}
