本文整理汇总了C++中ViewerNodePtr::getInternalViewerNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewerNodePtr::getInternalViewerNode方法的具体用法?C++ ViewerNodePtr::getInternalViewerNode怎么用?C++ ViewerNodePtr::getInternalViewerNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewerNodePtr
的用法示例。
在下文中一共展示了ViewerNodePtr::getInternalViewerNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getGui
ViewerTab::~ViewerTab()
{
Gui* gui = getGui();
if (gui) {
NodeGraph* graph = 0;
ViewerNodePtr internalNode = getInternalNode();
ViewerInstancePtr viewerNode = internalNode ? internalNode->getInternalViewerNode() : ViewerInstancePtr();
if (viewerNode) {
NodeCollectionPtr collection = viewerNode->getNode()->getGroup();
if (collection) {
NodeGroupPtr isGrp = toNodeGroup(collection);
if (isGrp) {
NodeGraphI* graph_i = isGrp->getNodeGraph();
if (graph_i) {
graph = dynamic_cast<NodeGraph*>(graph_i);
assert(graph);
}
} else {
graph = gui->getNodeGraph();
}
}
internalNode->invalidateUiContext();
} else {
graph = gui->getNodeGraph();
}
assert(graph);
GuiAppInstancePtr app = gui->getApp();
if ( app && !app->isClosing() && graph && (graph->getLastSelectedViewer() == this) ) {
graph->setLastSelectedViewer(0);
}
}
_imp->nodesContext.clear();
}
示例2: logic_error
void
Gui::removeViewerTab(ViewerTab* tab,
bool initiatedFromNode,
bool deleteData)
{
assert(tab);
unregisterTab(tab);
if (tab == _imp->_activeViewer) {
_imp->_activeViewer = 0;
}
NodeGraph* graph = 0;
NodeGroupPtr isGrp;
NodeCollectionPtr collection;
if ( tab->getInternalNode() && tab->getInternalNode()->getNode() ) {
NodeCollectionPtr collection = tab->getInternalNode()->getNode()->getGroup();
isGrp = toNodeGroup(collection);
}
if (isGrp) {
NodeGraphI* graph_i = isGrp->getNodeGraph();
assert(graph_i);
graph = dynamic_cast<NodeGraph*>(graph_i);
} else {
graph = getNodeGraph();
}
assert(graph);
if (!graph) {
throw std::logic_error("");
}
ViewerTab* lastSelectedViewer = graph->getLastSelectedViewer();
if (lastSelectedViewer == tab) {
bool foundOne = false;
NodesList nodes;
if (collection) {
nodes = collection->getNodes();
}
for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) {
ViewerNodePtr isViewer = (*it)->isEffectViewerNode();
if ( !isViewer || ( isViewer == tab->getInternalNode() ) || !(*it)->isActivated() ) {
continue;
}
OpenGLViewerI* viewerI = isViewer->getUiContext();
assert(viewerI);
ViewerGL* glViewer = dynamic_cast<ViewerGL*>(viewerI);
assert(glViewer);
if (glViewer) {
graph->setLastSelectedViewer( glViewer->getViewerTab() );
}
foundOne = true;
break;
}
if (!foundOne) {
graph->setLastSelectedViewer(0);
}
}
ViewerNodePtr viewerNode = tab->getInternalNode();
ViewerInstancePtr internalViewer;
if (viewerNode) {
internalViewer = viewerNode->getInternalViewerNode();
}
if (internalViewer) {
internalViewer->abortAnyEvaluation();
if (getApp()->getLastViewerUsingTimeline() == internalViewer) {
getApp()->discardLastViewerUsingTimeline();
}
}
if (!initiatedFromNode) {
assert(_imp->_nodeGraphArea);
///call the deleteNode which will call this function again when the node will be deactivated.
NodePtr internalNode = tab->getInternalNode()->getNode();
NodeGuiIPtr guiI = internalNode->getNodeGui();
NodeGuiPtr gui = boost::dynamic_pointer_cast<NodeGui>(guiI);
assert(gui);
NodeGraphI* graph_i = internalNode->getGroup()->getNodeGraph();
assert(graph_i);
NodeGraph* graph = dynamic_cast<NodeGraph*>(graph_i);
assert(graph);
if (graph) {
graph->removeNode(gui);
}
} else {
tab->hide();
TabWidget* container = dynamic_cast<TabWidget*>( tab->parentWidget() );
if (container) {
container->removeTab(tab, false);
}
if (deleteData) {
QMutexLocker l(&_imp->_viewerTabsMutex);
std::list<ViewerTab*>::iterator it = std::find(_imp->_viewerTabs.begin(), _imp->_viewerTabs.end(), tab);
if ( it != _imp->_viewerTabs.end() ) {
_imp->_viewerTabs.erase(it);
//.........这里部分代码省略.........