本文整理汇总了C++中NodeGroupPtr::getNode方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeGroupPtr::getNode方法的具体用法?C++ NodeGroupPtr::getNode怎么用?C++ NodeGroupPtr::getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeGroupPtr
的用法示例。
在下文中一共展示了NodeGroupPtr::getNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selRect
void
NodeGraph::mouseMoveEvent(QMouseEvent* e)
{
QPointF newPos = mapToScene( e->pos() );
QPointF lastMousePosScene = mapToScene( _imp->_lastMousePos.x(), _imp->_lastMousePos.y() );
double dx, dy;
{
QPointF newPosRoot = _imp->_root->mapFromScene(newPos);
QPointF lastMousePosRoot = _imp->_root->mapFromScene(lastMousePosScene);
dx = newPosRoot.x() - lastMousePosRoot.x();
dy = newPosRoot.y() - lastMousePosRoot.y();
}
_imp->_hasMovedOnce = true;
bool mustUpdate = true;
NodeCollectionPtr collection = getGroup();
NodeGroupPtr isGroup = toNodeGroup(collection);
bool isGroupEditable = true;
bool groupEdited = true;
if (isGroup) {
isGroupEditable = isGroup->isSubGraphEditable();
groupEdited = isGroup->getNode()->hasPyPlugBeenEdited();
}
if (!groupEdited && isGroupEditable) {
///check if user is nearby unlock
int iw = _imp->unlockIcon.width();
int ih = _imp->unlockIcon.height();
int w = width();
if ( ( e->x() >= (w - iw - 10 - 15) ) && ( e->x() <= (w - 10 + 15) ) &&
( e->y() >= (10 - 15) ) && ( e->y() <= (10 + ih + 15) ) ) {
assert(isGroup);
QPoint pos = mapToGlobal( e->pos() );
QToolTip::showText( pos, GuiUtils::convertFromPlainText(QCoreApplication::translate("NodeGraph", "Clicking the unlock button will convert the PyPlug to a regular group saved in the project and dettach it from the script.\n"
"Any modification will not be written to the Python script. Subsequent loading of the project will no longer load this group from the python script."), Qt::WhiteSpaceNormal) );
}
}
QRectF sceneR = visibleSceneRect();
if ( groupEdited && (_imp->_evtState != eEventStateSelectionRect) && (_imp->_evtState != eEventStateDraggingArrow) ) {
// Set cursor
std::set<NodeGuiPtr> visibleNodes;
getNodesWithinViewportRect(visibleWidgetRect(), &visibleNodes);
NodeGuiPtr selected;
Edge* selectedEdge = 0;
bool optionalInputsAutoHidden = areOptionalInputsAutoHidden();
for (std::set<NodeGuiPtr>::iterator it = visibleNodes.begin(); it != visibleNodes.end(); ++it) {
QPointF evpt = (*it)->mapFromScene(newPos);
QRectF bbox = (*it)->mapToScene( (*it)->boundingRect() ).boundingRect();
if ( (*it)->isActive() && bbox.intersects(sceneR) ) {
if ( (*it)->contains(evpt) ) {
selected = (*it)->shared_from_this();
if (optionalInputsAutoHidden) {
(*it)->refreshEdgesVisility(true);
} else {
break;
}
} else {
Edge* edge = (*it)->hasEdgeNearbyPoint(newPos);
if (edge) {
selectedEdge = edge;
if (!optionalInputsAutoHidden) {
break;
}
} else if ( optionalInputsAutoHidden && !(*it)->getIsSelected() ) {
(*it)->refreshEdgesVisility(false);
}
}
}
}
if (selected) {
_imp->cursorSet = true;
setCursor( QCursor(Qt::OpenHandCursor) );
} else if (selectedEdge) {
} else if (!selectedEdge && !selected) {
if (_imp->cursorSet) {
_imp->cursorSet = false;
unsetCursor();
}
}
}
bool mustUpdateNavigator = false;
///Apply actions
switch (_imp->_evtState) {
case eEventStateDraggingArrow: {
QPointF np = _imp->_arrowSelected->mapFromScene(newPos);
if ( _imp->_arrowSelected->isOutputEdge() ) {
_imp->_arrowSelected->dragDest(np);
} else {
_imp->_arrowSelected->dragSource(np);
}
checkAndStartAutoScrollTimer(newPos);
mustUpdate = true;
break;
}
case eEventStateDraggingNode: {
//.........这里部分代码省略.........