Commit 1d5912bd authored by Mike Kremer's avatar Mike Kremer

Adapted FilePlane plugin to match new method to create data objects.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7844 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cacda20f
......@@ -31,43 +31,14 @@ DataType FilePlanePlugin::supportedType() {
return type;
}
int FilePlanePlugin::addEmpty( ){
// new object data struct
PlaneObject * object = new PlaneObject(dynamic_cast < ACG::SceneGraph::SeparatorNode* >( PluginFunctions::getRootNode() ));
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
QString name = get_unique_name(object);
// call the local function to update names
QFileInfo f(name);
object->setName( f.fileName() );
object->update();
object->show();
emit log(LOGINFO,object->getObjectinfo());
emit emptyObjectAdded (object->id() );
return object->id();
}
int FilePlanePlugin::loadObject(QString _filename)
{
int id = addEmpty();
BaseObjectData* obj(0);
if(PluginFunctions::getObject( id, obj))
{
PlaneObject* plane = PluginFunctions::planeObject(obj);
int id = -1;
emit addEmptyObject( DATA_PLANE, id );
PlaneObject* plane = 0;
if(PluginFunctions::getObject( id, plane))
{
if( plane )
{
......@@ -97,11 +68,11 @@ int FilePlanePlugin::loadObject(QString _filename)
plane->planeNode()->setPosition(position, xDirection, yDirection);
obj->setFromFileName(_filename);
plane->setFromFileName(_filename);
}
}
}
emit updatedObject(obj->id() );
emit updatedObject( plane->id() );
}
return id;
......
......@@ -39,6 +39,9 @@ class FilePlanePlugin : public QObject, BaseInterface, FileInterface, LoadSaveIn
void noguiSupported( ) {} ;
void initializePlugin();
// Deprecated!
int addEmpty() { return -1; };
public :
......@@ -47,8 +50,6 @@ class FilePlanePlugin : public QObject, BaseInterface, FileInterface, LoadSaveIn
QString name() { return (QString("FilePlane")); };
QString description( ) { return (QString(tr("Load/Save Planes"))); };
int addEmpty( );
DataType supportedType();
QString getSaveFilters();
......
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