delete graph;\r
}\r
\r
-GroupBlock* Parameters::addGroupBlock() {\r
- GroupBlock* parent = AB_TO_GRP(currentScene->getGroupItem()->getRefBlock());\r
- GroupBlock* newOne = graph->createChildBlock(parent);\r
- return newOne;\r
-}\r
-\r
-FunctionalBlock* Parameters::addFunctionalBlock(int idCategory, int idBlock) {\r
+ReferenceBlock* Parameters::getReferenceBlock(int idCategory, int idBlock) {\r
\r
BlockCategory* blockCat = categoryTree->searchCategory(idCategory);\r
\r
if (blockCat == NULL) return NULL;\r
- GroupBlock* group = AB_TO_GRP(currentScene->getGroupItem()->getRefBlock());\r
ReferenceBlock* ref = blockCat->getBlock(idBlock);\r
- if (ref == NULL) return NULL;\r
-\r
- FunctionalBlock* newOne = graph->addFunctionalBlock(group, ref);\r
- unsaveModif = true;\r
-\r
- return newOne;\r
+ return ref;\r
}\r
\r
+\r
FunctionalBlock* Parameters::duplicateFunctionalBlock(FunctionalBlock *block) {\r
\r
ReferenceBlock* ref = block->getReference();\r
GroupBlock* group = AB_TO_GRP(block->getParent());\r
\r
- // adding to the group\r
- FunctionalBlock* newBlock = new FunctionalBlock(group,ref);\r
- newBlock->populate();\r
- group->addBlock(newBlock);\r
-\r
+ // adding to the graph\r
+ FunctionalBlock* newBlock = graph->addFunctionalBlock(group,ref);\r
return newBlock;\r
}\r
\r
int nb = currentScene->getBlockItems().length();\r
for(int i = 0; i<nb; i++){\r
if(currentScene->getBlockItems().at(i)->isSelected()){\r
- currentScene->getGroupWindow()->enableGroupButton(true);\r
+ currentScene->getGroupWidget()->enableGroupButton(true);\r
return;\r
}\r
}\r
- currentScene->getGroupWindow()->enableGroupButton(false);\r
+ currentScene->getGroupWidget()->enableGroupButton(false);\r
}\r
\r
\r
// cross the scene level by level using a FIFO\r
QList<GroupScene*> fifoScene;\r
fifoScene.append(topScene);\r
- foreach(ConnectionItem* item, topScene->getConnectionItems()) {\r
- allConnections.append(item);\r
- }\r
\r
GroupScene *scene;\r
while (!fifoScene.isEmpty()) {\r
foreach(GroupScene* s, scene->getChildrenScene()) {\r
fifoScene.append(s);\r
}\r
- foreach(ConnectionItem* item, topScene->getConnectionItems()) {\r
+\r
+ foreach(ConnectionItem* item, scene->getConnectionItems()) {\r
allConnections.append(item);\r
}\r
}\r
-\r
+ writer.writeEndElement(); //</scenes>\r
\r
writer.writeStartElement("connections");\r
foreach(ConnectionItem* item, allConnections) {\r