本文整理汇总了C++中NodeGroup::getNodeGraph方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeGroup::getNodeGraph方法的具体用法?C++ NodeGroup::getNodeGraph怎么用?C++ NodeGroup::getNodeGraph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeGroup
的用法示例。
在下文中一共展示了NodeGroup::getNodeGraph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: logic_error
void
GuiAppInstance::onGroupCreationFinished(const NodePtr& node,
CreateNodeReason reason)
{
if (reason == eCreateNodeReasonUserCreate) {
NodeGraph* graph = 0;
boost::shared_ptr<NodeCollection> collection = node->getGroup();
assert(collection);
NodeGroup* isGrp = dynamic_cast<NodeGroup*>( collection.get() );
if (isGrp) {
NodeGraphI* graph_i = isGrp->getNodeGraph();
assert(graph_i);
graph = dynamic_cast<NodeGraph*>(graph_i);
} else {
graph = _imp->_gui->getNodeGraph();
}
assert(graph);
if (!graph) {
throw std::logic_error("");
}
NodesGuiList selectedNodes = graph->getSelectedNodes();
NodeGuiPtr selectedNode;
if ( !selectedNodes.empty() ) {
selectedNode = selectedNodes.front();
if ( dynamic_cast<BackdropGui*>( selectedNode.get() ) ) {
selectedNode.reset();
}
}
boost::shared_ptr<NodeGuiI> node_gui_i = node->getNodeGui();
assert(node_gui_i);
NodeGuiPtr nodeGui = boost::dynamic_pointer_cast<NodeGui>(node_gui_i);
graph->moveNodesForIdealPosition(nodeGui, selectedNode, true);
}
AppInstance::onGroupCreationFinished(node, reason);
/*std::list<ViewerInstance* > viewers;
node->hasViewersConnected(&viewers);
for (std::list<ViewerInstance* >::iterator it2 = viewers.begin(); it2 != viewers.end(); ++it2) {
(*it2)->renderCurrentFrame(false);
}*/
}