On 05/31/2012 04:08 PM, crdueck wrote: > hello, > > I've written some volume and surface area functions dealing with > primitives that I want to make available to MGED. In particular, the > analyze commands from libged/analyze should be able to use these > functions, but i was also thinking that making them available as stand > alone functions could be useful as well. Usage would simply be > something like: > "vol sph1.sph" --> "volume sph1.sph: 4.00 cm^3" > > in any case, I've seen that MGED uses function tables to store its > commands. I've seen one example of an actual table in animedit to > store joint commands and function tables being used in mged/cmd.c but > I'm still a bit unclear on how they are used. Could someone please > explain how to make new functions available using these tables? > > thanks, > chris > taking a look at primitives/xxx.c, which contains instructions for adding a new primitive to BRLCAD, i found that the rt_functab for each primitive is in primitives/table.c and the definition for the struct rt_functab is in raytrace.h (i believe sean had already told me this).
So I just want to make sure I have everything understood. To add new functions for a primitive I need to: - update the rt_functab definition in raytrace.h with new function pointers - update the entry for the primitive in table.c with the new functions is that all thats needed to make the new function accessible to the libs in mged and libged? ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel