Пример #1
0
bool CoreWindow::removeClick()
{	
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	QLinkedList<osg::ref_ptr<Data::Edge> > * selectedEdges = viewerWidget->getPickHandler()->getSelectedEdges();
	
	while (selectedEdges->size () > 0) {
		osg::ref_ptr<Data::Edge> existingEdge1 = (* (selectedEdges->constBegin()));
		currentGraph->removeEdge(existingEdge1);
		selectedEdges->removeFirst ();
	}
	currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	QLinkedList<osg::ref_ptr<Data::Node> > * selectedNodes = viewerWidget->getPickHandler()->getSelectedNodes();

	while (selectedNodes->size () > 0) {
		osg::ref_ptr<Data::Node> existingNode1 = (* (selectedNodes->constBegin()));
		if (existingNode1->isRemovableByUser())
			currentGraph->removeNode(existingNode1);
		selectedNodes->removeFirst ();
	}

	int NodesCount=currentGraph->getNodes()->size();
	cout<<NodesCount;
	if (isPlaying)
		layout->play();

	return true;
}
Пример #2
0
void CoreWindow::removeMetaNodes()
{
	QLinkedList<osg::ref_ptr<Data::Node> > * selectedNodes = viewerWidget->getPickHandler()->getSelectedNodes();
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	QLinkedList<osg::ref_ptr<Data::Node> >::const_iterator i = selectedNodes->constBegin();

	while (i != selectedNodes->constEnd()) 
	{
		if ((*i)->getType()->isMeta())
			currentGraph->removeNode((*i));
		++i;
	}

	if (isPlaying)
		layout->play();
}
Пример #3
0
void CoreWindow::removeMetaNodes()
{
	QLinkedList<osg::ref_ptr<Data::Node> > * selectedNodes = viewerWidget->getPickHandler()->getSelectedNodes();
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	QLinkedList<osg::ref_ptr<Data::Node> >::const_iterator i = selectedNodes->constBegin();

	while (i != selectedNodes->constEnd()) 
	{
		//treba este opravit - zatial kontrolujeme ci to nie je mergedNode len podla mena
		if ((*i)->getType()->isMeta() && (*i)->getName() != "mergedNode")
			currentGraph->removeNode((*i));
		++i;
	}

	if (isPlaying)
		layout->play();
}