Fooling around with FreeCAD Source and OCC
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Fooling around with FreeCAD Source and OCC
This thread will be a place where i dump information about things i find while looking at open cascade visualization and how 3d views are currently rendered.
Initially I played around a bit with QT/open cascade visualization. I have created this fork of a OCC/QT project to be used as a sandbox:
https://github.com/maidenone/occQt
I have briefly gone through this documentation:
https://dev.opencascade.org/doc/overvie ... ation.html
I have also spent way to much time trying to generate dependency graphs of the FreeCAD code base..
I used: https://www.flourish.org/cinclude2dot/ to generate the dot file of all "#include" dependencies between all files, some reference errors where reported, so this is not complete. I configured it to merge "file.c" and "file.h" into "file" to reduce the complexity. It still took more then an hour to render the SVG. I found that viewing with eog (image viewer) is better then google-chrome due to zoom limit..
Still way to complex to follow the lines, but it looks cool. Fullsize (~12Mb) https://drive.google.com/file/d/1yyGnzd ... sp=sharing
I also tried https://github.com/tomtom-international ... pendencies and got this:
https://drive.google.com/file/d/1eE-r6e ... sp=sharing
https://drive.google.com/file/d/1YKMFTs ... sp=sharing
But those are not detailed enough for me. maybe i misconfigured it..
Initially I played around a bit with QT/open cascade visualization. I have created this fork of a OCC/QT project to be used as a sandbox:
https://github.com/maidenone/occQt
I have briefly gone through this documentation:
https://dev.opencascade.org/doc/overvie ... ation.html
I have also spent way to much time trying to generate dependency graphs of the FreeCAD code base..
I used: https://www.flourish.org/cinclude2dot/ to generate the dot file of all "#include" dependencies between all files, some reference errors where reported, so this is not complete. I configured it to merge "file.c" and "file.h" into "file" to reduce the complexity. It still took more then an hour to render the SVG. I found that viewing with eog (image viewer) is better then google-chrome due to zoom limit..
Still way to complex to follow the lines, but it looks cool. Fullsize (~12Mb) https://drive.google.com/file/d/1yyGnzd ... sp=sharing
I also tried https://github.com/tomtom-international ... pendencies and got this:
https://drive.google.com/file/d/1eE-r6e ... sp=sharing
https://drive.google.com/file/d/1YKMFTs ... sp=sharing
But those are not detailed enough for me. maybe i misconfigured it..
- Attachments
-
- source.dot
- (585.6 KiB) Downloaded 40 times
Last edited by fosselius on Tue Mar 26, 2019 11:38 pm, edited 1 time in total.
Re: Fooling around with FreeCAD Source and OCC
I found that Quarter is the Coin3D -> QT library that i should start looking at in the FreeCAD code, extracting a subset from dependency graph above with:
Results in the following graph:
Where QuaterWidget is the widget where 3d graphics is rendered.
From Quater.cpp:
Now this is more in line with what i expected:
Summery of today's activities:
checked out FreeCAD code, installed dependancies and built (QT4, Py2, OCE....)
downloaded OCC and compiled
generated graphs
read OCC documentation
started reading through Quarter code / integration
forked https://github.com/eryar/occQt, resolved build issues, (built for QT5, OCC) started playing with event handler.
Code: Select all
head source.dot -n 7 > test.dot
cat source.dot | grep Quarter >> test.dot
echo "}" >> test.dot
neato -Tpng test.dot -o test.png
From Quater.cpp:
Now, part of the code we are interested in are named Inventor, lets add that to our grep:Quarter is a light-weight glue library that provides seamless
integration between Systems in Motions's \COIN high-level 3D
visualization library and Trolltech's \QT 2D user interface
library.
\QT and \COIN is a perfect match since they are both open source,
widely portable and easy to use. Quarter has evolved from Systems in
Motion's own experiences using \COIN and \QT together in our
applications.
The functionality in Quarter revolves around QuarterWidget, a
subclass of QGLWidget. This widget provides functionality for
rendering of Coin scenegraphs and translation of QEvents into
SoEvents. Using this widget is as easy as using any other QWidget.
Code: Select all
<same as above>
cat source.dot | grep -E 'Inventor|Quarter' >> test2.dot
<same as above>
neato -Tpng -Goverlap=false -Gsplines=true test2.dot -o test2.png
checked out FreeCAD code, installed dependancies and built (QT4, Py2, OCE....)
downloaded OCC and compiled
generated graphs
read OCC documentation
started reading through Quarter code / integration
forked https://github.com/eryar/occQt, resolved build issues, (built for QT5, OCC) started playing with event handler.
-
- Posts: 656
- Joined: Tue May 19, 2015 1:11 am
Re: Fooling around with FreeCAD Source and OCC
Not sure if you're aware, but if you `make DevDoc` in the freecad build directory, it will generate the Doxygen documentation which includes dependency graphs for the various freecad components. This has been helpful for me in terms of seem how the code is structured.
Mod/Part/App/TopoShape.cpp is a decent place to start.
Mod/Part/App/TopoShape.cpp is a decent place to start.
Re: Fooling around with FreeCAD Source and OCC
yes i know, but i wanted an overview, doxygen dependancy graphs is great for the local scope.
my goal is to identify every source/header file that have dependency on coin3d (including pivy for python), so the scope is quite big...
Here is the DevDoc i built today:
http://foss.site:8080/fc/da/da1/TopoShape_8h.html
compared to:
https://www.freecadweb.org/api/d8/ded/c ... Shape.html (how is this documentation generated?)
my goal is to identify every source/header file that have dependency on coin3d (including pivy for python), so the scope is quite big...
thank you, I will take a closer look tomorrow, any input is greatly valued.ezzieyguywuf wrote: ↑Wed Mar 27, 2019 3:03 am Mod/Part/App/TopoShape.cpp is a decent place to start.
Here is the DevDoc i built today:
http://foss.site:8080/fc/da/da1/TopoShape_8h.html
compared to:
https://www.freecadweb.org/api/d8/ded/c ... Shape.html (how is this documentation generated?)
-
- Posts: 656
- Joined: Tue May 19, 2015 1:11 am
Re: Fooling around with FreeCAD Source and OCC
since your interest in more on the Coin3d stuff, I would instead start at Mod/Part/Gui/ViewProvider. h, which describes how a Part:Toposhape is rendered using Coin3d.
Re: Fooling around with FreeCAD Source and OCC
I just stumbled onto this. The web documentation is a reduced version of the full documentation.fosselius wrote: ↑Wed Mar 27, 2019 4:44 am ...
https://www.freecadweb.org/api/d8/ded/c ... Shape.html (how is this documentation generated?)
Code: Select all
make DevDoc # full, around 5GB
make WebDoc # reduced, around 0.6 GB
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Fooling around with FreeCAD Source and OCC
Forgot about this cool thread. Very cool. need to bookmark this.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Fooling around with FreeCAD Source and OCC
haha, Typically me, starting a project then changing focus within 10 minutes only to forget what i was doing a week later..
Re: Fooling around with FreeCAD Source and OCC
This
(I can relate)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs