Comments (20)
@tpaviot I think I know, why the downcasting is not working anymore.
Under the hood, swig manages all references to objects via their handles. When downcasting one object to another type, we were exploiting the inheritance chain of the handles. For example Handle(Geom_BSplineCurve) is inherited from Handle(Geom_Curve). Swig uses the inheritance type information to check, what handle types are allowed for the downcasting arguments.
In OCCT 7, handles are standalone classes that don't use inheritance. Still, Geom_BSplineCurve is inherited from Geom_Curve, but their handles aren't. This is the reason, why swig does not accept anything else for downcasting other than Handle_Standard_Transients!
We need to make swig aware of the underlying inheritance chain of the non-handle objects. I suppose, we ca use the typecheck typemaps of swig somehow.
from pythonocc-generator.
@rainman110 No, it's this line:
typedef opencascade::handle <Standard_Transient> Handle_Standard_Transient;
If I remove it, everything goes right. It appeared after a change to generate_wrapper.py
I really have difficulties to work with SWIG warnings. They're not documented, not easy to know what to do to avoid them.
from pythonocc-generator.
awesome work. moving forward do you intend to keep OCE up-to-date or are you planning on just using the OCCT releases?
from pythonocc-generator.
A screenshot including an AIS_Manipulator
WOW! That's wonderful! So eager to delve into the generalized fused goodness!
from pythonocc-generator.
Wow... Great progress! Congratulations for this achievement.
@tpaviot I'll have a look at the handle wrapper and try to fix downcasting. I suppose, we just need some small adaptations.
from pythonocc-generator.
@trelau I plan to keep OCE up to date
Thank you @rainman110 maybe you should read the migration guide that contains information about handles https://dev.opencascade.org/doc/overview/html/occt_dev_guides__upgrade.html#upgrade_700
from pythonocc-generator.
I think a narrowed down the problem and have a potential fix.
@tpaviot I cannot completely build you branch 7.x. There are still a couple of errors ( i am building on windows). So, can you already build it completely with your generated files?
from pythonocc-generator.
@rainman110 I only tested on Linux so far, still did not try on Windows. Usually, Windows comes with its bunch of compilation errors, and I have to remove failing classes/methods from the Modules.py file. There are much less differences between Linux and osx
from pythonocc-generator.
@tpaviot I found one of the main culprits! In Standard.i you define
/* rttiext only ojects wrapped as handles */
%define Handle_Standard_Persistent Handle(Standard_Persistent)
%enddef
typedef Standard_Persistent Standard_Transient;
/* end rttiext only declaration */
This breaks the whole inheritance chain, such that Standard_Transient becomes defacto unknown for all deriving classes. This on the other hand breaks DownCasting.
I really suggest turning the swig warnings on for development since then it is much more clear, what is going on. With the default settings, all these valuable informations are hidden.
from pythonocc-generator.
@tpaviot Really? Everything works?
Then, windows is still an issue. Here we have the problem, that Handle(Something) is a different class than Handle_Something and swig won't convert between them right now. This is a visual c only thing and intended by the occt devs (see standard_handle.hxx). I am still looking into this.
from pythonocc-generator.
ok I see, indeed Handle(Class)
and Handle_* are different for msvc
from pythonocc-generator.
I really have difficulties to work with SWIG warnings. They're not documented, not easy to know what to do to avoid them
Would it be straightfwd that the warnings bubble up depending on a environment variable?
from pythonocc-generator.
@tpaviot great work! Can't wait to try it out.
from pythonocc-generator.
@rainman110 I updated both the generator and the wrapper, in a simpler way. There's no need to modify the OccHandle.i script anymore, and Downcasting works as expected (on Linux)
from pythonocc-generator.
@tpaviot Great! Well done.
I'll see, what I can do for Windows. Unfortunately, It might take a while until I find the time.
from pythonocc-generator.
@tpaviot Can you please commit the changed code to pythonocc-core to branch wip/occt7x-support?
from pythonocc-generator.
@rainman110 I already did it. I use to push -force to this branch. fetch your local copy and reset the wip/occtx-support to origin/wip/occt7x-support to have latest changes.
from pythonocc-generator.
@tpaviot Ah okay... did not see that!
from pythonocc-generator.
Any update on this?
from pythonocc-generator.
Outdated. pythonocc-core now targets opencascade 7.4.0
from pythonocc-generator.
Related Issues (20)
- Improvement: Make runtime issues to compile time errors HOT 1
- OCCT 7.4.0: Missing package XCAFNoteObjects HOT 1
- OCCT 7.4.0: Missing package IGESToBRep
- Bug: Wrong position of %wrap_handle HOT 7
- OCCT 7.4.0: Missing package MoniTool HOT 1
- OCCT 7.4.0: Missing package IMeshTools and IMeshData HOT 1
- OCCT 7.4.0: No handle detected for class BRepMesh_DataStructureOfDelaun HOT 2
- OCCT 7.4.0: No handle detected for class BRepMesh_VertexTool HOT 2
- Update correct module dependecies HOT 11
- Missing TopoDS_Shape constructor HOT 3
- OCCT 7.4.0: BRepMesh_Delaun.hxx must be first BRepMesh header file HOT 9
- OCCT 7.4.0: Fix windows compilation again HOT 1
- OCCT 7.4.0: BRepAlgoAPI must import BRepBuilderAPI HOT 15
- Remove operating system header information in wrapper files HOT 1
- OCCT 7.4.0: Missing function TDF_Labl::FindAttribute
- OCCT 7.4.0: TDF_Tool is empty HOT 1
- Make a clean wrapper for Standard_OStream&
- Reuse potential HOT 1
- Bindings for OCCT 7.6 HOT 17
- C# Generator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonocc-generator.