//=========================================================================
+ void wxVtkSceneManager::saveDiagram(std::string &content)
+ {
+ //Print boxes
+ char buffer [50];
+ std::vector<int> boxes = getBoxes();
+ int bsize = boxes.size();
+ content+="BOXES ";
+ sprintf (buffer, "%d", bsize);
+ content+=buffer;
+ content+="\n";
+
+ for(int i = 0;i<bsize;i++)
+ {
+ int id = boxes[i];
+ GObjectController *cont = _controllers[id];
+ cont->getModel()->save(content);
+ }
+
+ content+="\n";
+
+ //Print connections
+ std::vector<int> connections = getConnections();
+ int csize = connections.size();
+ content+="CONNECTIONS ";
+ sprintf (buffer, "%d", csize);
+ content+=buffer;
+ content+="\n";
+
+ for(int i = 0;i<csize;i++)
+ {
+ int id = connections[i];
+ GObjectController *cont = _controllers[id];
+ cont->getModel()->save(content);
+ }
+
+ }
+
+ //=========================================================================
+
+ std::vector<int> wxVtkSceneManager::getBoxes()
+ {
+ std::vector<int> vect;
+ std::map<int, GObjectController*>::iterator it;
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *cont = it->second;
+ if(cont->getGObjectType()==GBLACKBOX)
+ {
+ vect.push_back(cont->getId());
+ }
+ }
+ return vect;
+ }
+
+ //=========================================================================
+
+ std::vector<int> wxVtkSceneManager::getConnections()
+ {
+ std::vector<int> vect;
+ std::map<int, GObjectController*>::iterator it;
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *cont = it->second;
+ if(cont->getGObjectType()==GCONNECTOR)
+ {
+ vect.push_back(cont->getId());
+ }
+ }
+ return vect;
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF