• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ data::Graph类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中data::Graph的典型用法代码示例。如果您正苦于以下问题:C++ Graph类的具体用法?C++ Graph怎么用?C++ Graph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Graph类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setRestriction_Plane

void CoreWindow::setRestriction_Plane ()
{
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	if (currentGraph != NULL) {
		osg::Vec3 position = viewerWidget->getPickHandler()->getSelectionCenter(true);

		osg::ref_ptr<Data::Node> node1 = currentGraph->addRestrictionNode (QString ("plane_node_1"), position);
		osg::ref_ptr<Data::Node> node2 = currentGraph->addRestrictionNode (QString ("plane_node_2"), position + osg::Vec3f (10, 0, 0));
		osg::ref_ptr<Data::Node> node3 = currentGraph->addRestrictionNode (QString ("plane_node_3"), position + osg::Vec3f (0, 10, 0));

		Layout::RestrictionRemovalHandler_RestrictionNodesRemover::NodesListType restrictionNodes;
		restrictionNodes.push_back (node1);
		restrictionNodes.push_back (node2);
		restrictionNodes.push_back (node3);

		setRestrictionToSelectedNodes (
			QSharedPointer<Layout::ShapeGetter> (
				new Layout::ShapeGetter_Plane_ByThreeNodes (node1, node2, node3)
			),
			currentGraph,
			QSharedPointer<Layout::RestrictionRemovalHandler_RestrictionNodesRemover> (
				new Layout::RestrictionRemovalHandler_RestrictionNodesRemover (
					*currentGraph,
					restrictionNodes
				)
			)
		);
	}
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:30,代码来源:CoreWindow.cpp


示例2: execute_client

void AddMetaNodeExecutor::execute_client() {

    int count, metaNodeId, id_edge, id_node;
    QString name, edgeName;
    float x, y, z;

    *stream >> metaNodeId >> name;

    Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
    QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getNodes();

    *stream >> x >> y >> z;

    osg::ref_ptr<Data::Node> metaNode = currentGraph->addNode(metaNodeId, name, currentGraph->getNodeMetaType(), osg::Vec3(x,y,z));

    *stream >> edgeName;
    *stream >> count;
    for (int i = 0; i < count; i++) {
        *stream >> id_edge >> id_node;
        if (nodes->contains(id_node)) {
            currentGraph->addEdge(id_edge, edgeName, *nodes->find(id_node), metaNode, currentGraph->getEdgeMetaType(), true);
        }
    }

}
开发者ID:FilipMikle,项目名称:Arvis,代码行数:25,代码来源:AddMetaNodeExecutor.cpp


示例3: execute_client

void MoveNodeExecutor::execute_client() {

    int id;
    float x,y,z;

    *stream >> id >> x >> y >> z;

    Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
    QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getNodes();
    //qDebug() << "Moving" << id << "to" << x << y << z;
    if (nodes->contains(id)) {
        this->moveNode(*nodes->find(id), osg::Vec3(x,y,z));
    } else {
        QMap<qlonglong, osg::ref_ptr<Data::Node> >* mergeNodes = currentGraph->getMetaNodes();
        if (mergeNodes->contains(id)) {
            this->moveNode(*mergeNodes->find(id), osg::Vec3(x,y,z));
        } else {
            qDebug() << "Nepoznam uzol" << id;
        }
    }

    //TODO: refactor
    // Stupid way to fix restriction shape refreshing
    ((QOSG::CoreWindow *)Client::getInstance()->getCoreWindowReference())->getLayoutThread()->pause();
    ((QOSG::CoreWindow *)Client::getInstance()->getCoreWindowReference())->getLayoutThread()->play();
}
开发者ID:Gabika,项目名称:Arvis,代码行数:26,代码来源:MoveNodeExecutor.cpp


示例4: removeClick

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;
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:27,代码来源:CoreWindow.cpp


示例5: add_NodeClick

bool CoreWindow::add_NodeClick()
{	
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	Data::Type *edgeType = NULL;
	Data::Type *nodeType = NULL;

	if (currentGraph != NULL)
	{
		osg::Vec3 position = viewerWidget->getPickHandler()->getSelectionCenter(true); 

		osg::ref_ptr<Data::Node> node1 = currentGraph->addNode("newNode", currentGraph->getNodeMetaType(), position);	

		if (isPlaying)
			layout->play();
	}
	else
	{
		currentGraph= Manager::GraphManager::getInstance()->createNewGraph("NewGraph");
		osg::Vec3 position = viewerWidget->getPickHandler()->getSelectionCenter(true); 
		Data::MetaType* type = currentGraph->addMetaType(Data::GraphLayout::META_NODE_TYPE);
		osg::ref_ptr<Data::Node> node1 = currentGraph->addNode("newNode", type);	
		if (isPlaying)
			layout->play();
	}
	return true;
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:26,代码来源:CoreWindow.cpp


示例6: execute_server

void SetFixNodeStateExecutor::execute_server() {
    int id;
    bool state;

    *stream >> id >> state;

    Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
    QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getNodes();
    if (nodes->contains(id)) {
        this->SetFixNodeState(*nodes->find(id), state);
    } else {
        QMap<qlonglong, osg::ref_ptr<Data::Node> >* mergeNodes = currentGraph->getMetaNodes();
        if (mergeNodes->contains(id)) {
            this->SetFixNodeState(*mergeNodes->find(id),state);
        }
    }

    Server * server = Server::getInstance();
    server->sendFixNodeState(id, state);

    if (((QOSG::CoreWindow *)server->getCoreWindowReference())->playing()) {
        server->getLayoutThread()->play();
    }

}
开发者ID:FilipMikle,项目名称:Arvis,代码行数:25,代码来源:SetFixNodeStateExecutor.cpp


示例7: execute_client

void SetFixNodeStateExecutor::execute_client() {
    int id;
    bool state;

    *stream >> id >> state;


    Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
    QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getNodes();
    Client * client = Client::getInstance();
    if (nodes->contains(id)) {
        Data::Node * node = *nodes->find(id);
        this->SetFixNodeState(node, state);
        if (client->selected_nodes.contains(node)) {
            client->selected_nodes.removeOne(node);
        }
    } else {
        QMap<qlonglong, osg::ref_ptr<Data::Node> >* mergeNodes = currentGraph->getMetaNodes();
        if (mergeNodes->contains(id)) {
            Data::Node * node = *mergeNodes->find(id);
            this->SetFixNodeState(node,state);
            if (client->selected_nodes.contains(node)) {
                client->selected_nodes.removeOne(node);
            }
        }
    }

}
开发者ID:FilipMikle,项目名称:Arvis,代码行数:28,代码来源:SetFixNodeStateExecutor.cpp


示例8: saveLayoutToDB

void CoreWindow::saveLayoutToDB()
{
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	if(currentGraph != NULL)
	{
		QSqlDatabase * conn = Manager::GraphManager::getInstance()->getDB()->tmpGetConn();
		bool ok;
	
		if(conn != NULL && conn->open()) { 
			QString layout_name = QInputDialog::getText(this, tr("New layout name"), tr("Layout name:"), QLineEdit::Normal, "", &ok);
		
			if (ok && !layout_name.isEmpty())
			{
				Data::GraphLayout* layout = Model::GraphLayoutDAO::addLayout(layout_name, currentGraph, conn);
				currentGraph->selectLayout(layout);

				currentGraph->saveLayoutToDB(conn, currentGraph);
			}
			else
			{
				qDebug() << "[QOSG::CoreWindow::saveLayoutToDB] Input dialog canceled";
			}
		}
		else
		{
			qDebug() << "[QOSG::CoreWindow::saveLayoutToDB] Connection to DB not opened";
		}
	}
	else
	{
		qDebug() << "[QOSG::CoreWindow::saveLayoutToDB] There is no active graph loaded";
	}
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:34,代码来源:CoreWindow.cpp


示例9: execute_server

void SeparateNodesExecutor::execute_server()
{

	int count, id;

	*stream >>count;

	Data::Graph* currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getMetaNodes();

	QLinkedList<osg::ref_ptr<Data::Node> >* selectedNodes = new QLinkedList<osg::ref_ptr<Data::Node> >();

	for ( int i = 0; i < count; i++ ) {
		*stream >> id;
		if ( nodes->contains( id ) ) {
			selectedNodes->append( *nodes->find( id ) );
		}
	}

	Server* server = Server::getInstance();
	currentGraph->separateNodes( selectedNodes );

	server->sendSeparateNodes( selectedNodes );

	if ( ( ( QOSG::CoreWindow* )server->getCoreWindowReference() )->playing() ) {
		server->getLayoutThread()->play();
	}
	return;

}
开发者ID:vexta,项目名称:3dsoftviz,代码行数:30,代码来源:SeparateNodesExecutor.cpp


示例10: handleKeyDown

bool PickHandler::handleKeyDown( const osgGA::GUIEventAdapter& ea, GUIActionAdapter& aa)
{
	if(ea.getKey() == osgGA::GUIEventAdapter::KEY_Control_R || ea.getKey() == osgGA::GUIEventAdapter::KEY_Control_L)
	{
		isCtrlPressed = true;
	}
	else if(ea.getKey() == osgGA::GUIEventAdapter::KEY_Shift_L || ea.getKey() == osgGA::GUIEventAdapter::KEY_Shift_R)
	{
		isShiftPressed = true;
	}
	else if(ea.getKey() == osgGA::GUIEventAdapter::KEY_Alt_L || ea.getKey() == osgGA::GUIEventAdapter::KEY_Alt_R)
	{
		isAltPressed = true;
	}
	else if(ea.getKey() == 'q')
	{
		Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
		Util::ElementSelector::randomElementSelector(currentGraph->getNodes(), currentGraph->getEdges(), appConf->getValue("Viewer.PickHandler.AutopickedNodes").toInt(), this);
	}
	else if(ea.getKey() == 'w')
	{
		Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
		Util::ElementSelector::weightedElementSelector(currentGraph->getNodes(), appConf->getValue("Viewer.PickHandler.AutopickedNodes").toInt(), this);
	}

	return false;
}
开发者ID:VolovarMartin,项目名称:3dsoftviz,代码行数:27,代码来源:PickHandler.cpp


示例11: execute_server

void NewEdgeExecutor::execute_server()
{

	Server* server = Server::getInstance();

	QString name;
	int from, to;
	bool oriented;

	*stream >> name >> from >> to >> oriented;
	//qDebug()<< "[NEW NODE]" << "[" << x << "," << y << "," << z << "]";


	Data::Graph* currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getNodes();

	osg::ref_ptr<Data::Node> node_from = *nodes->find( from );
	osg::ref_ptr<Data::Node> node_to = *nodes->find( to );

	Data::Type* type = currentGraph->addType( Data::GraphLayout::META_EDGE_TYPE );

	osg::ref_ptr<Data::Edge> newEdge = currentGraph->addEdge( "NewEdge",node_from,node_to,type,oriented );

	if ( ( ( QOSG::CoreWindow* )server->getCoreWindowReference() )->playing() ) {
		server->getLayoutThread()->play();
	}

	server->sendNewEdge( newEdge );
}
开发者ID:kapecp,项目名称:3dsoftviz,代码行数:29,代码来源:NewEdgeExecutor.cpp


示例12: setRestriction_Sphere

void CoreWindow::setRestriction_Sphere ()
{
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	if (currentGraph != NULL)
	{
		osg::Vec3 position = viewerWidget->getPickHandler()->getSelectionCenter(true);

		osg::ref_ptr<Data::Node> centerNode = currentGraph->addRestrictionNode (QString ("center"), position);
		osg::ref_ptr<Data::Node> surfaceNode = currentGraph->addRestrictionNode (QString ("surface"), position + osg::Vec3f (10, 0, 0));

		Layout::RestrictionRemovalHandler_RestrictionNodesRemover::NodesListType restrictionNodes;
		restrictionNodes.push_back (centerNode);
		restrictionNodes.push_back (surfaceNode);

		setRestrictionToSelectedNodes (
			QSharedPointer<Layout::ShapeGetter> (
				new Layout::ShapeGetter_Sphere_ByTwoNodes (centerNode, surfaceNode)
			),
			currentGraph,
			QSharedPointer<Layout::RestrictionRemovalHandler_RestrictionNodesRemover> (
				new Layout::RestrictionRemovalHandler_RestrictionNodesRemover (
					*currentGraph,
					restrictionNodes
				)
			)
		);
	}
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:29,代码来源:CoreWindow.cpp


示例13: doNodePick

bool PickHandler::doNodePick(osg::NodePath nodePath)
{
	Data::Node * n = dynamic_cast<Data::Node *>(nodePath[nodePath.size() - 1]);

	if (n != NULL)
	{
		if (isAltPressed && pickMode == PickMode::NONE && !isShiftPressed)
		{
			cameraManipulator->setCenter(n->targetPosition());
		}
		else if (isAltPressed && pickMode == PickMode::NONE && isShiftPressed)
		{
			if (appConf->getValue("Viewer.PickHandler.SelectInterestPoints").toInt() == 1)
			{
				Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
				Util::ElementSelector::weightedElementSelector(currentGraph->getNodes(), appConf->getValue("Viewer.PickHandler.AutopickedNodes").toInt(), this);
			}

			bool wasEmpty = false;
			if (pickedNodes.isEmpty())
			{
				pickedNodes.append(n);
				wasEmpty = true;
			}

			if (appConf->getValue("Viewer.Display.CameraPositions").toInt() == 1)
			{
				n->setColor(osg::Vec4(0, 1, 0, 1));
			}

			cameraManipulator->setNewPosition(n->getCurrentPosition(), getSelectionCenter(false), getSelectedNodes()->toStdList(), getSelectedEdges()->toStdList());

			if (wasEmpty)
				pickedNodes.removeFirst();
		}
		else if (pickMode != PickMode::NONE)
		{
			if (!pickedNodes.contains(n))
			{
				pickedNodes.append(n);
				n->setSelected(true);
			}

			if (isCtrlPressed)
				unselectPickedNodes(n);

			return true;
		}
	}

	return false;
}
开发者ID:FilipMikle,项目名称:Arvis,代码行数:52,代码来源:PickHandler.cpp


示例14: alterCameraTargetPoint

void Vwr::CameraManipulator::initAutomaticMovement(osgViewer::Viewer* viewer)
{
	t1 = t2 = 0;

	osg::Vec3d eye;
	osg::Vec3d center;
	osg::Vec3d up;

	viewer->getCamera()->getViewMatrixAsLookAt(eye, center, up);
	
	this->lastPosition = originalEyePosition = eye;
	this->lastTargetPoint = center;

	float scale = appConf->getValue("Viewer.Display.NodeDistanceScale").toFloat();

	weightPoint = (eye + cameraInterestPoint + cameraTargetPoint)/3;
	targetDistance = alterCameraTargetPoint(viewer);

	cameraPositions = new QVector<osg::Vec3d>();
	cameraPositions->push_back(originalEyePosition);
	cameraPositions->push_back(cameraInterestPoint);
	cameraPositions->push_back(cameraTargetPoint);

	// vahy kontrolnych bodov pre trajektoriu kamery
	w1[0] = 1;
	w1[1] = -0.1;
	w1[2] = 1;

	targetPositions = new QVector<osg::Vec3d>();

	targetPositions->push_back(center);
	targetPositions->push_back(cameraInterestPoint);
	targetPositions->push_back(weightPoint);

	// vahy kontrolnych bodov pre trajektriu pohladu
	w2[0] = 1;
	w2[1] = 0.5f;
	w2[2] = 1;

	// uprava vah aby boli viditelne vsetky body zaujmu
	alterWeights(viewer, selectedCluster);

	// zobrazenie kontornych bodov
	if (appConf->getValue("Viewer.Display.CameraPositions").toInt() == 1)
	{
		Data::Graph * g = Manager::GraphManager::getInstance()->getActiveGraph();

		g->addNode("centerNode", g->getNodeMetaType(), center)->setColor(osg::Vec4(0, 0.5, 1, 0.5));
		g->addNode("startNode", g->getNodeMetaType(), originalEyePosition / scale);
		g->addNode("interestPoint", g->getNodeMetaType(), cameraInterestPoint / scale)->setColor(osg::Vec4(0, 1, 1, 1));
		g->addNode("weigthPoint", g->getNodeMetaType(), weightPoint)->setColor(osg::Vec4(0, 0.5, 1, 1));
	}

	automaticMovementInitialized = true;
}
开发者ID:Cecko,项目名称:3dsoftviz,代码行数:55,代码来源:CameraManipulator.cpp


示例15: removeMetaNodes

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();
}
开发者ID:TomasHurban,项目名称:3dsoftviz,代码行数:17,代码来源:CoreWindow.cpp


示例16: removeMetaNodes

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();
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:18,代码来源:CoreWindow.cpp


示例17: separateNodes

void CoreWindow::separateNodes()
{
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	
	if (currentGraph != NULL)
	{
		QLinkedList<osg::ref_ptr<Data::Node> > * selectedNodes = viewerWidget->getPickHandler()->getSelectedNodes();

		if(selectedNodes->count() > 0) {
			currentGraph->separateNodes(selectedNodes);
		}
		else {
			qDebug() << "[QOSG::CoreWindow::separateNodes] There are no nodes selected";
		}

		if (isPlaying)
			layout->play();
	}
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:19,代码来源:CoreWindow.cpp


示例18: mergeNodes

void CoreWindow::mergeNodes()
{	
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	if (currentGraph != NULL)
	{
		osg::Vec3 position = viewerWidget->getPickHandler()->getSelectionCenter(true); 
		QLinkedList<osg::ref_ptr<Data::Node> > * selectedNodes = viewerWidget->getPickHandler()->getSelectedNodes();

		if(selectedNodes->count() > 0) {
			currentGraph->mergeNodes(selectedNodes, position);
		}
		else {
			qDebug() << "[QOSG::CoreWindow::mergeNodes] There are no nodes selected";
		}
		
		viewerWidget->getPickHandler()->unselectPickedEdges(0);
		viewerWidget->getPickHandler()->unselectPickedNodes(0);

		if (isPlaying)
			layout->play();
	}
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:23,代码来源:CoreWindow.cpp


示例19: execute_server

void AddMetaNodeExecutor::execute_server()
{

	int count, id;
	QString name, edgeName;
	float x, y, z;

	*stream >> name;

	Data::Graph* currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();
	QMap<qlonglong, osg::ref_ptr<Data::Node> >* nodes = currentGraph -> getNodes();

	*stream >> x >> y >> z;

	osg::ref_ptr<Data::Node> metaNode = currentGraph->addNode( name, currentGraph->getNodeMetaType(), osg::Vec3( x,y,z ) );

	*stream >> edgeName;
	*stream >> count;
	QLinkedList<osg::ref_ptr<Data::Node> >* selectedNodes = new QLinkedList<osg::ref_ptr<Data::Node> >();

	for ( int i = 0; i < count; i++ ) {
		*stream >> id;
		if ( nodes->contains( id ) ) {
			currentGraph->addEdge( edgeName, *nodes->find( id ), metaNode, currentGraph->getEdgeMetaType(), true );
			selectedNodes->append( *nodes->find( id ) );
		}
	}

	Server* server = Server::getInstance();
	server->sendAddMetaNode( metaNode,selectedNodes,edgeName,osg::Vec3( x,y,z ) );

	if ( ( ( QOSG::CoreWindow* )server->getCoreWindowReference() )->playing() ) {
		server->getLayoutThread()->play();
	}


}
开发者ID:vexta,项目名称:3dsoftviz,代码行数:37,代码来源:AddMetaNodeExecutor.cpp


示例20: addMetaNode

void CoreWindow::addMetaNode()
{	
	Data::Graph * currentGraph = Manager::GraphManager::getInstance()->getActiveGraph();

	if (currentGraph != NULL)
	{
		osg::Vec3 position = viewerWidget->getPickHandler()->getSelectionCenter(true); 

		osg::ref_ptr<Data::Node> metaNode = currentGraph->addNode("metaNode", currentGraph->getNodeMetaType(), position);	
		QLinkedList<osg::ref_ptr<Data::Node> > * selectedNodes = viewerWidget->getPickHandler()->getSelectedNodes();

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

		while (i != selectedNodes->constEnd()) 
		{
			Data::Edge * e = currentGraph->addEdge("metaEdge", (*i), metaNode, currentGraph->getEdgeMetaType(), true);
			e->setCamera(viewerWidget->getCamera());
			++i;
		}

		if (isPlaying)
			layout->play();
	}
}
开发者ID:gerdaholubova,项目名称:3dsoftviz,代码行数:24,代码来源:CoreWindow.cpp



注:本文中的data::Graph类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ database::Results类代码示例发布时间:2022-05-31
下一篇:
C++ czeroconfbrowser::ZeroconfService类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap