MCPcopy Create free account
hub / github.com/c3d/tao3D / reloadProgram

Method reloadProgram

tao/widget.cpp:4317–4347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4315
4316
4317void Widget::reloadProgram(XL::Tree *newProg)
4318// ----------------------------------------------------------------------------
4319// Set the program to reload
4320// ----------------------------------------------------------------------------
4321{
4322 if (sourceChanged())
4323 return;
4324
4325 if (!newProg)
4326 {
4327 // We want to force a clone so that we recompile everything
4328 normalizeProgram();
4329 }
4330
4331 // Check if we can simply change some parameters in the tree
4332 else if (Tree *prog = xlProgram->tree)
4333 {
4334 ApplyChanges changes(newProg);
4335 if (!prog->Do(changes))
4336 {
4337 // Need a big hammer, i.e. reload the complete program
4338 newProg->SetSymbols(prog->Symbols());
4339 xlProgram->tree = newProg;
4340 }
4341 }
4342
4343 // Now update the window
4344 updateProgramSource();
4345 refreshNow();
4346 clearErrors();
4347}
4348
4349
4350void Widget::updateProgramSource(bool notWhenHidden)

Callers 3

consolidateMethod · 0.80
ValidateMethod · 0.80

Calls 1

DoMethod · 0.45

Tested by

no test coverage detected