Commit 0c5fc5c1 authored by Jan Möbius's avatar Jan Möbius

Added a deleteAllObjects function to loadSaveInterface

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5402 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 037a3bbe
......@@ -106,6 +106,11 @@ class LoadSaveInterface {
*/
virtual void deleteObject( int /*_id*/ ){};
/** \brief Delete all Objects
*
*/
virtual void deleteAllObjects(){};
private slots :
/** \brief A file has been opened
......
......@@ -1206,6 +1206,25 @@ void Core::slotDeleteObject( int _id ){
slotObjectUpdated(-1);
}
void Core::slotDeleteAllObjects( ){
// Remember ids
std::vector< int > ids;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
ids.push_back( o_it->id() );
}
// remove the whole subtree below the root
objectRoot_->deleteSubtree();
for ( uint i = 0 ; i < ids.size(); ++i ) {
emit objectDeleted(ids[i]);
}
slotObjectUpdated(-1);
}
// //-----------------------------------------------------------------------------
//
// void Core::slotGetPlugin(QString _name, QObject* & _plugin ){
......
......@@ -270,6 +270,9 @@ signals:
/// Called when a plugin wants to delete an object
void slotDeleteObject( int _id );
/// Called when a plugin wants to delete all objects
void slotDeleteAllObjects( );
/// Get a Pointer to the Plugin with given _name (if it is loaded)
// void slotGetPlugin(QString _name, QObject* & _plugin );
......
......@@ -71,6 +71,7 @@
#include "OpenFlipper/BasePlugin/FileInterface.hh"
#include "OpenFlipper/BasePlugin/RPCInterface.hh"
#include "OpenFlipper/BasePlugin/ScriptInterface.hh"
// #include "OpenFlipper/BasePlugin/SecurityInterface.hh"
#include "OpenFlipper/INIFile/INIFile.hh"
......@@ -429,6 +430,28 @@ void Core::loadPlugin(QString filename, bool silent){
return;
}
// //Check if it is a BasePlugin
// SecurityInterface * securePlugin = qobject_cast< SecurityInterface * >(plugin);
// if ( securePlugin ) {
// emit log(LOGINFO,"Plugin uses security interface. Trying to authenticate against plugin ...");
//
// QMetaObject::invokeMethod(plugin,"authenticate" ) ;
//
// std::cerr << "2" << std::endl;
//
// securePlugin->authenticate();
//
// if ( true )
//
// emit log(LOGINFO,"... ok. Loading plugin ");
// else {
// emit log(LOGERR,"... failed. Plugin access denied.");
// emit log(LOGOUT,"=============================================================================================");
// return;
// }
// }
emit log(LOGOUT,"Plugin Desciption :\t\t " + basePlugin->description());
supported = "BaseInterface ";
......@@ -883,6 +906,10 @@ void Core::loadPlugin(QString filename, bool silent){
connect(plugin , SIGNAL( deleteObject( int ) ) ,
this , SLOT( slotDeleteObject( int ) ),Qt::DirectConnection);
if ( checkSignal(plugin,"deleteAllObjects()" ) )
connect(plugin , SIGNAL( deleteAllObjects() ) ,
this , SLOT( slotDeleteAllObjects() ),Qt::DirectConnection);
if ( checkSlot(plugin,"objectDeleted(int)" ) )
connect(this , SIGNAL( objectDeleted( int ) ) ,
plugin , SLOT( objectDeleted( int ) ),Qt::DirectConnection);
......
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="3" >
<Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper-Free/Plugin-Selection/SelectionPluginT.cc" >
<View0 Encoding="" line="60" Type="Source" />
<DocsAndViews NumberOfDocuments="2" >
<Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/ObjectTypes/MeshObject/MeshObjectT.hh" >
<View0 Encoding="" line="0" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper-Free/OpenMesh/Doc/Concepts/MeshKernel.hh" >
<View0 Encoding="" line="96" Type="Source" />
<Doc1 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/ACG/Scenegraph/PolyLineNodeT.hh" >
<View0 Encoding="" line="116" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper-Free/OpenMesh/Core/Mesh/IteratorsT.hh" >
<View0 Encoding="" line="78" Type="Source" />
</Doc2>
</DocsAndViews>
<pluginList>
<kdevdebugger>
......
......@@ -302,9 +302,9 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
"<li><b>Zoom</b> using <b>left+middle</b> mouse buttons.</li></ul>" );
connect( moveButton_,SIGNAL( clicked() ), this, SLOT( setExamineMode() ) );
/*
connect( this, SIGNAL( actionModeChanged( Viewer::ActionMode ) ),
this, SLOT( slotActionModeChanged(Viewer::ActionMode) ) );
this, SLOT( slotActionModeChanged(Viewer::ActionMode) ) );*/
viewerToolbar_->addWidget( moveButton_ )->setText("Move");
moveButton_->setDown(true);
......
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