Commit 682ab4be authored by Mike Kremer's avatar Mike Kremer

Updated tutorials

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5335 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1843c5b2
......@@ -37,4 +37,61 @@
* \ref interfaces
*
* \section geometryData Handling geometry data whithin a plugin
*
* \subsection pluginFunctions OpenFlipper's plugin functions
*
* As a plugin in most cases operates on geometry data, developers might want to know how to gain access to mesh data
* from within a plugin. In our tutorial \ref ex2 we roughly mentioned that the communication between OpenFlipper
* and it's plugins is accomplished through either one of the provided \ref interfaces or the \ref PluginFunctions.
*
* For example iterating over all objects that have been marked as source objects is done via
*
* <code>
* for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::SOURCE_OBJECTS);<br />
* o_it != PluginFunctions::objectsEnd(); ++o_it) { ... }
* </code>
*
* Possible restrictions are \c ALL_OBJECTS (to iterate over all objects in the scene), \c TARGET_OBJECTS (objects
* that were marked as target) and \c SOURCE_OBJECTS.
*
* Another way to get handles to scene objects is to use the functions \c PluginFunctions::getObject() or
* PluginFunctions::getPickedObject(). These functions provide a pointer to either a \ref BaseObjectData
* or \ref BaseObject object. As in \ref ex2 one can easily test the type of an object by calling
*
* \c o_it->dataType(DATA_TYPE)
*
* where \c o_it is an object iterator and \c DATA_TYPE is one of the data types specified in \ref OpenFlipper/common/Types.hh.
* \c o_it->dataType(DATA_TRIANGLE_MESH) for example will return true if the object is a triangle mesh.
*
* The mesh data itself can be obtained by calling the appropriate handle plugin function. For example if we consider
* a triangle mesh, we get a handle to the mesh itself by calling
*
* <code>TriMesh* mesh = PluginFunctions::triMesh(*o_it);</code>
*
* where \c o_it once again is our object iterator. See \ref PluginFunctions for a complete overview.
*
* \subsection updatingObjects Updating objects
*
* Once your plugin has manipulated object data we have to inform OpenFlipper's core about the changes.
* When doing this, OpenFlipper distinguishes between two fundamental types of changes:
*
* - Changing geometry
* - Changing object properties
*
* When changing geometry, OpenFlipper's core will be forced to redraw the object that has been
* changed by calling:
*
* \ref BaseInterface::updatedObject(int _idx)
*
* where \c _idx is the object's id.
*
* When changing object properties e.g. changing the marking from source to target object, it
* won't be necessary to redraw the scene since it can be expensive in computation power.
* In this case, one should call the
*
* \ref BaseInterface::objectPropertiesChanged(int _idx)
*
* where \c _idx once again is the object's id.
*
* Also see \ref BaseInterface.
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment