void BackdropNodeGadget::frame( const std::vector<Gaffer::Node *> &nodes ) { GraphGadget *graph = ancestor<GraphGadget>(); if( !graph ) { return; } Box3f b; for( std::vector<Node *>::const_iterator it = nodes.begin(), eIt = nodes.end(); it != eIt; ++it ) { NodeGadget *nodeGadget = graph->nodeGadget( *it ); if( nodeGadget ) { b.extendBy( nodeGadget->transformedBound( NULL ) ); } } if( b.isEmpty() ) { return; } graph->setNodePosition( node(), V2f( b.center().x, b.center().y ) ); V2f s( b.size().x / 2.0f, b.size().y / 2.0f ); boundPlug()->setValue( Box2f( V2f( -s ) - V2f( g_margin ), V2f( s ) + V2f( g_margin + 2.0f * g_margin ) ) ); }
static list connectionGadgets2( GraphGadget &graphGadget, const Gaffer::Node *node, const Gaffer::Set *excludedNodes = 0 ) { std::vector<ConnectionGadget *> connections; graphGadget.connectionGadgets( node, connections, excludedNodes ); boost::python::list l; for( std::vector<ConnectionGadget *>::const_iterator it=connections.begin(), eIt=connections.end(); it!=eIt; ++it ) { l.append( ConnectionGadgetPtr( *it ) ); } return l; }
static ConnectionGadgetPtr connectionGadget( GraphGadget &graphGadget, const Gaffer::Plug *dstPlug ) { return graphGadget.connectionGadget( dstPlug ); }
static NodeGadgetPtr nodeGadget( GraphGadget &graphGadget, const Gaffer::Node *node ) { return graphGadget.nodeGadget( node ); }
static Gaffer::SetPtr getFilter( GraphGadget &graphGadget ) { return graphGadget.getFilter(); }
static Gaffer::NodePtr getRoot( GraphGadget &graphGadget ) { return graphGadget.getRoot(); }
static ConnectionGadgetPtr connectionGadgetAt( GraphGadget &g, const IECore::LineSegment3f lineSegmentInGadgetSpace ) { return g.connectionGadgetAt( lineSegmentInGadgetSpace ); }
static NodeGadgetPtr nodeGadgetAt( GraphGadget &g, const IECore::LineSegment3f lineSegmentInGadgetSpace ) { return g.nodeGadgetAt( lineSegmentInGadgetSpace ); }
static GraphLayoutPtr getLayout( GraphGadget &g ) { return g.getLayout(); }
static void setLayout( GraphGadget &g, GraphLayoutPtr l ) { return g.setLayout( l ); }