\hypertarget{a08476}{}\section{Open\+Mesh\+:\+:IO\+:\+:\+\_\+\+I\+O\+Manager\+\_\+ Class Reference}
\label{a08476}\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}


{\ttfamily \#include $<$Open\+Flipper/libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Core/\+I\+O/\+I\+O\+Manager.\+hh$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{a08476_a96b93ad4d6635a5fea110071bff19cfc}{read} (const std\+::string \&\+\_\+filename, \hyperlink{a08468}{Base\+Importer} \&\+\_\+bi, \hyperlink{a08480}{Options} \&\+\_\+opt)
\item 
bool \hyperlink{a08476_ae8b7820b71be36aa7097c89bbebff9bc}{read} (std\+::istream \&\+\_\+filename, const std\+::string \&\+\_\+ext, \hyperlink{a08468}{Base\+Importer} \&\+\_\+bi, \hyperlink{a08480}{Options} \&\+\_\+opt)
\item 
bool \hyperlink{a08476_a6493341522e1670c7bca82bdd5c1c89b}{write} (const std\+::string \&\+\_\+filename, \hyperlink{a08460}{Base\+Exporter} \&\+\_\+be, \hyperlink{a08480}{Options} \+\_\+opt=\hyperlink{a08480_a9f4f797b08c045b611eaa6f8d149da21a7e68f74f3e555a90cc6b3ea1b5fb42ac}{Options\+::\+Default}, std\+::streamsize \+\_\+precision=6)
\item 
bool \hyperlink{a08476_a3434323b42dda1dab53d05a720355eca}{write} (std\+::ostream \&\+\_\+filename, const std\+::string \&\+\_\+ext, \hyperlink{a08460}{Base\+Exporter} \&\+\_\+be, \hyperlink{a08480}{Options} \+\_\+opt=\hyperlink{a08480_a9f4f797b08c045b611eaa6f8d149da21a7e68f74f3e555a90cc6b3ea1b5fb42ac}{Options\+::\+Default}, std\+::streamsize \+\_\+precision=6)
\item 
\mbox{\Hypertarget{a08476_afaa73081e25ac4ad3899af398ef9320e}\label{a08476_afaa73081e25ac4ad3899af398ef9320e}} 
bool \hyperlink{a08476_afaa73081e25ac4ad3899af398ef9320e}{can\+\_\+read} (const std\+::string \&\+\_\+format) const
\begin{DoxyCompactList}\small\item\em Returns true if the format is supported by one of the reader modules. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a08476_a0b4a0a77e79b64c4995c1e8130cb66aa}\label{a08476_a0b4a0a77e79b64c4995c1e8130cb66aa}} 
bool \hyperlink{a08476_a0b4a0a77e79b64c4995c1e8130cb66aa}{can\+\_\+write} (const std\+::string \&\+\_\+format) const
\begin{DoxyCompactList}\small\item\em Returns true if the format is supported by one of the writer modules. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a08476_af9d2946c2ac96bc66b2575656615b08d}\label{a08476_af9d2946c2ac96bc66b2575656615b08d}} 
size\+\_\+t {\bfseries binary\+\_\+size} (const std\+::string \&\+\_\+format, \hyperlink{a08460}{Base\+Exporter} \&\+\_\+be, \hyperlink{a08480}{Options} \+\_\+opt=\hyperlink{a08480_a9f4f797b08c045b611eaa6f8d149da21a7e68f74f3e555a90cc6b3ea1b5fb42ac}{Options\+::\+Default})
\item 
const std\+::string \& \hyperlink{a08476_a5a5b7314f7fcd4ac01374c2482e30661}{qt\+\_\+read\+\_\+filters} () const
\item 
const std\+::string \& \hyperlink{a08476_a39f74c9e6c8e32ab44432bc0abc6676f}{qt\+\_\+write\+\_\+filters} () const
\item 
bool \hyperlink{a08476_afc523ce80234260b8d6f7084a5cbcb13}{register\+\_\+module} (\hyperlink{a08484}{Base\+Reader} $\ast$\+\_\+bl)
\item 
bool \hyperlink{a08476_a539db8979ec6980cd3e038bdc6292cdc}{register\+\_\+module} (\hyperlink{a08544}{Base\+Writer} $\ast$\+\_\+bw)
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a08476_a2e89c8f3493bdf30b7cb0aa3e8855f8a}\label{a08476_a2e89c8f3493bdf30b7cb0aa3e8855f8a}} 
\hyperlink{a08476_a2e89c8f3493bdf30b7cb0aa3e8855f8a}{\+\_\+\+I\+O\+Manager\+\_\+} ()
\begin{DoxyCompactList}\small\item\em Constructor has nothing todo for the Manager. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a08476_a671abe11e4c99eecd6c9351d09e14d78}\label{a08476_a671abe11e4c99eecd6c9351d09e14d78}} 
\hyperlink{a08476_a671abe11e4c99eecd6c9351d09e14d78}{$\sim$\+\_\+\+I\+O\+Manager\+\_\+} ()
\begin{DoxyCompactList}\small\item\em Destructor has nothing todo for the Manager. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a08476_ab17983c68189be2ccdf3dcdb166fbaa3}\label{a08476_ab17983c68189be2ccdf3dcdb166fbaa3}} 
void {\bfseries update\+\_\+read\+\_\+filters} ()
\item 
\mbox{\Hypertarget{a08476_a87bb5aeb00fd451310804f8845632adb}\label{a08476_a87bb5aeb00fd451310804f8845632adb}} 
void {\bfseries update\+\_\+write\+\_\+filters} ()
\item 
\mbox{\Hypertarget{a08476_a1176ee0573c10ce53df87f8abec79cbc}\label{a08476_a1176ee0573c10ce53df87f8abec79cbc}} 
const \hyperlink{a08544}{Base\+Writer} $\ast$ {\bfseries find\+\_\+writer} (const std\+::string \&\+\_\+format)
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a08476_a8569c46609c68c0834cc5494c6aebc39}\label{a08476_a8569c46609c68c0834cc5494c6aebc39}} 
std\+::set$<$ \hyperlink{a08484}{Base\+Reader} $\ast$ $>$ {\bfseries reader\+\_\+modules\+\_\+}
\item 
\mbox{\Hypertarget{a08476_a6643ad22c1d89b16f40a3e2ddc7a84d2}\label{a08476_a6643ad22c1d89b16f40a3e2ddc7a84d2}} 
std\+::set$<$ \hyperlink{a08544}{Base\+Writer} $\ast$ $>$ {\bfseries writer\+\_\+modules\+\_\+}
\item 
\mbox{\Hypertarget{a08476_a0a626cc6a7b2bcca4c87e70e39a029f0}\label{a08476_a0a626cc6a7b2bcca4c87e70e39a029f0}} 
std\+::string {\bfseries read\+\_\+filters\+\_\+}
\item 
\mbox{\Hypertarget{a08476_a5d2fec2f338d9f51fdb03e73c50f25cf}\label{a08476_a5d2fec2f338d9f51fdb03e73c50f25cf}} 
std\+::string {\bfseries write\+\_\+filters\+\_\+}
\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
O\+P\+E\+N\+M\+E\+S\+H\+D\+L\+L\+E\+X\+P\+O\+RT \hyperlink{a08476}{\+\_\+\+I\+O\+Manager\+\_\+} \& \hyperlink{a08476_a108ad05477eaa77502639b4ac3ee0d96}{I\+O\+Manager} ()
\end{DoxyCompactItemize}


\subsection{Detailed Description}
This is the real I\+O\+Manager class that is later encapsulated by \hyperlink{a08912}{SingletonT} to enforce its uniqueness. {\itshape I\+O\+Manager} is not meant to be used directly by the programmer -\/ the I\+O\+Manager alias exists for this task.

All reader/writer modules register themselves at this class. For reading or writing data all modules are asked to do the job. If no suitable module is found, an error is returned.

For the sake of reading, the target data structure is hidden behind the \hyperlink{a08468}{Base\+Importer} interface that takes care of adding vertices or faces.

Writing from a source structure is encapsulate similarly behind a \hyperlink{a08460}{Base\+Exporter} interface, providing iterators over vertices/faces to the writer modules.

\begin{DoxySeeAlso}{See also}
\hyperlink{mesh_io}{Read and write meshes from files} 
\end{DoxySeeAlso}


Definition at line 102 of file I\+O\+Manager.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{a08476_a5a5b7314f7fcd4ac01374c2482e30661}\label{a08476_a5a5b7314f7fcd4ac01374c2482e30661}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!qt\+\_\+read\+\_\+filters@{qt\+\_\+read\+\_\+filters}}
\index{qt\+\_\+read\+\_\+filters@{qt\+\_\+read\+\_\+filters}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{qt\+\_\+read\+\_\+filters()}{qt\_read\_filters()}}
{\footnotesize\ttfamily const std\+::string\& Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::qt\+\_\+read\+\_\+filters (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Returns all readable file extension + descriptions in one string. File formats are separated by {\ttfamily ;;}. Convenience function for Qt file dialogs. 

Definition at line 189 of file I\+O\+Manager.\+hh.

\mbox{\Hypertarget{a08476_a39f74c9e6c8e32ab44432bc0abc6676f}\label{a08476_a39f74c9e6c8e32ab44432bc0abc6676f}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!qt\+\_\+write\+\_\+filters@{qt\+\_\+write\+\_\+filters}}
\index{qt\+\_\+write\+\_\+filters@{qt\+\_\+write\+\_\+filters}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{qt\+\_\+write\+\_\+filters()}{qt\_write\_filters()}}
{\footnotesize\ttfamily const std\+::string\& Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::qt\+\_\+write\+\_\+filters (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Returns all writeable file extension + descriptions in one string. File formats are separated by {\ttfamily ;;}. Convenience function for Qt file dialogs. 

Definition at line 196 of file I\+O\+Manager.\+hh.

\mbox{\Hypertarget{a08476_a96b93ad4d6635a5fea110071bff19cfc}\label{a08476_a96b93ad4d6635a5fea110071bff19cfc}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!read@{read}}
\index{read@{read}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{read()}{read()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::read (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{\+\_\+filename,  }\item[{\hyperlink{a08468}{Base\+Importer} \&}]{\+\_\+bi,  }\item[{\hyperlink{a08480}{Options} \&}]{\+\_\+opt }\end{DoxyParamCaption})}

Read a mesh from file \+\_\+filename. The target data structure is specified by the given \hyperlink{a08468}{Base\+Importer}. The {\ttfamily read} method consecutively queries all of its reader modules. True is returned upon success, false if all reader modules failed to interprete \+\_\+filename. 

Definition at line 87 of file I\+O\+Manager.\+cc.

\mbox{\Hypertarget{a08476_ae8b7820b71be36aa7097c89bbebff9bc}\label{a08476_ae8b7820b71be36aa7097c89bbebff9bc}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!read@{read}}
\index{read@{read}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{read()}{read()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::read (\begin{DoxyParamCaption}\item[{std\+::istream \&}]{\+\_\+filename,  }\item[{const std\+::string \&}]{\+\_\+ext,  }\item[{\hyperlink{a08468}{Base\+Importer} \&}]{\+\_\+bi,  }\item[{\hyperlink{a08480}{Options} \&}]{\+\_\+opt }\end{DoxyParamCaption})}

Read a mesh from open std\+::istream \+\_\+is. The target data structure is specified by the given \hyperlink{a08468}{Base\+Importer}. The {\ttfamily sread} method consecutively queries all of its reader modules. True is returned upon success, false if all reader modules failed to use \+\_\+is. 

Definition at line 118 of file I\+O\+Manager.\+cc.

\mbox{\Hypertarget{a08476_afc523ce80234260b8d6f7084a5cbcb13}\label{a08476_afc523ce80234260b8d6f7084a5cbcb13}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!register\+\_\+module@{register\+\_\+module}}
\index{register\+\_\+module@{register\+\_\+module}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{register\+\_\+module()}{register\_module()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::register\+\_\+module (\begin{DoxyParamCaption}\item[{\hyperlink{a08484}{Base\+Reader} $\ast$}]{\+\_\+bl }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Registers a new reader module. A call to this function should be implemented in the constructor of all classes derived from \hyperlink{a08484}{Base\+Reader}. 

Definition at line 217 of file I\+O\+Manager.\+hh.

\mbox{\Hypertarget{a08476_a539db8979ec6980cd3e038bdc6292cdc}\label{a08476_a539db8979ec6980cd3e038bdc6292cdc}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!register\+\_\+module@{register\+\_\+module}}
\index{register\+\_\+module@{register\+\_\+module}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{register\+\_\+module()}{register\_module()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::register\+\_\+module (\begin{DoxyParamCaption}\item[{\hyperlink{a08544}{Base\+Writer} $\ast$}]{\+\_\+bw }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Registers a new writer module. A call to this function should be implemented in the constructor of all classed derived from \hyperlink{a08544}{Base\+Writer}. 

Definition at line 229 of file I\+O\+Manager.\+hh.

\mbox{\Hypertarget{a08476_a6493341522e1670c7bca82bdd5c1c89b}\label{a08476_a6493341522e1670c7bca82bdd5c1c89b}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!write@{write}}
\index{write@{write}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{write()}{write()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::write (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{\+\_\+filename,  }\item[{\hyperlink{a08460}{Base\+Exporter} \&}]{\+\_\+be,  }\item[{\hyperlink{a08480}{Options}}]{\+\_\+opt = {\ttfamily \hyperlink{a08480_a9f4f797b08c045b611eaa6f8d149da21a7e68f74f3e555a90cc6b3ea1b5fb42ac}{Options\+::\+Default}},  }\item[{std\+::streamsize}]{\+\_\+precision = {\ttfamily 6} }\end{DoxyParamCaption})}

Write a mesh to file \+\_\+filename. The source data structure is specified by the given \hyperlink{a08460}{Base\+Exporter}. The {\ttfamily save} method consecutively queries all of its writer modules. True is returned upon success, false if all writer modules failed to write the requested format. \hyperlink{a08480}{Options} is determined by \+\_\+filename\textquotesingle{}s extension. 

Definition at line 143 of file I\+O\+Manager.\+cc.

\mbox{\Hypertarget{a08476_a3434323b42dda1dab53d05a720355eca}\label{a08476_a3434323b42dda1dab53d05a720355eca}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!write@{write}}
\index{write@{write}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{write()}{write()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+\+::write (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{\+\_\+filename,  }\item[{const std\+::string \&}]{\+\_\+ext,  }\item[{\hyperlink{a08460}{Base\+Exporter} \&}]{\+\_\+be,  }\item[{\hyperlink{a08480}{Options}}]{\+\_\+opt = {\ttfamily \hyperlink{a08480_a9f4f797b08c045b611eaa6f8d149da21a7e68f74f3e555a90cc6b3ea1b5fb42ac}{Options\+::\+Default}},  }\item[{std\+::streamsize}]{\+\_\+precision = {\ttfamily 6} }\end{DoxyParamCaption})}

Write a mesh to open std\+::ostream \+\_\+os. The source data structure is specified by the given \hyperlink{a08460}{Base\+Exporter}. The {\ttfamily save} method consecutively queries all of its writer modules. True is returned upon success, false if all writer modules failed to write the requested format. \hyperlink{a08480}{Options} is determined by \+\_\+filename\textquotesingle{}s extension. 

Definition at line 172 of file I\+O\+Manager.\+cc.



\subsection{Friends And Related Function Documentation}
\mbox{\Hypertarget{a08476_a108ad05477eaa77502639b4ac3ee0d96}\label{a08476_a108ad05477eaa77502639b4ac3ee0d96}} 
\index{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}!I\+O\+Manager@{I\+O\+Manager}}
\index{I\+O\+Manager@{I\+O\+Manager}!Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+@{Open\+Mesh\+::\+I\+O\+::\+\_\+\+I\+O\+Manager\+\_\+}}
\subsubsection{\texorpdfstring{I\+O\+Manager}{IOManager}}
{\footnotesize\ttfamily O\+P\+E\+N\+M\+E\+S\+H\+D\+L\+L\+E\+X\+P\+O\+RT \hyperlink{a08476}{\+\_\+\+I\+O\+Manager\+\_\+}\& I\+O\+Manager (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}

Declare the singleton getter function as friend to access the private constructor and destructor 

Definition at line 72 of file I\+O\+Manager.\+cc.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Core/\+I\+O/I\+O\+Manager.\+hh\item 
Open\+Flipper/libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Core/\+I\+O/I\+O\+Manager.\+cc\end{DoxyCompactItemize}
