Giter Club home page Giter Club logo

Comments (3)

geringsj avatar geringsj commented on September 27, 2024

Some context from perspective of the MegaMolGraph:

The graph creates modules with the requested ID, including group namespaces, pretty much verbatim (https://github.com/UniStuttgart-VISUS/megamol/blob/master/core/src/MegaMolGraph.cpp#L597). Currently, not even a check for duplicate names is performed. There is no inherent problem for the graph if multiple modules with the same name exist, except that lookup and graph manipulation of these modules will result in undefined behaviour (i.e., 'the user providing the broken graph is to blame'). Multiple modules with the same name will result in distinct entries in the internal std::vector holding modules.

However, since lookup of modules is implemented as sequential search in a std::vector (https://github.com/UniStuttgart-VISUS/megamol/blob/master/core/src/MegaMolGraph.cpp#L526-L530), only the first module with a given name will be found.
This is what happens when deleting modules (https://github.com/UniStuttgart-VISUS/megamol/blob/master/core/src/MegaMolGraph.cpp#L792-L794).

Deleting the module in the group deletes both

The question is: how are you deleting the module in question? Via the GUI? Using Lua? The module deletion code in the graph can only delete one module per deletion request.

If names must be unique over several groups, this is at least something already the loader should check and throw an exception on loading the project

There are different ideas what the project loader should do (load the whole project despite errors -vs.- refuse to instantiate faulty project files).
When executing a .lua project file the lua interpreter can not look ahead to check for such errors. (Neither should the interpreter surpress execution errors and simply continue executing the .lua script) Building a model of the contents of a lua project file before executing it, to catch errors like multiple modules with the same name, ends up being the same thing as instantiating the graph from the project file.

from megamol.

moritz-h avatar moritz-h commented on September 27, 2024

The graph creates modules with the requested ID, including group namespaces

That sounds good from a user perspective that only the combination namespace and module name must be unique and not module name only.

The question is: how are you deleting the module in question? Via the GUI? Using Lua? The module deletion code in the graph can only delete one module per deletion request.

Configurator in the GUI

the lua interpreter can not look ahead to check for such errors.

I am simply meaning something like, when executing mmCreateModule, just not create the module like if any other module creation error would happen, print an error that the module cannot be created, because the name is already in use, and then just continue. This would be way better, than creating the graph anyway, but then strange things happens on graph manipulation later on.

from megamol.

braunms avatar braunms commented on September 27, 2024

There is some related bug when deleting a module in the Configurator that will be fixed with PR #1221. But this is not the root of this problem.

FYI: When deleting a module, MegaMol breaks when trying to delete the call:

std::for_each(discard_calls.begin(), discard_calls.end(), [&](auto const& call_it) {

from megamol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.