\hypertarget{a08672}{}\section{Open\+Mesh\+:\+:Mesh\+Cast$<$ Lhs\+MeshT, Rhs\+MeshT $>$ Struct Template Reference}
\label{a08672}\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 $<$Open\+Flipper/libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Core/\+Mesh/\+Final\+Mesh\+Items\+T.\+hh$>$}



\subsection{Detailed Description}
\subsubsection*{template$<$typename Lhs\+MeshT, typename Rhs\+MeshT$>$\newline
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{a06210_ac0f75aab1c554cfcdf72a61c09d1ab36}{mesh\+\_\+cast()}.

Example\+: 
\begin{DoxyCode}
\textcolor{keyword}{struct }TriTraits1 : \textcolor{keyword}{public} \hyperlink{a08800}{OpenMesh::DefaultTraits} \{
  \textcolor{keyword}{typedef} \hyperlink{a06210_aca56e7eac7bf182bfff4ea1841d2cea2}{Vec3d} Point;
\};
\textcolor{keyword}{struct }TriTraits2 : \textcolor{keyword}{public} \hyperlink{a08800}{OpenMesh::DefaultTraits} \{
  \textcolor{keyword}{typedef} \hyperlink{a06210_aca56e7eac7bf182bfff4ea1841d2cea2}{Vec3d} Point;
\};
\textcolor{keyword}{struct }TriTraits3 : \textcolor{keyword}{public} \hyperlink{a08800}{OpenMesh::DefaultTraits} \{
  \textcolor{keyword}{typedef} \hyperlink{a08448}{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{a06210_ac0f75aab1c554cfcdf72a61c09d1ab36}{mesh\+\_\+cast()}
\end{DoxySeeAlso}

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

\end{DoxyReturn}


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



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