GithubHelp home page GithubHelp logo

Comments (15)

rainman110 avatar rainman110 commented on May 27, 2024

Is there are way to hard-code this dependency?

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

@tpaviot Fixed this in the generator. Just need a regeneration.

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

@rainman110 I'm not comfortable with this fix. The issue is that the BRepAlgoAPI_Algo class has 2 ancestors, and is skipped by the wrapper. I prefer thinking about a fix related to multiple inheritance.

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

Sure... I prefer also a more general solution

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

What about this: The main issue wrt to multiple inheritance is to get the "right" order.

From a computer scientist point of view, the dependencies form a directed acyclic graph (DAG). What we need then, is a topological sort of this dag such that a class is defined before it is referenced first.

Instead of sorting on our own, we can use something like this:
https://pypi.org/project/toposort/

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

I have made a working proof of concept!

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

@rainman110 Something similar is already implemented in the generator. No "DAG" or "topological sort" but a kind of. It's in the build_inheritance_tree see https://github.com/tpaviot/pythonocc-generator/blob/master/src/generate_wrapper.py#L1212

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

I have seen it already! This is limited on single inheritance though, right? I replaced most of this code with toposort and it works really nice.

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

I also have a fix, adding only a few more lines. If we can do the same without any additional dependency, it's better.

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

No problem. I found a new problem though in the cppparser itself. It cannot parse correctly the class BOPTools_BoxSelector due to the list in the template arguments.

I opened up an issue at CppHeaderParser:
robotpy/robotpy-cppheaderparser#27

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

opencascade mostly uses single inheritance, only about ten to twenty classes have 2 ancestors.

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

I applied the fix, regenerating the swig files, compilation is building. I'll push when I'm sure everythong compiles

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

interface files were also updated

from pythonocc-generator.

tpaviot avatar tpaviot commented on May 27, 2024

@rainman110 I see the issue you opened on the robotpy/cppheaderparser repository, good point. It's a good news that this package was forked and is maintained by another dev team. Although it suffers from many drawbacks and lacks, it's currently the best tool I found to be used by the pythonocc generator. I started with gccxml 10 years ago, it was more than one hour to parse every occ headers. Now it's only 20s on my machine. That's the most important point : be quick. There are so many generation/compilation necessary when updating to another occ release, that's it's simply undoable without such a fast tool.

from pythonocc-generator.

rainman110 avatar rainman110 commented on May 27, 2024

Is fixed by b979afb

from pythonocc-generator.

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.