TutorialApplication
From SOFAWiki
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.
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"
How to contribute
HTML links
To create the documentation of a tutorial, you just need to create a html file. You can create anchor links to other Sofa scene, or html description
- will display a link called Next. If the user click on it, it will open 1_FullObject.scn in the scene graph, and if a corresponding html file exists, it will update the documentation
<a href="1_FullObject.scn">Next</a>
- will display a link called Next. If the user click on it, it will update the documentation with 1_FullObject.htm description file keeping the old Scene Graph.
<a href="1_FullObject.html">Next</a>
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.



