Stream: new members

Topic: mged


view this post on Zulip Sean (Apr 09 2019 at 02:26):

I'm looking into MGED now
I have noticed that when you enter a commands in the Command Window, some commands (like rtarea) does the execution by merely running an executable file in the bin directory while some commands (like make) are built into the program.

Yes, a few complex commands invoke an external application, but they are the minority -- rt, rtarea, and rtweight come to mind. Most commands are invoked directly via a ged_[command]() function.

One thing I did not understand is how do the 2 windows (Command Window(CW) and Graphics window(GW)) communicate?

They communicate with each other via the Tcl interpreter. The main application is running a Tcl interpreter which receives keyboard inputs in the CW, for example. When a command is typed in the CW and enter is pressed, Tcl takes that string and calls the corresponding code. That is typically a function in src/libged which runs, possibly writes messages to the CW or updates to the GW and returns a result back to Tcl.

Is there an actual communication happening within the process ? Or does the GW merely display the latest .g file (in which case CW executes the command changing the state of the .g file, and GW reads the new state and adjusts itself accordingly)?
Or does the 3d model exists in the memory that is accessible by both GW and CW?

The latter. The 3d model resides in memory, see src/mged code, and functions in src/libged can cause things int he GW and CW be updated.


Last updated: Jan 10 2025 at 00:48 UTC