\hypertarget{hydro_m_e_x3_8cpp}{
\section{D:/Basile/Visual\-Cpp\-Projects/hydro\-MEX3/hydro\-MEX3/hydro\-MEX3.cpp File Reference}
\label{hydro_m_e_x3_8cpp}\index{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydroMEX3.cpp@{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydroMEX3.cpp}}
}
{\tt \#include \char`\"{}o\-GL\_\-graphics/graphics\_\-relative.h\char`\"{}}\par
{\tt \#include \char`\"{}o\-GL\_\-graphics/solid\_\-objects.h\char`\"{}}\par
{\tt \#include \char`\"{}math.h\char`\"{}}\par
{\tt \#include \char`\"{}mex.h\char`\"{}}\par
{\tt \#include \char`\"{}string.h\char`\"{}}\par
{\tt \#include \char`\"{}hydro\_\-source/hydro\_\-includes.h\char`\"{}}\par
{\tt \#include \char`\"{}CVODEincludes.h\char`\"{}}\par
{\tt \#include \char`\"{}timing/timing.h\char`\"{}}\par
{\tt \#include \char`\"{}f.h\char`\"{}}\par


Include dependency graph for hydro\-MEX3.cpp:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=388pt]{hydro_m_e_x3_8cpp__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{hydro_m_e_x3_8cpp_2ad91e5a1f9d91b7dd31da78c68bddc2}{MAXFLAGLEN}~100
\item 
\#define \hyperlink{hydro_m_e_x3_8cpp_1daf785e3f68d293c7caa1c756d5cb74}{pi}~3.141592653589793
\item 
\#define \hyperlink{hydro_m_e_x3_8cpp_598a3330b3c21701223ee0ca14316eca}{PI}~3.141592653589793
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{hydro_m_e_x3_8cpp_6a215cbfde54f82a3ce599228fc3fce5}{mex\-Function} (int nlhs, mx\-Array $\ast$plhs\mbox{[}$\,$\mbox{]}, int nrhs, const mx\-Array $\ast$prhs\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Main function (mex function). \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
\begin{Desc}
\item[Author:]\href{mailto:basile.graf@epfl.ch}{\tt basile.graf@epfl.ch}\end{Desc}
This is the main project file. It contains inteface to MATLAB and calls all the other routines. 

Definition in file \hyperlink{hydro_m_e_x3_8cpp-source}{hydro\-MEX3.cpp}.

\subsection{Define Documentation}
\hypertarget{hydro_m_e_x3_8cpp_2ad91e5a1f9d91b7dd31da78c68bddc2}{
\index{hydroMEX3.cpp@{hydro\-MEX3.cpp}!MAXFLAGLEN@{MAXFLAGLEN}}
\index{MAXFLAGLEN@{MAXFLAGLEN}!hydroMEX3.cpp@{hydro\-MEX3.cpp}}
\subsubsection[MAXFLAGLEN]{\setlength{\rightskip}{0pt plus 5cm}\#define MAXFLAGLEN~100}}
\label{hydro_m_e_x3_8cpp_2ad91e5a1f9d91b7dd31da78c68bddc2}




Definition at line 37 of file hydro\-MEX3.cpp.\hypertarget{hydro_m_e_x3_8cpp_598a3330b3c21701223ee0ca14316eca}{
\index{hydroMEX3.cpp@{hydro\-MEX3.cpp}!PI@{PI}}
\index{PI@{PI}!hydroMEX3.cpp@{hydro\-MEX3.cpp}}
\subsubsection[PI]{\setlength{\rightskip}{0pt plus 5cm}\#define PI~3.141592653589793}}
\label{hydro_m_e_x3_8cpp_598a3330b3c21701223ee0ca14316eca}




Definition at line 41 of file hydro\-MEX3.cpp.\hypertarget{hydro_m_e_x3_8cpp_1daf785e3f68d293c7caa1c756d5cb74}{
\index{hydroMEX3.cpp@{hydro\-MEX3.cpp}!pi@{pi}}
\index{pi@{pi}!hydroMEX3.cpp@{hydro\-MEX3.cpp}}
\subsubsection[pi]{\setlength{\rightskip}{0pt plus 5cm}\#define pi~3.141592653589793}}
\label{hydro_m_e_x3_8cpp_1daf785e3f68d293c7caa1c756d5cb74}




Definition at line 40 of file hydro\-MEX3.cpp.

\subsection{Function Documentation}
\hypertarget{hydro_m_e_x3_8cpp_6a215cbfde54f82a3ce599228fc3fce5}{
\index{hydroMEX3.cpp@{hydro\-MEX3.cpp}!mexFunction@{mexFunction}}
\index{mexFunction@{mexFunction}!hydroMEX3.cpp@{hydro\-MEX3.cpp}}
\subsubsection[mexFunction]{\setlength{\rightskip}{0pt plus 5cm}void mex\-Function (int {\em nlhs}, mx\-Array $\ast$ {\em plhs}\mbox{[}$\,$\mbox{]}, int {\em nrhs}, const mx\-Array $\ast$ {\em prhs}\mbox{[}$\,$\mbox{]})}}
\label{hydro_m_e_x3_8cpp_6a215cbfde54f82a3ce599228fc3fce5}


Main function (mex function). 

This is the main function. It receives and returns pointers to the arguments to MATLAB. \par
 General initialisations and closing are done here. The main program loop is also in this function. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nlhs}]Number of left hand side arguments in the MATLAB prompt \item[{\em $\ast$plhs\mbox{[}$\,$\mbox{]}}]Array of pointers to the left hand side arguments from MATLAB prompt \item[{\em nrhs}]Number of right hand side arguments in the MATLAB prompt \item[{\em $\ast$prhs\mbox{[}$\,$\mbox{]}}]Array of pointers to the right hand side arguments from MATLAB prompt\end{description}
\end{Desc}
$<$ IMPORTANT VARIABLES:

$<$ parameters Par; parameters structure (from MATLAB)

$<$ parameters $\ast$P; pointer to Par, will be passed to many functions

$<$ \hyperlink{structjoy__parameters}{joy\_\-parameters} j\-Par; joystick parameters structure (from MATLAB)

$<$ \hyperlink{structjoy__parameters}{joy\_\-parameters} $\ast$j\-P; pointer to j\-Par, will be passed to other functions

$<$ datas dat; model data structure containing all model (physics) informations

$<$ pointer to dat, will be passed to many many functions

$<$ \hyperlink{struct_o_d_e__data}{ODE\_\-data} f\_\-dats; solver data structure, contains pointer to the other structures and some solver relative informations

$<$ \hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$f\_\-dat; pointer to f\_\-dats, will be passed to solver relative functions 

Definition at line 56 of file hydro\-MEX3.cpp.

References Boat\_\-create(), Boat\_\-delete(), ODE\_\-data::d, data\_\-init(), data\_\-update\_\-param(), data\_\-update\_\-state(), delete\_\-state(), draw\_\-graphics(), draw\_\-graphics\_\-init(), draw\_\-graphics\_\-kill(), free\_\-wave\_\-variables(), get\_\-joystick\_\-parameters(), get\_\-Parameters(), get\_\-state(), get\_\-time(), init\-Parameters(), ODE\_\-data::P, pass\_\-joy\_\-parameters(), return\_\-args(), solve\_\-ODE(), solver\_\-free(), solver\_\-init(), ODE\_\-data::state, datas::t, tic(), ODE\_\-data::time\_\-param, toc(), and wave\_\-init().