what does scene.cpp do?

Asked by lip on 2019-05-24

hello
i am reading the souece code of yade, and a file named scene.cpp, what does this file do?
look forward for you answer

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2019-05-26
Last reply:
2019-06-02

This question was reopened

  • 2019-05-26 by lip

Hi,
It implements the class Scene.
Bruno

lip (mr.xie) said : #2

thank you for your answer, but what i want to kow is what does class Scene do, look forward for you answer.
by the way, when i read polyhedra_ig2.cpp, i found a class named Se3r used in the code, but i can not found which file defined this class, so i do not know what this class meaning too, would you please tell me that where can i found the file?

You need to find a convenient navigation tool.
If you have no experience in command line tools like vim I would suggest kdevelop.
Therein you have search boxes and other methods to navigate in the source code and see where something is defined (e.g. right click->go to definition).
Bruno

Jan Stránský (honzik) said : #4

Scene represents "simulation". Contains bodies, interactions, materials, force, engines... also have moveToNextStep method... see core/Scene.hpp for more details.

In Python, most of O.something calls are actually internally redirected to current Scene instance [1], note the OMEGA.getScene()->something

cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/blob/master/py/wrapper/yadeWrapper.cpp#L599

Jan Stránský (honzik) said : #5

Concerning the searching, you can also use command line tools like grep:

cd /path/to/yade/directory
grep -R "class.*PolyhedraPhys"
grep -R "typedef.*stateVector"
grep -R "using.*Se3r"

.* means any number of any symbols in regular expression
most Yade objects are (in C++) defined with keywords class, typedef or using.

cheers
Jan

lip (mr.xie) said : #6

Thanks Jan Stránský, that solved my question.

lip (mr.xie) said : #7

hello,Bruno:
i have installed Kdevelop in my ubuntu, i import the whole trunk file in to Kdevelop through a button in the left part of the software desktop, i can only read one cpp file but can not navigate to the class defined in the other cpp files, would please tell me how can i acheieve the navigate function through this software?

Robert Caulk (rcaulk) said : #8

In Kdevelop, you need to Open/Import project (upper left under Project drop down) the entire set of folders (build, install, trunk.

After letting Kdevelop index the source files, you will find a tab on the left called "Classes". Here you can right click on any class and "jump to declaration".

Can you help with this problem?

Provide an answer of your own, or ask lip for more information if necessary.

To post a message you must log in.