本文整理汇总了C++中NodeGuiPtr::setUserSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeGuiPtr::setUserSelected方法的具体用法?C++ NodeGuiPtr::setUserSelected怎么用?C++ NodeGuiPtr::setUserSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeGuiPtr
的用法示例。
在下文中一共展示了NodeGuiPtr::setUserSelected方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tr
void
NodeGraph::removeNode(const NodeGuiPtr & node)
{
NodeGroup* isGrp = node->getNode()->isEffectGroup();
const KnobsVec & knobs = node->getNode()->getKnobs();
for (U32 i = 0; i < knobs.size(); ++i) {
KnobI::ListenerDimsMap listeners;
knobs[i]->getListeners(listeners);
///For all listeners make sure they belong to a node
bool foundEffect = false;
for (KnobI::ListenerDimsMap::iterator it2 = listeners.begin(); it2 != listeners.end(); ++it2) {
KnobPtr listener = it2->first.lock();
if (!listener) {
continue;
}
EffectInstance* isEffect = dynamic_cast<EffectInstance*>(listener->getHolder());
if (!isEffect) {
continue;
}
if (isGrp && isEffect->getNode()->getGroup().get() == isGrp) {
continue;
}
if ( isEffect && ( isEffect != node->getNode()->getEffectInstance().get() ) ) {
foundEffect = true;
break;
}
}
if (foundEffect) {
StandardButtonEnum reply = Dialogs::questionDialog( tr("Delete").toStdString(), tr("This node has one or several "
"parameters from which other parameters "
"of the project rely on through expressions "
"or links. Deleting this node will "
"remove these expressions "
"and undoing the action will not recover "
"them. Do you wish to continue ?")
.toStdString(), false );
if (reply == eStandardButtonNo) {
return;
}
break;
}
}
node->setUserSelected(false);
NodesGuiList nodesToRemove;
nodesToRemove.push_back(node);
pushUndoCommand( new RemoveMultipleNodesCommand(this,nodesToRemove) );
}
示例2: assert
void
NodeGraph::selectNode(const NodeGuiPtr & n,
bool addToSelection)
{
if ( !n->isVisible() ) {
return;
}
bool alreadyInSelection = std::find(_imp->_selection.begin(),_imp->_selection.end(),n) != _imp->_selection.end();
assert(n);
if (addToSelection && !alreadyInSelection) {
_imp->_selection.push_back(n);
} else if (!addToSelection) {
clearSelection();
_imp->_selection.push_back(n);
}
n->setUserSelected(true);
ViewerInstance* isViewer = n->getNode()->isEffectViewer();
if (isViewer) {
OpenGLViewerI* viewer = isViewer->getUiContext();
const std::list<ViewerTab*> & viewerTabs = getGui()->getViewersList();
for (std::list<ViewerTab*>::const_iterator it = viewerTabs.begin(); it != viewerTabs.end(); ++it) {
if ( (*it)->getViewer() == viewer ) {
setLastSelectedViewer( (*it) );
}
}
}
bool magnifiedNodeSelected = false;
if (_imp->_magnifiedNode) {
magnifiedNodeSelected = std::find(_imp->_selection.begin(),_imp->_selection.end(),_imp->_magnifiedNode)
!= _imp->_selection.end();
}
if (magnifiedNodeSelected && _imp->_magnifOn) {
_imp->_magnifOn = false;
_imp->_magnifiedNode->setScale_natron(_imp->_nodeSelectedScaleBeforeMagnif);
}
}
示例3: k
void
NodeGraph::deselectNode(const NodeGuiPtr& n)
{
{
QMutexLocker k(&_imp->_nodesMutex);
NodesGuiList::iterator it = std::find(_imp->_selection.begin(), _imp->_selection.end(), n);
if (it != _imp->_selection.end()) {
_imp->_selection.erase(it);
}
}
n->setUserSelected(false);
//Stop magnification if active
if (_imp->_magnifiedNode == n && _imp->_magnifOn) {
_imp->_magnifOn = false;
_imp->_magnifiedNode->setScale_natron(_imp->_nodeSelectedScaleBeforeMagnif);
}
}
示例4: l
void
NodeGraph::deleteNodePermanantly(const NodeGuiPtr& n)
{
assert(n);
NodesGuiList::iterator it = std::find(_imp->_nodesTrash.begin(), _imp->_nodesTrash.end(), n);
if ( it != _imp->_nodesTrash.end() ) {
_imp->_nodesTrash.erase(it);
}
{
QMutexLocker l(&_imp->_nodesMutex);
NodesGuiList::iterator it = std::find(_imp->_nodes.begin(), _imp->_nodes.end(), n);
if ( it != _imp->_nodes.end() ) {
_imp->_nodes.erase(it);
}
}
NodesGuiList::iterator found = std::find(_imp->_selection.begin(), _imp->_selection.end(), n);
if ( found != _imp->_selection.end() ) {
n->setUserSelected(false);
_imp->_selection.erase(found);
}
} // deleteNodePermanantly