# TestPlugin

Representative image of the TestPlugin plugin

- Introduction
- Examples
- Project structure
- Intellectual property and rights
- Howto

- doxygen code documentation
- \( \LaTeX \) formulas in this document

## Introduction

This page explains how to customize the empty plugin. Once you have read this page, you can replace it with the documentation of your plugin.
To customize the template, you can:

1. Copy the TestPlugin directory and rename it, for example, MyPlugin
2. Open a command line tool in the MyPlugin directory and use the script utils/changeClassName.sh in Unix and utils\changeClassName.bat in Windows to replace TestPlugin with MyPlugin in all the file names and their content:

   On Unix:
   `utils/changeClassName.bash TestPlugin MyPlugin
   `

   On Windows:
   `utils\changeClassName.bat TestPlugin MyPlugin
   cd examples
   ..\utils\changeClassName.bat TestPlugin MyPlugin
   cd ../doc/
   ..\utils\changeClassName.bat TestPlugin MyPlugin This can take some time !
   `

3. At this point, you may want to add the plugin directory to svn. You can also reload this page, since its content was changed by the last command.
4. Finally, you can generate the (almost empty) code documentation using in the same command line tool:
   `doxygen Doxyfile`

5. To insert the plugin in the SOFA development project, you can:

1. add the following line to your sofa-local.prf
   `DEFINES += SOFA_HAVE_PLUGIN_TestPlugin`
2. add the following line to Sofa.pro
   `contains(DEFINES, SOFA_HAVE_``PLUGIN_``TestPlugin) { usePlugin(TestPlugin) }`
3. if your plugin depends on other plugins, edit file TestPlugin-dependencies.prf . See sofa-dependencies.prf for examples of how dependencies are defined.

## Examples

Currently there is only one example:

- TestPlugin.scn , which does nothing, as shown in the figure.

## Project structure

- the C++ code is in the root directory
- the documentation starts in doc/index.html and it is linked to the code documentation which you can generate using doxygen. The main page of the code documentation is written in file initTestPlugin.h.
- a template of user documentation is found in TestPlugin.tex. Is should be filled in for every component in the plugin, then compiled with your favourite Latex distribution. The filename should match the name of the component.
- the examples are in examples/ . The first one is TestPlugin.scn, and when runSOFA opens it, an html page pops up, with a link to the plugin documentation.

## Intellectual property and rights

Authors | You
Contact | You@your.institute
License | Your can distribute this plugin under the same license as the core of SOFA, or any other license of your choice.
Patents |
APP registration |
Sponsors | Do not forget to thank your sponsors, they love it !

## HowTo

#### Code documentation

can be generated using doxygen. In Unix systems, simply type doxygen Doxyfile in the doc directory.

#### LaTeX formulas

can be directly copy-pasted from .tex to this html document thanks to the mathjax config and script included in the header. Equation numbering and cross-referencing works, as well a newcommand.