SEARCH
TOOLBOX
LANGUAGES
TutorialApplication

TutorialApplication

From SOFAWiki

Jump to: navigation, search
Tutorial Application


Contents

Tutorial Application

The Tutorial Application is embedded inside the Sofa Modeler. To launch it, go to the Tutorial Menu, or simply click on its icone.


Image:ModelerTutorial.png


It is composed of three parts, from left to right:

  • a Tutorial Selector: enables to split the tutorials into several categories, and regroup them inside Nodes
  • a HTML based description: gives the instructions and documentation linked with a tutorial
  • a Sofa Scene-Graph: the Sofa representation of the components: you can modify the components, remove ones, add others using the Modeler Library, undo/redo...

How does it work

The Tutorial Selector is initialized using the xml file Sofa/examples/Tutorials.xml. The corresponding description of the tutorial is loaded from the corresponding html file: Sofa/examples/Tutorials.html

We use 3 different nodes:

  • Category: Category of Tutorials: they will appear in the Combo Box of the main window: for instance Step By Step, Topologies, ... Double click on them will open a subset of tutorials
  • Group: to regroup a set of tutorial under the same Node: this node can be folded, and can highly some steps of the Tutorials: for instance Pendulum Creation
  • Tutorial: The Tutorial itself, with the Sofa icon: double click on it, will automatically open the Sofa scene graph and description corresponding: for instance Basic Cube
    • to specify the Sofa scene in the xml use the parameter: scene: for instance scene="Tutorials/StepByStep/Pendulum/0_Pendulum.scn"
    • automatically if will look for a corresponding html file, changing the .scn extension by .html. If you want to use another file for the description of your tutorial use the parameter: html: for instance html="Tutorials/StepByStep/Pendulum/0_Pendulum.html"

Image:TutorialSelector0.png Image:TutorialSelector1.png


How to contribute

Take a look in the folder
SOFA_DIR/examples/Tutorials
to see that all tutorial structure are defined by XML files. In each folder, there are always a XML file defining the its own organization. In the clean way, SOFA tutorial for user often relate to a simulation scene. Creation a tutorial needs
  • XML file (locating the tutorial in its global structure)
  • HTML file (the tutorial contains)
  • SCENE file (the example)
  • Several illustrative images.

HTML links

To create the documentation of a tutorial for a specific component, you need to create a html file and a scene file (if not existed). The scene file should be as simple as possible. Then you need to relate the tutorial itself to the scene by defining in the XML file two attributes "scene" and "html" :

<Tutorial name="My_Component"  scene="Tutorials/ComponentCategory/TutorialMyComponent.scn" html="Tutorials/ComponentCategory/TutorialMyComponent.html"/>

Fill the tutorial contain in html file and debug the scene file if needed ^^.

Improve current Tutorials

The application is created, now it needs additional and better contents: as a base of the application, we put the basic tutorials. We only have the Sofa scenes, but almost NO documentation, and description. To do so, you just have to create the corresponding html file, and it will appear in the application: for instance: the scene examples/Tutorials/Basic/TutorialCollisionCubeObstacle.scn is the first tutorial of the Collision category. Someone needs to create the description file examples/Tutorials/Basic/TutorialCollisionCubeObstacle.html. That's all!

Add new Tutorials

If you want to add brand new Tutorials, you need to edit the xml file corresponding to your category: for instance, if you want to add a new tutorial for the collisions, edit the file examples/Tutorials/Basic/Collision.xml, and add a line with the path to your Tutorial.

Create a new category of Tutorial

The only way to create another category is to add it to the file examples/Tutorials/Tutorials.xml as it is used as base to the construction of the main window. Add a line

  <Category name="MyCategory" xml="Tutorials/MyCategory/MyCategory.xml"/>

and construct the xml file MyCategory.xml to specify the different groups, and tutorial files.