
\section{How To make your Component modifiable}
When you create your own component, it can be very convenient to display some internal data, or be able to modify its behavior by modifying a few values. It is made possible by the usage of two objects:
\begin{itemize}
 \item sofa::core::objectmodel::Data
 \item sofa::core::objectmodel::DataPtr
\end{itemize}
They are templated with the type you want. It can be ``classic'' types, bool, int, double (...), or more complex ones (your own data structure). You only have to implement the stream operators ``<<'' and ``>>''. In the constructor of your object, you have to call the function initData, or initDataPtr. 
\\
for instance, let's call your class  {\bf foo}. You want to control a parameter of type boolean called {\bf verbose}. You want it to be displayed
\begin{verbatim}
foo(): verbose(initData(&verbose, false, "verbose", "Helpful comments", true, false)){}
\end{verbatim}

initData takes several parameters: 
\begin{enumerate}
 \item address of the Data
 \item default value: it must be of the same type as your template({\bf OPTIONAL})
 \item name of your Data: it will appear in your XML file
 \item description of your Data: it will appear in the GUI
 \item boolean to know whether or not it has to be displayed in the GUI({\bf OPTIONAL}, default value true: always displayed)
 \item boolean to know whether or not your Data will be ONLY readable in the GUI({\bf OPTIONAL}, default value false: always readable and writable)
\end{enumerate}

 Once you have modified your Datas in the GUI, pressing the button ``Update'' will call the virtual method ``void reinit()'' inherited by all the objects. It is up to you to implement it in your component if the change of one field requires some computations or actualization.
You can chose to hide a specified Data from the GUI at any time by using the method setDisplayed(bool).
You can chose to enable or disable the write access of a specified Data from the GUI at any time by using the method setReadOnly(bool).
