SFML community forums

General => Feature requests => Topic started by: Power on March 30, 2020, 10:53:35 pm

Title: Full UML Class Diagram for SFML?
Post by: Power on March 30, 2020, 10:53:35 pm
Hello,
While i am browsing the SFML documentation, i can stumble on little diagrams showing which class inhetit who (like here : https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1CircleShape.php).
I also found myself rewriting all this information on paper and trying to have a full view on all the available functions available.

I wondered if there was a full diagramm class showing all the inheritance between all classes? To have a place where you can click on any class at one glance.
Title: Re: Full UML Class Diagram for SFML?
Post by: eXpl0it3r on March 31, 2020, 06:36:46 pm
Doxygen (http://www.doxygen.nl/), which is used to generate the SFML documentation, has some additional options for generating graphs. I don't think we really need anything more to what is already out there, but feel free to play around with it locally. There are also many other tools that can generate graphs from source code.
Title: Re: Full UML Class Diagram for SFML?
Post by: Power on March 31, 2020, 09:28:28 pm
Looks great, i did not know this tool, i am saving the name.

eXpl0it3r: It's almost like what you described, i saw a few examples on youtube, and it seems to be the right tool.
 
Here is what i was imagining though (image attached)
Title: Re: Full UML Class Diagram for SFML?
Post by: eXpl0it3r on April 01, 2020, 07:10:17 pm
Well the thing is that "modules" is more an artificial thing than an actual C++ term (maybe once we get C++ modules in C++22 (?) it may change).

I'd argue that what we have already is more useful than a big diagram that has everything on it.
If you want to see all the module related classes, you can pick a module in the Modules tab (https://www.sfml-dev.org/documentation/2.5.1/modules.php).

(https://i.imgur.com/8fxx9Yv.png)

The inheritance class diagram already shows you all the connection with clickable links to the other classes. There are no additional inheritances to be shown. Plus you can easily navigate to the module it's in and see other classes.

(https://i.imgur.com/gBxdDBf.png)

And finally if you run doxygen yourself, you can also get some additional diagrams, like an inheritance page that shows all the classes and their full dependencies.

(https://i.imgur.com/biq3cb8.png)

Or call and caller graphs for each function, but that shows too much internal detail that you should not worry about as a API consumer.

(https://i.imgur.com/TYvbbit.png)
Title: Re: Full UML Class Diagram for SFML?
Post by: Power on April 09, 2020, 03:22:17 pm
Oh i see you have done it yourself, and have used the doxygen tool? Sorry i hadnt seen your answer before,

As for the modules not being real things, yes i figured it out quickly, when i was "drawing" and writing everything on a piece of paper. And yes i know i dont have to know all the details, but in reality it helps me. The more i know the more "expanded" and "rooted" can your brain be, i like to have an image of everything rather than wondering if "KeyEvent" or "Keyboard" are related or not.

Thanks a bunch