Commit 009d1488 authored by Jan Möbius's avatar Jan Möbius

Added widget handler ( QtWidgets for Each Node)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9102 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 359ac5d6
......@@ -135,6 +135,9 @@ static int targetCounter_ = 0;
/// Map that holds the object handles
static std::map<int, BaseObject*> objectMap_;
/// Map of scenegraph widget generators
QMap< std::string ,ACG::QtWidgets::SceneGraphWidgetGenerator* > sceneGraphGenerators_;
void setDataRoot( BaseObject* _root ) {
objectRoot_ = _root;
}
......@@ -1011,4 +1014,20 @@ void removeObjectFromMap(int _objectId) {
}
void addSceneGraphGenerator(ACG::QtWidgets::SceneGraphWidgetGenerator* _generator) {
// Check if we already have a generator for this type.
if ( sceneGraphGenerators_.contains( _generator->handles() ) ) {
std::cerr << "PluginFunctions Already handled" << std::endl;
}
// Store the generator
sceneGraphGenerators_[_generator->handles() ] = _generator;
}
QMap< std::string ,ACG::QtWidgets::SceneGraphWidgetGenerator* > getSceneGraphGeneratorList(){
std::cerr << "PluginFunctions::getmap" << std::endl;
return sceneGraphGenerators_;
}
} // End namespace PluginFunctions
\ No newline at end of file
......@@ -64,6 +64,8 @@
#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
#include <OpenFlipper/common/ViewerProperties.hh>
#include <ACG/QtWidgets/QtSceneGraphWidget.hh>
namespace PluginFunctions {
//=======================================
......@@ -142,6 +144,21 @@ void removeObjectFromMap(int _objectId);
/** @} */
//=======================================
// SceneGraph Generator Map
/** @name Internal container for scenegraph widget generators
* @{ */
//=======================================
/// Add a scenegraph generator ( the handled type will be extracted from the generator)
DLLEXPORT
void addSceneGraphGenerator(ACG::QtWidgets::SceneGraphWidgetGenerator* _generator);
DLLEXPORT
QMap< std::string ,ACG::QtWidgets::SceneGraphWidgetGenerator* > getSceneGraphGeneratorList();
/** @} */
}
#endif //PLUGINFUNCTIONSCORE_HH
......@@ -976,6 +976,7 @@ CoreWidget::slotShowSceneGraphDialog()
}
sceneGraphDialog_->setGeneratorMap(PluginFunctions::getSceneGraphGeneratorList() );
sceneGraphDialog_->show();
}
}
......
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