RotoShapeRenderNode::RotoShapeRenderNode(const EffectInstancePtr& mainInstance, const FrameViewRenderKey& key) : EffectInstance(mainInstance, key) , _imp(new RotoShapeRenderNodePrivate()) { RotoShapeRenderNode* other = dynamic_cast<RotoShapeRenderNode*>(mainInstance.get()); assert(other); _imp->osmesaSmearTmpTexture = other->_imp->osmesaSmearTmpTexture; }
void BackdropGui::createGui() { NodeGui::createGui(); _imp->label = new NodeGraphTextItem(getDagGui(), this, false); _imp->label->setDefaultTextColor( QColor(0, 0, 0, 255) ); _imp->label->setZValue(getBaseDepth() + 1); EffectInstancePtr effect = getNode()->getEffectInstance(); assert(effect); Backdrop* isBd = dynamic_cast<Backdrop*>( effect.get() ); assert(isBd); QObject::connect( isBd, SIGNAL(labelChanged(QString)), this, SLOT(onLabelChanged(QString)) ); refreshTextLabelFromKnob(); // Make the backdrop large enough to contain the selected nodes and position it correctly const NodesGuiList& selectedNodes = getDagGui()->getSelectedNodes(); QRectF bbox; for (NodesGuiList::const_iterator it = selectedNodes.begin(); it != selectedNodes.end(); ++it) { QRectF nodeBbox = (*it)->mapToScene( (*it)->boundingRect() ).boundingRect(); bbox = bbox.united(nodeBbox); } double border50 = mapToScene( QPoint(50, 0) ).x(); double border0 = mapToScene( QPoint(0, 0) ).x(); double border = border50 - border0; double headerHeight = getFrameNameHeight(); QPointF scenePos(bbox.x() - border, bbox.y() - border); setPos( mapToParent( mapFromScene(scenePos) ) ); resize(bbox.width() + 2 * border, bbox.height() + 2 * border - headerHeight); }