MCPcopy Create free account
hub / github.com/MrKepzie/Natron / initialize

Method initialize

Gui/NodeGui.cpp:213–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void
214NodeGui::initialize(NodeGraph* dag,
215 const NodePtr & internalNode)
216{
217 _internalNode = internalNode;
218 assert(internalNode);
219 _graph = dag;
220
221 NodeGuiPtr thisAsShared = shared_from_this();
222
223 internalNode->setNodeGuiPointer(thisAsShared);
224
225 QObject::connect( internalNode.get(), SIGNAL(labelChanged(QString)), this, SLOT(onInternalNameChanged(QString)) );
226 QObject::connect( internalNode.get(), SIGNAL(refreshEdgesGUI()), this, SLOT(refreshEdges()) );
227 QObject::connect( internalNode.get(), SIGNAL(knobsInitialized()), this, SLOT(initializeKnobs()) );
228 QObject::connect( internalNode.get(), SIGNAL(inputsInitialized()), this, SLOT(initializeInputs()) );
229 QObject::connect( internalNode.get(), SIGNAL(previewImageChanged(double)), this, SLOT(updatePreviewImage(double)) );
230 QObject::connect( internalNode.get(), SIGNAL(previewRefreshRequested(double)), this, SLOT(forceComputePreview(double)) );
231 QObject::connect( internalNode.get(), SIGNAL(deactivated(bool)), this, SLOT(deactivate(bool)) );
232 QObject::connect( internalNode.get(), SIGNAL(activated(bool)), this, SLOT(activate(bool)) );
233 QObject::connect( internalNode.get(), SIGNAL(inputChanged(int)), this, SLOT(connectEdge(int)) );
234 QObject::connect( internalNode.get(), SIGNAL(persistentMessageChanged()), this, SLOT(onPersistentMessageChanged()) );
235 QObject::connect( internalNode.get(), SIGNAL(allKnobsSlaved(bool)), this, SLOT(onAllKnobsSlaved(bool)) );
236 QObject::connect( internalNode.get(), SIGNAL(knobsLinksChanged()), this, SLOT(onKnobsLinksChanged()) );
237 QObject::connect( internalNode.get(), SIGNAL(outputsChanged()), this, SLOT(refreshOutputEdgeVisibility()) );
238 QObject::connect( internalNode.get(), SIGNAL(previewKnobToggled()), this, SLOT(onPreviewKnobToggled()) );
239 QObject::connect( internalNode.get(), SIGNAL(disabledKnobToggled(bool)), this, SLOT(onDisabledKnobToggled(bool)) );
240 QObject::connect( internalNode.get(), SIGNAL(streamWarningsChanged()), this, SLOT(onStreamWarningsChanged()) );
241 QObject::connect( internalNode.get(), SIGNAL(nodeExtraLabelChanged(QString)), this, SLOT(onNodeExtraLabelChanged(QString)) );
242 QObject::connect( internalNode.get(), SIGNAL(outputLayerChanged()), this, SLOT(onOutputLayerChanged()) );
243 QObject::connect( internalNode.get(), SIGNAL(hideInputsKnobChanged(bool)), this, SLOT(onHideInputsKnobValueChanged(bool)) );
244 QObject::connect( internalNode.get(), SIGNAL(availableViewsChanged()), this, SLOT(onAvailableViewsChanged()) );
245 QObject::connect( internalNode.get(), SIGNAL(rightClickMenuKnobPopulated()), this, SLOT(onRightClickMenuKnobPopulated()) );
246 QObject::connect( internalNode.get(), SIGNAL(inputEdgeLabelChanged(int, QString)), this, SLOT(onInputLabelChanged(int,QString)) );
247 QObject::connect( internalNode.get(), SIGNAL(inputVisibilityChanged(int)), this, SLOT(onInputVisibilityChanged(int)) );
248 QObject::connect( this, SIGNAL(previewImageComputed()), this, SLOT(onPreviewImageComputed()) );
249 setCacheMode(DeviceCoordinateCache);
250
251 OutputEffectInstance* isOutput = dynamic_cast<OutputEffectInstance*>( internalNode->getEffectInstance().get() );
252 if (isOutput) {
253 QObject::connect ( isOutput->getRenderEngine().get(), SIGNAL(refreshAllKnobs()), _graph, SLOT(refreshAllKnobsGui()) );
254 }
255
256 InspectorNode* isInspector = dynamic_cast<InspectorNode*>( internalNode.get() );
257 if (isInspector) {
258 QObject::connect( isInspector, SIGNAL(refreshOptionalState()), this, SLOT(refreshDashedStateOfEdges()) );
259 }
260
261 createGui();
262
263 NodePtr parent = internalNode->getParentMultiInstance();
264 if (parent) {
265 boost::shared_ptr<NodeGuiI> parentNodeGui_i = parent->getNodeGui();
266 NodeGui* parentGui = dynamic_cast<NodeGui*>( parentNodeGui_i.get() );
267 assert(parentGui);
268 if ( parentGui && parentGui->isSettingsPanelVisible() ) {
269 ensurePanelCreated();
270 boost::shared_ptr<MultiInstancePanel> panel = parentGui->getMultiInstancePanel();

Callers 1

serializeMethod · 0.45

Calls 15

setNodeGuiPointerMethod · 0.80
getEffectInstanceMethod · 0.80
onChildCreatedMethod · 0.80
makePreviewByDefaultMethod · 0.80
emptyMethod · 0.80
getNodeByNameMethod · 0.80
getNodeFunction · 0.70
resizeFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected