Stream: brlcad

Topic: libbv


view this post on Zulip Sean (Nov 11 2022 at 17:28):

@starseeker can you provide an example how to get at ged_exec(gqa..) plot data using libbv (or otherwise)?

view this post on Zulip Sean (Nov 11 2022 at 17:29):

The -Ap option appears to fill in some data structures but I'm not seeing how that's supposed to get back to the caller or if there's a way to register a callback so I can do something else with the vlist data.

view this post on Zulip starseeker (Nov 11 2022 at 19:29):

In the main gqa command, the logic flow for getting the data into the scene is _ged_cvt_vlblock_to_solids on gqa.cpp:2725

view this post on Zulip starseeker (Nov 11 2022 at 19:30):

_ged_cvt_vlblock_to_solids in turn calls invent_solid

view this post on Zulip starseeker (Nov 11 2022 at 19:33):

The actual vlist data ends up in gedp->ged_gdp->gd_headDisplay

view this post on Zulip starseeker (Nov 11 2022 at 19:35):

I think in the current setup you'd have to iterate through gd_headDisplay's dl_head_scene_obj list to find it

view this post on Zulip starseeker (Nov 11 2022 at 19:36):

There should be a bv_scene_obj with the data in question

view this post on Zulip starseeker (Nov 11 2022 at 19:48):

Unfortunately I don't think the current drawing code path stores the name in the scene object - invent_solid uses a phony db_diradd to handle the name

view this post on Zulip Sean (Nov 11 2022 at 19:57):

I don't think they need the name, or at least I think that can probably be managed by re-shooting with just the overlapping pair.

view this post on Zulip Sean (Nov 11 2022 at 19:57):

Do you think you could whip up a main() for them showing how to access it?

view this post on Zulip starseeker (Nov 12 2022 at 02:32):

https://github.com/BRL-CAD/brlcad/commit/9fa7d464d5e5a0d7802cb652de2b0c54c18771b9

view this post on Zulip starseeker (Nov 12 2022 at 02:32):

Is that what you had in mind?

view this post on Zulip starseeker (Nov 12 2022 at 03:48):

(btw, to run it after a build to generate the plot file, it's src/libged/tests/ged_test_gqa ../src/libged/tests/ged_tests.g)

view this post on Zulip Sean (Nov 15 2022 at 06:57):

starseeker said:

Is that what you had in mind?

Indeed! I'll see if this does the trick.

view this post on Zulip Sean (Nov 15 2022 at 07:00):

On a related note -- how feasible would it be to use bu_process to invoke "mged -c gqa" (for example), and then call bu_terminate to stop it mid-processing? Would that work? I'm not looking to do that but was curious if it should work. Would be an interesting use case.

view this post on Zulip starseeker (Nov 15 2022 at 17:14):

Hmm. Good question - in principle that might be possible. It'd essentially be a variation on what we'll probably end up doing eventually for GED plugins we can stop.


Last updated: Oct 09 2024 at 00:44 UTC