Commit 5342108b authored by Jan Möbius's avatar Jan Möbius

New function to set per objects draw mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10112 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d3e2faa4
......@@ -1105,6 +1105,22 @@ ViewControlPlugin::setDrawMode(QString _mode, int _viewer)
//-----------------------------------------------------------------------------
void
ViewControlPlugin::setObjectDrawMode(QString _mode, int _objectID, bool _force)
{
BaseObjectData* object = 0;
PluginFunctions::getObject( _objectID, object );
// Set draw Modes for this object ( force it when we do not set the global draw mode, to override global draw mode and force the modes on the nodes )
ACG::SceneGraph::SetDrawModesAction actionActive( activeDrawModes_ , _force );
if ( object )
ACG::SceneGraph::traverse( object->primaryNode() , actionActive);
else
PluginFunctions::setDrawMode( activeDrawModes_ , PluginFunctions::activeExaminer() );
}
//-----------------------------------------------------------------------------
Vector ViewControlPlugin::viewingDirection( int _viewer ) {
return PluginFunctions::viewingDirection(_viewer);
}
......@@ -1188,7 +1204,12 @@ void ViewControlPlugin::setDescriptions() {
QString("DrawMode,Viewer").split(","),
QString("the drawMode ( ; separated list ),Viewer id (default is all)").split(","));
emit setSlotDescription("setDrawMode(QString)", "Set the drawMode for all viewers",
QStringList("DrawMode"), QStringList("the drawMode ( ; separated list )"));
emit setSlotDescription("setObjectDrawMode(QString,int,bool)", "Set the drawMode for an object",
QString("DrawMode,ObjectID,Force").split(","),
QString("the drawMode ( ; separated list ),Object id,Apply without checking support(default is true)").split(","));
emit setSlotDescription("viewAll()", "Change View on all viewers to view whole scene",
QStringList(), QStringList());
......
......@@ -221,6 +221,16 @@ class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, Logg
/// Set the draw mode for a viewer
void setDrawMode(QString _mode, int _viewer = PluginFunctions::ALL_VIEWERS );
/** \brief Set the draw mode for an object
*
* This function can be used to set the drawmode for an object.
*
* @param _mode DrawMode as String ( can be a list of drawmodes which will be combined to a new mode )
* @param _objectid Id of the object to set the draw mode
* @param _force Set the draw mode even if its not directly supported by the objects nodes
*/
void setObjectDrawMode(QString _mode, int _objectID , bool _force = true );
/// Get a viewers viewing direction
Vector viewingDirection( int _viewer = PluginFunctions::ACTIVE_VIEWER );
......
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