return( "cpPlugins::Interface::Workspace: No valid workspace" );
std::stringstream err;
- // Read plugins files
- TiXmlElement* plugins = root->FirstChildElement( "plugins" );
- while( plugins != NULL )
- {
- const char* value = plugins->Attribute( "filename" );
- if( value != NULL )
- {
- if( !( this->LoadPlugins( value ) ) )
- err << "no valid plugins file \"" << value << "\"" << std::endl;
-
- } // fi
- plugins = plugins->NextSiblingElement( "plugins" );
-
- } // elihw
-
- // Read plugins paths
- plugins = root->FirstChildElement( "plugins_dir" );
- while( plugins != NULL )
- {
- const char* value = plugins->Attribute( "path" );
- if( value != NULL )
- {
- int recursive;
- if( plugins->QueryIntAttribute( "recursive", &recursive ) != TIXML_SUCCESS )
- recursive = 0;
- if( !( this->LoadPluginsPath( value, recursive == 1 ) ) )
- err << "No valid plugins path \"" << value << "\"" << std::endl;
-
- } // fi
- plugins = plugins->NextSiblingElement( "plugins_dir" );
-
- } // elihw
-
// Read filters
TiXmlElement* filter = root->FirstChildElement( "filter" );
while( filter != NULL )
{
const char* class_value = filter->Attribute( "class" );
const char* name_value = filter->Attribute( "name" );
+ float viewX = float( 0 );
+ float viewY = float( 0 );
+ filter->QueryFloatAttribute( "ViewX", &viewX );
+ filter->QueryFloatAttribute( "ViewY", &viewY );
if( class_value != NULL && name_value != NULL )
{
if( this->CreateFilter( class_value, name_value ) )
{
+ TFilter* new_filter = this->GetFilter( name_value );
+ new_filter->SetViewCoords( viewX, viewY );
+
// Read parameters
- TParameters* parameters = this->GetParameters( name_value );
+ TParameters* parameters = new_filter->GetParameters( );
parameters->Clear( );
TiXmlElement* param = filter->FirstChildElement( "parameter" );
TiXmlDocument* doc = new TiXmlDocument( );
TiXmlElement* root = new TiXmlElement( "cpPlugins_Workspace" );
- // Save plugins
- for(
- auto plugIt = this->m_LoadedPlugins.begin( );
- plugIt != this->m_LoadedPlugins.end( );
- ++plugIt
- )
- {
- TiXmlElement* plugin = new TiXmlElement( "plugins" );
- plugin->SetAttribute( "filename", plugIt->c_str( ) );
- root->LinkEndChild( plugin );
-
- } // rof
-
// Save vertices
auto vIt = this->m_Graph->BeginVertices( );
for( ; vIt != this->m_Graph->EndVertices( ); ++vIt )
if( filter != NULL )
{
TiXmlElement* e = new TiXmlElement( "filter" );
- e->SetAttribute( "class", filter->GetClassName( ).c_str( ) );
+ e->SetAttribute( "class", filter->GetClassName( ) );
e->SetAttribute( "name", filter->GetName( ) );
+ e->SetAttribute( "ViewX", filter->GetViewX( ) );
+ e->SetAttribute( "ViewY", filter->GetViewY( ) );
const TParameters* params = filter->GetParameters( );
std::vector< std::string > names;