Revision: 76466 http://sourceforge.net/p/brlcad/code/76466 Author: starseeker Date: 2020-07-24 14:39:33 +0000 (Fri, 24 Jul 2020) Log Message: ----------- Merge gedplugins branch into trunk.
Modified Paths: -------------- brlcad/trunk/include/ged/commands.h brlcad/trunk/include/ged/defines.h brlcad/trunk/regress/CMakeLists.txt brlcad/trunk/src/gtools/gsh.cpp brlcad/trunk/src/libged/3ptarb/3ptarb.c brlcad/trunk/src/libged/CMakeLists.txt brlcad/trunk/src/libged/adc/adc.c brlcad/trunk/src/libged/adjust/adjust.c brlcad/trunk/src/libged/ae2dir/ae2dir.c brlcad/trunk/src/libged/analyze/analyze.c brlcad/trunk/src/libged/annotate/annotate.c brlcad/trunk/src/libged/arb/arb.c brlcad/trunk/src/libged/arced/arced.c brlcad/trunk/src/libged/arot/arot.c brlcad/trunk/src/libged/attr/attr.cpp brlcad/trunk/src/libged/autoview/autoview.c brlcad/trunk/src/libged/bb/bb.c brlcad/trunk/src/libged/bev/bev.c brlcad/trunk/src/libged/bigE/bigE.c brlcad/trunk/src/libged/blast/blast.c brlcad/trunk/src/libged/bo/bo.c brlcad/trunk/src/libged/bot/bot.cpp brlcad/trunk/src/libged/bot/check.cpp brlcad/trunk/src/libged/bot/ged_bot.h brlcad/trunk/src/libged/brep/brep.cpp brlcad/trunk/src/libged/brep/csg.cpp brlcad/trunk/src/libged/brep/ged_brep.h brlcad/trunk/src/libged/brep/plot.cpp brlcad/trunk/src/libged/cat/cat.c brlcad/trunk/src/libged/cc/cc.c brlcad/trunk/src/libged/check/check.c brlcad/trunk/src/libged/check/check_private.h brlcad/trunk/src/libged/clone/clone.c brlcad/trunk/src/libged/coil/coil.c brlcad/trunk/src/libged/color/color.c brlcad/trunk/src/libged/comb/comb.c brlcad/trunk/src/libged/comb_color/comb_color.c brlcad/trunk/src/libged/comb_std/comb_std.c brlcad/trunk/src/libged/combmem/combmem.c brlcad/trunk/src/libged/concat/concat.cpp brlcad/trunk/src/libged/constraint/constraint.c brlcad/trunk/src/libged/copy/copy.c brlcad/trunk/src/libged/copyeval/copyeval.c brlcad/trunk/src/libged/copymat/copymat.c brlcad/trunk/src/libged/cpi/cpi.c brlcad/trunk/src/libged/dag/dag.cpp brlcad/trunk/src/libged/dbip/dbip.c brlcad/trunk/src/libged/debug/debug.cpp brlcad/trunk/src/libged/debugbu/debugbu.c brlcad/trunk/src/libged/debugdir/debugdir.c brlcad/trunk/src/libged/debuglib/debuglib.c brlcad/trunk/src/libged/debugnmg/debugnmg.c brlcad/trunk/src/libged/decompose/decompose.c brlcad/trunk/src/libged/delay/delay.c brlcad/trunk/src/libged/dir2ae/dir2ae.c brlcad/trunk/src/libged/draw/draw.c brlcad/trunk/src/libged/dsp/dsp.c brlcad/trunk/src/libged/dump/dump.c brlcad/trunk/src/libged/dup/dup.c brlcad/trunk/src/libged/eac/eac.c brlcad/trunk/src/libged/echo/echo.c brlcad/trunk/src/libged/edarb/edarb.c brlcad/trunk/src/libged/edcodes/edcodes.c brlcad/trunk/src/libged/edcomb/edcomb.c brlcad/trunk/src/libged/edit/edit.c brlcad/trunk/src/libged/editit/editit.c brlcad/trunk/src/libged/edmater/edmater.c brlcad/trunk/src/libged/env/env.c brlcad/trunk/src/libged/erase/erase.c brlcad/trunk/src/libged/exists/exists.c brlcad/trunk/src/libged/expand/expand.c brlcad/trunk/src/libged/eye_pos/eye_pos.c brlcad/trunk/src/libged/facetize/facetize.cpp brlcad/trunk/src/libged/fb2pix/fb2pix.c brlcad/trunk/src/libged/fbclear/fbclear.c brlcad/trunk/src/libged/find/find.c brlcad/trunk/src/libged/form/form.c brlcad/trunk/src/libged/fracture/fracture.c brlcad/trunk/src/libged/gdiff/gdiff.c brlcad/trunk/src/libged/ged.c brlcad/trunk/src/libged/ged_private.h brlcad/trunk/src/libged/get/get.c brlcad/trunk/src/libged/get_autoview/get_autoview.c brlcad/trunk/src/libged/get_comb/get_comb.c brlcad/trunk/src/libged/get_eyemodel/get_eyemodel.c brlcad/trunk/src/libged/get_type/get_type.c brlcad/trunk/src/libged/glob/glob.c brlcad/trunk/src/libged/gqa/gqa.c brlcad/trunk/src/libged/grid/grid.c brlcad/trunk/src/libged/grid2model_lu/grid2model_lu.c brlcad/trunk/src/libged/grid2view_lu/grid2view_lu.c brlcad/trunk/src/libged/group/group.c brlcad/trunk/src/libged/heal/heal.c brlcad/trunk/src/libged/help/help.cpp brlcad/trunk/src/libged/hide/hide.c brlcad/trunk/src/libged/how/how.c brlcad/trunk/src/libged/human/human.c brlcad/trunk/src/libged/illum/illum.c brlcad/trunk/src/libged/importFg4Section/importFg4Section.c brlcad/trunk/src/libged/inside/inside.c brlcad/trunk/src/libged/instance/instance.c brlcad/trunk/src/libged/isize/isize.c brlcad/trunk/src/libged/item/item.c brlcad/trunk/src/libged/joint/joint.c brlcad/trunk/src/libged/joint/joint.h brlcad/trunk/src/libged/joint2/joint2.c brlcad/trunk/src/libged/keep/keep.c brlcad/trunk/src/libged/keypoint/keypoint.c brlcad/trunk/src/libged/kill/kill.c brlcad/trunk/src/libged/killall/killall.c brlcad/trunk/src/libged/killrefs/killrefs.c brlcad/trunk/src/libged/killtree/killtree.c brlcad/trunk/src/libged/label/label.c brlcad/trunk/src/libged/lc/lc.c brlcad/trunk/src/libged/libfuncs/libfuncs.c brlcad/trunk/src/libged/lint/lint.cpp brlcad/trunk/src/libged/list/list.c brlcad/trunk/src/libged/lod/lod.c brlcad/trunk/src/libged/log/log.c brlcad/trunk/src/libged/lookat/lookat.c brlcad/trunk/src/libged/ls/ls.c brlcad/trunk/src/libged/lt/lt.c brlcad/trunk/src/libged/m2v_point/m2v_point.c brlcad/trunk/src/libged/make/make.c brlcad/trunk/src/libged/make_name/make_name.c brlcad/trunk/src/libged/match/match.c brlcad/trunk/src/libged/mater/mater.cpp brlcad/trunk/src/libged/mirror/mirror.c brlcad/trunk/src/libged/model2grid_lu/model2grid_lu.c brlcad/trunk/src/libged/model2view/model2view.c brlcad/trunk/src/libged/model2view_lu/model2view_lu.c brlcad/trunk/src/libged/move/move.c brlcad/trunk/src/libged/move_all/move_all.c brlcad/trunk/src/libged/move_arb_edge/move_arb_edge.c brlcad/trunk/src/libged/move_arb_face/move_arb_face.c brlcad/trunk/src/libged/mrot/mrot.c brlcad/trunk/src/libged/nirt/nirt.c brlcad/trunk/src/libged/nmg/nmg.c brlcad/trunk/src/libged/ocenter/ocenter.c brlcad/trunk/src/libged/open/open.c brlcad/trunk/src/libged/orient/orient.c brlcad/trunk/src/libged/orotate/orotate.c brlcad/trunk/src/libged/oscale/oscale.c brlcad/trunk/src/libged/otranslate/otranslate.c brlcad/trunk/src/libged/overlay/overlay.c brlcad/trunk/src/libged/pathlist/pathlist.c brlcad/trunk/src/libged/pathsum/pathsum.c brlcad/trunk/src/libged/perspective/perspective.c brlcad/trunk/src/libged/pix2fb/pix2fb.c brlcad/trunk/src/libged/plot/plot.c brlcad/trunk/src/libged/pmat/pmat.c brlcad/trunk/src/libged/pmodel2view/pmodel2view.c brlcad/trunk/src/libged/png/png.c brlcad/trunk/src/libged/png2fb/png2fb.c brlcad/trunk/src/libged/pnts/pnts.cpp brlcad/trunk/src/libged/pnts_util.h brlcad/trunk/src/libged/prcolor/prcolor.c brlcad/trunk/src/libged/prefix/prefix.c brlcad/trunk/src/libged/process/process.c brlcad/trunk/src/libged/protate/protate.c brlcad/trunk/src/libged/ps/ps.c brlcad/trunk/src/libged/pscale/pscale.c brlcad/trunk/src/libged/pset/pset.c brlcad/trunk/src/libged/ptranslate/ptranslate.c brlcad/trunk/src/libged/pull/pull.c brlcad/trunk/src/libged/push/push.c brlcad/trunk/src/libged/put/put.c brlcad/trunk/src/libged/put_comb/put_comb.c brlcad/trunk/src/libged/putmat/putmat.c brlcad/trunk/src/libged/qray/qray.c brlcad/trunk/src/libged/qray.h brlcad/trunk/src/libged/qvrot/qvrot.c brlcad/trunk/src/libged/rcodes/rcodes.c brlcad/trunk/src/libged/rect/rect.c brlcad/trunk/src/libged/red/red.c brlcad/trunk/src/libged/regdef/regdef.c brlcad/trunk/src/libged/region/region.c brlcad/trunk/src/libged/remove/remove.c brlcad/trunk/src/libged/rfarb/rfarb.c brlcad/trunk/src/libged/rmap/rmap.c brlcad/trunk/src/libged/rmat/rmat.c brlcad/trunk/src/libged/rmater/rmater.c brlcad/trunk/src/libged/rot/rot.c brlcad/trunk/src/libged/rot_point/rot_point.c brlcad/trunk/src/libged/rrt/rrt.c brlcad/trunk/src/libged/rt/rt.c brlcad/trunk/src/libged/rtabort/rtabort.c brlcad/trunk/src/libged/rtcheck/rtcheck.c brlcad/trunk/src/libged/rtwizard/rtwizard.c brlcad/trunk/src/libged/savekey/savekey.c brlcad/trunk/src/libged/saveview/saveview.c brlcad/trunk/src/libged/scale/scale.c brlcad/trunk/src/libged/screengrab/screengrab.c brlcad/trunk/src/libged/search/search.c brlcad/trunk/src/libged/select/select.c brlcad/trunk/src/libged/set_output_script/set_output_script.c brlcad/trunk/src/libged/set_transparency/set_transparency.c brlcad/trunk/src/libged/set_uplotOutputMode/set_uplotOutputMode.c brlcad/trunk/src/libged/setview/setview.c brlcad/trunk/src/libged/shaded_mode/shaded_mode.c brlcad/trunk/src/libged/shader/shader.c brlcad/trunk/src/libged/shells/shells.c brlcad/trunk/src/libged/showmats/showmats.c brlcad/trunk/src/libged/simulate/bullet/CMakeLists.txt brlcad/trunk/src/libged/simulate/ged_command.cpp brlcad/trunk/src/libged/simulate/utility.hpp brlcad/trunk/src/libged/slew/slew.c brlcad/trunk/src/libged/solid_report/solid_report.c brlcad/trunk/src/libged/solids_on_ray/solids_on_ray.c brlcad/trunk/src/libged/sphgroup/sphgroup.c brlcad/trunk/src/libged/summary/summary.c brlcad/trunk/src/libged/sync/sync.c brlcad/trunk/src/libged/tables/tables.c brlcad/trunk/src/libged/tests/CMakeLists.txt brlcad/trunk/src/libged/tire/tire.c brlcad/trunk/src/libged/title/title.c brlcad/trunk/src/libged/tol/tol.c brlcad/trunk/src/libged/tops/tops.c brlcad/trunk/src/libged/tra/tra.c brlcad/trunk/src/libged/track/track.c brlcad/trunk/src/libged/tree/tree.c brlcad/trunk/src/libged/typein/typein.c brlcad/trunk/src/libged/unhide/unhide.c brlcad/trunk/src/libged/units/units.c brlcad/trunk/src/libged/v2m_point/v2m_point.c brlcad/trunk/src/libged/vdraw/vdraw.c brlcad/trunk/src/libged/version/version.c brlcad/trunk/src/libged/view/aet.c brlcad/trunk/src/libged/view/center.cpp brlcad/trunk/src/libged/view/data_lines.c brlcad/trunk/src/libged/view/eye.c brlcad/trunk/src/libged/view/quat.c brlcad/trunk/src/libged/view/size.c brlcad/trunk/src/libged/view/snap.c brlcad/trunk/src/libged/view/view.c brlcad/trunk/src/libged/view/ypr.c brlcad/trunk/src/libged/view2grid_lu/view2grid_lu.c brlcad/trunk/src/libged/view2model/view2model.c brlcad/trunk/src/libged/view2model_lu/view2model_lu.c brlcad/trunk/src/libged/view2model_vec/view2model_vec.c brlcad/trunk/src/libged/viewdir/viewdir.c brlcad/trunk/src/libged/voxelize/voxelize.c brlcad/trunk/src/libged/vrot/vrot.c brlcad/trunk/src/libged/wcodes/wcodes.c brlcad/trunk/src/libged/whatid/whatid.c brlcad/trunk/src/libged/which/which.cpp brlcad/trunk/src/libged/which_shader/which_shader.c brlcad/trunk/src/libged/who/who.c brlcad/trunk/src/libged/wmater/wmater.c brlcad/trunk/src/libged/xpush/xpush.c brlcad/trunk/src/libged/zap/zap.c brlcad/trunk/src/libged/zoom/zoom.c brlcad/trunk/src/libtclcad/CMakeLists.txt Added Paths: ----------- brlcad/trunk/src/libged/3ptarb/CMakeLists.txt brlcad/trunk/src/libged/adc/CMakeLists.txt brlcad/trunk/src/libged/adjust/CMakeLists.txt brlcad/trunk/src/libged/ae2dir/CMakeLists.txt brlcad/trunk/src/libged/analyze/CMakeLists.txt brlcad/trunk/src/libged/annotate/CMakeLists.txt brlcad/trunk/src/libged/arb/CMakeLists.txt brlcad/trunk/src/libged/arb/rotate_arb_face.c brlcad/trunk/src/libged/arced/CMakeLists.txt brlcad/trunk/src/libged/arot/CMakeLists.txt brlcad/trunk/src/libged/attr/CMakeLists.txt brlcad/trunk/src/libged/autoview/CMakeLists.txt brlcad/trunk/src/libged/bb/CMakeLists.txt brlcad/trunk/src/libged/bev/CMakeLists.txt brlcad/trunk/src/libged/bigE/CMakeLists.txt brlcad/trunk/src/libged/blast/CMakeLists.txt brlcad/trunk/src/libged/bo/CMakeLists.txt brlcad/trunk/src/libged/bot/CMakeLists.txt brlcad/trunk/src/libged/bot/bot_condense.c brlcad/trunk/src/libged/bot/bot_decimate.c brlcad/trunk/src/libged/bot/bot_dump.c brlcad/trunk/src/libged/bot/bot_face_fuse.c brlcad/trunk/src/libged/bot/bot_face_sort.c brlcad/trunk/src/libged/bot/bot_flip.c brlcad/trunk/src/libged/bot/bot_fuse.c brlcad/trunk/src/libged/bot/bot_merge.c brlcad/trunk/src/libged/bot/bot_smooth.c brlcad/trunk/src/libged/bot/bot_split.c brlcad/trunk/src/libged/bot/bot_sync.c brlcad/trunk/src/libged/bot/bot_vertex_fuse.c brlcad/trunk/src/libged/bot/edbot.c brlcad/trunk/src/libged/brep/CMakeLists.txt brlcad/trunk/src/libged/cat/CMakeLists.txt brlcad/trunk/src/libged/cc/CMakeLists.txt brlcad/trunk/src/libged/check/CMakeLists.txt brlcad/trunk/src/libged/clone/CMakeLists.txt brlcad/trunk/src/libged/coil/CMakeLists.txt brlcad/trunk/src/libged/color/CMakeLists.txt brlcad/trunk/src/libged/columns.c brlcad/trunk/src/libged/comb/CMakeLists.txt brlcad/trunk/src/libged/comb_color/CMakeLists.txt brlcad/trunk/src/libged/comb_std/CMakeLists.txt brlcad/trunk/src/libged/combmem/CMakeLists.txt brlcad/trunk/src/libged/concat/CMakeLists.txt brlcad/trunk/src/libged/constraint/CMakeLists.txt brlcad/trunk/src/libged/copy/CMakeLists.txt brlcad/trunk/src/libged/copyeval/CMakeLists.txt brlcad/trunk/src/libged/copymat/CMakeLists.txt brlcad/trunk/src/libged/cpi/CMakeLists.txt brlcad/trunk/src/libged/dag/CMakeLists.txt brlcad/trunk/src/libged/dbip/CMakeLists.txt brlcad/trunk/src/libged/debug/CMakeLists.txt brlcad/trunk/src/libged/debugbu/CMakeLists.txt brlcad/trunk/src/libged/debugdir/CMakeLists.txt brlcad/trunk/src/libged/debuglib/CMakeLists.txt brlcad/trunk/src/libged/debugnmg/CMakeLists.txt brlcad/trunk/src/libged/decompose/CMakeLists.txt brlcad/trunk/src/libged/delay/CMakeLists.txt brlcad/trunk/src/libged/dir2ae/CMakeLists.txt brlcad/trunk/src/libged/display_list.c brlcad/trunk/src/libged/draw/CMakeLists.txt brlcad/trunk/src/libged/draw/loadview.c brlcad/trunk/src/libged/draw/preview.c brlcad/trunk/src/libged/draw_calc.cpp brlcad/trunk/src/libged/dsp/CMakeLists.txt brlcad/trunk/src/libged/dump/CMakeLists.txt brlcad/trunk/src/libged/dup/CMakeLists.txt brlcad/trunk/src/libged/eac/CMakeLists.txt brlcad/trunk/src/libged/echo/CMakeLists.txt brlcad/trunk/src/libged/edarb/CMakeLists.txt brlcad/trunk/src/libged/edcodes/CMakeLists.txt brlcad/trunk/src/libged/edcomb/CMakeLists.txt brlcad/trunk/src/libged/edit/CMakeLists.txt brlcad/trunk/src/libged/editit/CMakeLists.txt brlcad/trunk/src/libged/edmater/CMakeLists.txt brlcad/trunk/src/libged/env/CMakeLists.txt brlcad/trunk/src/libged/erase/CMakeLists.txt brlcad/trunk/src/libged/exec.cpp brlcad/trunk/src/libged/exec_mapping.cpp brlcad/trunk/src/libged/exists/CMakeLists.txt brlcad/trunk/src/libged/expand/CMakeLists.txt brlcad/trunk/src/libged/eye_pos/CMakeLists.txt brlcad/trunk/src/libged/facedef.c brlcad/trunk/src/libged/facetize/CMakeLists.txt brlcad/trunk/src/libged/facetize/facetize_log.c brlcad/trunk/src/libged/fb2pix/CMakeLists.txt brlcad/trunk/src/libged/fbclear/CMakeLists.txt brlcad/trunk/src/libged/find/CMakeLists.txt brlcad/trunk/src/libged/form/CMakeLists.txt brlcad/trunk/src/libged/fracture/CMakeLists.txt brlcad/trunk/src/libged/gdiff/CMakeLists.txt brlcad/trunk/src/libged/ged_init.cpp brlcad/trunk/src/libged/ged_util.c brlcad/trunk/src/libged/get/CMakeLists.txt brlcad/trunk/src/libged/get_autoview/CMakeLists.txt brlcad/trunk/src/libged/get_comb/CMakeLists.txt brlcad/trunk/src/libged/get_eyemodel/CMakeLists.txt brlcad/trunk/src/libged/get_obj_bounds.c brlcad/trunk/src/libged/get_solid_kp.c brlcad/trunk/src/libged/get_type/CMakeLists.txt brlcad/trunk/src/libged/glob/CMakeLists.txt brlcad/trunk/src/libged/gqa/CMakeLists.txt brlcad/trunk/src/libged/grid/CMakeLists.txt brlcad/trunk/src/libged/grid2model_lu/CMakeLists.txt brlcad/trunk/src/libged/grid2view_lu/CMakeLists.txt brlcad/trunk/src/libged/group/CMakeLists.txt brlcad/trunk/src/libged/heal/CMakeLists.txt brlcad/trunk/src/libged/help/CMakeLists.txt brlcad/trunk/src/libged/hide/CMakeLists.txt brlcad/trunk/src/libged/how/CMakeLists.txt brlcad/trunk/src/libged/human/CMakeLists.txt brlcad/trunk/src/libged/illum/CMakeLists.txt brlcad/trunk/src/libged/importFg4Section/CMakeLists.txt brlcad/trunk/src/libged/include/ brlcad/trunk/src/libged/inside/CMakeLists.txt brlcad/trunk/src/libged/inside.c brlcad/trunk/src/libged/instance/CMakeLists.txt brlcad/trunk/src/libged/isize/CMakeLists.txt brlcad/trunk/src/libged/item/CMakeLists.txt brlcad/trunk/src/libged/joint/CMakeLists.txt brlcad/trunk/src/libged/joint2/CMakeLists.txt brlcad/trunk/src/libged/keep/CMakeLists.txt brlcad/trunk/src/libged/keypoint/CMakeLists.txt brlcad/trunk/src/libged/kill/CMakeLists.txt brlcad/trunk/src/libged/killall/CMakeLists.txt brlcad/trunk/src/libged/killrefs/CMakeLists.txt brlcad/trunk/src/libged/killtree/CMakeLists.txt brlcad/trunk/src/libged/label/CMakeLists.txt brlcad/trunk/src/libged/lc/CMakeLists.txt brlcad/trunk/src/libged/libfuncs/CMakeLists.txt brlcad/trunk/src/libged/lint/CMakeLists.txt brlcad/trunk/src/libged/list/CMakeLists.txt brlcad/trunk/src/libged/lod/CMakeLists.txt brlcad/trunk/src/libged/log/CMakeLists.txt brlcad/trunk/src/libged/lookat/CMakeLists.txt brlcad/trunk/src/libged/ls/CMakeLists.txt brlcad/trunk/src/libged/lt/CMakeLists.txt brlcad/trunk/src/libged/m2v_point/CMakeLists.txt brlcad/trunk/src/libged/make/CMakeLists.txt brlcad/trunk/src/libged/make_name/CMakeLists.txt brlcad/trunk/src/libged/match/CMakeLists.txt brlcad/trunk/src/libged/mater/CMakeLists.txt brlcad/trunk/src/libged/metaball/ brlcad/trunk/src/libged/mirror/CMakeLists.txt brlcad/trunk/src/libged/model2grid_lu/CMakeLists.txt brlcad/trunk/src/libged/model2view/CMakeLists.txt brlcad/trunk/src/libged/model2view_lu/CMakeLists.txt brlcad/trunk/src/libged/move/CMakeLists.txt brlcad/trunk/src/libged/move_all/CMakeLists.txt brlcad/trunk/src/libged/move_arb_edge/CMakeLists.txt brlcad/trunk/src/libged/move_arb_face/CMakeLists.txt brlcad/trunk/src/libged/mrot/CMakeLists.txt brlcad/trunk/src/libged/nirt/CMakeLists.txt brlcad/trunk/src/libged/nmg/CMakeLists.txt brlcad/trunk/src/libged/nmg/nmg_cmface.c brlcad/trunk/src/libged/nmg/nmg_collapse.c brlcad/trunk/src/libged/nmg/nmg_fix_normals.c brlcad/trunk/src/libged/nmg/nmg_kill_f.c brlcad/trunk/src/libged/nmg/nmg_kill_v.c brlcad/trunk/src/libged/nmg/nmg_make_v.c brlcad/trunk/src/libged/nmg/nmg_mm.c brlcad/trunk/src/libged/nmg/nmg_move_v.c brlcad/trunk/src/libged/nmg/nmg_simplify.c brlcad/trunk/src/libged/ocenter/CMakeLists.txt brlcad/trunk/src/libged/open/CMakeLists.txt brlcad/trunk/src/libged/orient/CMakeLists.txt brlcad/trunk/src/libged/orotate/CMakeLists.txt brlcad/trunk/src/libged/oscale/CMakeLists.txt brlcad/trunk/src/libged/otranslate/CMakeLists.txt brlcad/trunk/src/libged/overlay/CMakeLists.txt brlcad/trunk/src/libged/path.c brlcad/trunk/src/libged/pathlist/CMakeLists.txt brlcad/trunk/src/libged/pathsum/CMakeLists.txt brlcad/trunk/src/libged/perspective/CMakeLists.txt brlcad/trunk/src/libged/pipe/ brlcad/trunk/src/libged/pipe.c brlcad/trunk/src/libged/pix2fb/CMakeLists.txt brlcad/trunk/src/libged/plot/CMakeLists.txt brlcad/trunk/src/libged/pmat/CMakeLists.txt brlcad/trunk/src/libged/pmodel2view/CMakeLists.txt brlcad/trunk/src/libged/png/CMakeLists.txt brlcad/trunk/src/libged/png2fb/CMakeLists.txt brlcad/trunk/src/libged/pnts/CMakeLists.txt brlcad/trunk/src/libged/polyclip.cpp brlcad/trunk/src/libged/prcolor/CMakeLists.txt brlcad/trunk/src/libged/prefix/CMakeLists.txt brlcad/trunk/src/libged/process/CMakeLists.txt brlcad/trunk/src/libged/protate/CMakeLists.txt brlcad/trunk/src/libged/ps/CMakeLists.txt brlcad/trunk/src/libged/pscale/CMakeLists.txt brlcad/trunk/src/libged/pscale/pscale.h brlcad/trunk/src/libged/pscale/scale_ehy.c brlcad/trunk/src/libged/pscale/scale_ell.c brlcad/trunk/src/libged/pscale/scale_epa.c brlcad/trunk/src/libged/pscale/scale_eto.c brlcad/trunk/src/libged/pscale/scale_extrude.c brlcad/trunk/src/libged/pscale/scale_hyp.c brlcad/trunk/src/libged/pscale/scale_part.c brlcad/trunk/src/libged/pscale/scale_rhc.c brlcad/trunk/src/libged/pscale/scale_rpc.c brlcad/trunk/src/libged/pscale/scale_superell.c brlcad/trunk/src/libged/pscale/scale_tgc.c brlcad/trunk/src/libged/pscale/scale_tor.c brlcad/trunk/src/libged/pset/CMakeLists.txt brlcad/trunk/src/libged/ptranslate/CMakeLists.txt brlcad/trunk/src/libged/pull/CMakeLists.txt brlcad/trunk/src/libged/push/CMakeLists.txt brlcad/trunk/src/libged/put/CMakeLists.txt brlcad/trunk/src/libged/put_comb/CMakeLists.txt brlcad/trunk/src/libged/putmat/CMakeLists.txt brlcad/trunk/src/libged/qray/CMakeLists.txt brlcad/trunk/src/libged/qray.c brlcad/trunk/src/libged/qvrot/CMakeLists.txt brlcad/trunk/src/libged/rcodes/CMakeLists.txt brlcad/trunk/src/libged/rect/CMakeLists.txt brlcad/trunk/src/libged/red/CMakeLists.txt brlcad/trunk/src/libged/regdef/CMakeLists.txt brlcad/trunk/src/libged/region/CMakeLists.txt brlcad/trunk/src/libged/remove/CMakeLists.txt brlcad/trunk/src/libged/rfarb/CMakeLists.txt brlcad/trunk/src/libged/rmap/CMakeLists.txt brlcad/trunk/src/libged/rmat/CMakeLists.txt brlcad/trunk/src/libged/rmater/CMakeLists.txt brlcad/trunk/src/libged/rot/CMakeLists.txt brlcad/trunk/src/libged/rot/rotate_about.c brlcad/trunk/src/libged/rot_point/CMakeLists.txt brlcad/trunk/src/libged/rotate_eto.c brlcad/trunk/src/libged/rotate_extrude.c brlcad/trunk/src/libged/rotate_hyp.c brlcad/trunk/src/libged/rotate_tgc.c brlcad/trunk/src/libged/rrt/CMakeLists.txt brlcad/trunk/src/libged/rt/CMakeLists.txt brlcad/trunk/src/libged/rtabort/CMakeLists.txt brlcad/trunk/src/libged/rtcheck/CMakeLists.txt brlcad/trunk/src/libged/rtwizard/CMakeLists.txt brlcad/trunk/src/libged/savekey/CMakeLists.txt brlcad/trunk/src/libged/saveview/CMakeLists.txt brlcad/trunk/src/libged/scale/CMakeLists.txt brlcad/trunk/src/libged/screengrab/CMakeLists.txt brlcad/trunk/src/libged/search/CMakeLists.txt brlcad/trunk/src/libged/select/CMakeLists.txt brlcad/trunk/src/libged/set_output_script/CMakeLists.txt brlcad/trunk/src/libged/set_transparency/CMakeLists.txt brlcad/trunk/src/libged/set_uplotOutputMode/CMakeLists.txt brlcad/trunk/src/libged/setview/CMakeLists.txt brlcad/trunk/src/libged/shaded_mode/CMakeLists.txt brlcad/trunk/src/libged/shader/CMakeLists.txt brlcad/trunk/src/libged/shells/CMakeLists.txt brlcad/trunk/src/libged/showmats/CMakeLists.txt brlcad/trunk/src/libged/simulate/CMakeLists.txt brlcad/trunk/src/libged/slew/CMakeLists.txt brlcad/trunk/src/libged/snap.c brlcad/trunk/src/libged/solid_report/CMakeLists.txt brlcad/trunk/src/libged/solids_on_ray/CMakeLists.txt brlcad/trunk/src/libged/sphgroup/CMakeLists.txt brlcad/trunk/src/libged/summary/CMakeLists.txt brlcad/trunk/src/libged/sync/CMakeLists.txt brlcad/trunk/src/libged/tables/CMakeLists.txt brlcad/trunk/src/libged/tests/plugins.cpp brlcad/trunk/src/libged/tire/CMakeLists.txt brlcad/trunk/src/libged/title/CMakeLists.txt brlcad/trunk/src/libged/tol/CMakeLists.txt brlcad/trunk/src/libged/tops/CMakeLists.txt brlcad/trunk/src/libged/tra/CMakeLists.txt brlcad/trunk/src/libged/trace.c brlcad/trunk/src/libged/track/CMakeLists.txt brlcad/trunk/src/libged/track.c brlcad/trunk/src/libged/translate_extrude.c brlcad/trunk/src/libged/translate_tgc.c brlcad/trunk/src/libged/tree/CMakeLists.txt brlcad/trunk/src/libged/typein/CMakeLists.txt brlcad/trunk/src/libged/unhide/CMakeLists.txt brlcad/trunk/src/libged/units/CMakeLists.txt brlcad/trunk/src/libged/v2m_point/CMakeLists.txt brlcad/trunk/src/libged/vdraw/CMakeLists.txt brlcad/trunk/src/libged/version/CMakeLists.txt brlcad/trunk/src/libged/view/CMakeLists.txt brlcad/trunk/src/libged/view/ged_view.h brlcad/trunk/src/libged/view2grid_lu/CMakeLists.txt brlcad/trunk/src/libged/view2model/CMakeLists.txt brlcad/trunk/src/libged/view2model_lu/CMakeLists.txt brlcad/trunk/src/libged/view2model_vec/CMakeLists.txt brlcad/trunk/src/libged/viewdir/CMakeLists.txt brlcad/trunk/src/libged/voxelize/CMakeLists.txt brlcad/trunk/src/libged/vrot/CMakeLists.txt brlcad/trunk/src/libged/vutil.c brlcad/trunk/src/libged/wcodes/CMakeLists.txt brlcad/trunk/src/libged/wdb_importFg4Section.c brlcad/trunk/src/libged/whatid/CMakeLists.txt brlcad/trunk/src/libged/which/CMakeLists.txt brlcad/trunk/src/libged/which_shader/CMakeLists.txt brlcad/trunk/src/libged/who/CMakeLists.txt brlcad/trunk/src/libged/wmater/CMakeLists.txt brlcad/trunk/src/libged/xpush/CMakeLists.txt brlcad/trunk/src/libged/zap/CMakeLists.txt brlcad/trunk/src/libged/zoom/CMakeLists.txt Removed Paths: ------------- brlcad/trunk/src/libged/bot_condense/ brlcad/trunk/src/libged/bot_decimate/ brlcad/trunk/src/libged/bot_dump/ brlcad/trunk/src/libged/bot_face_fuse/ brlcad/trunk/src/libged/bot_face_sort/ brlcad/trunk/src/libged/bot_flip/ brlcad/trunk/src/libged/bot_fuse/ brlcad/trunk/src/libged/bot_merge/ brlcad/trunk/src/libged/bot_smooth/ brlcad/trunk/src/libged/bot_split/ brlcad/trunk/src/libged/bot_sync/ brlcad/trunk/src/libged/bot_vertex_fuse/ brlcad/trunk/src/libged/columns/ brlcad/trunk/src/libged/display_list/ brlcad/trunk/src/libged/draw_calc/ brlcad/trunk/src/libged/edbot/ brlcad/trunk/src/libged/edit_metaball/ brlcad/trunk/src/libged/edpipe/ brlcad/trunk/src/libged/facedef/ brlcad/trunk/src/libged/facetize_log/ brlcad/trunk/src/libged/ged_util/ brlcad/trunk/src/libged/get_obj_bounds/ brlcad/trunk/src/libged/get_solid_kp/ brlcad/trunk/src/libged/loadview/ brlcad/trunk/src/libged/nmg_cmface/ brlcad/trunk/src/libged/nmg_collapse/ brlcad/trunk/src/libged/nmg_fix_normals/ brlcad/trunk/src/libged/nmg_kill_f/ brlcad/trunk/src/libged/nmg_kill_v/ brlcad/trunk/src/libged/nmg_make_v/ brlcad/trunk/src/libged/nmg_mm/ brlcad/trunk/src/libged/nmg_move_v/ brlcad/trunk/src/libged/nmg_simplify/ brlcad/trunk/src/libged/path/ brlcad/trunk/src/libged/polyclip/ brlcad/trunk/src/libged/preview/ brlcad/trunk/src/libged/rotate_about/ brlcad/trunk/src/libged/rotate_arb_face/ brlcad/trunk/src/libged/rotate_eto/ brlcad/trunk/src/libged/rotate_extrude/ brlcad/trunk/src/libged/rotate_hyp/ brlcad/trunk/src/libged/rotate_tgc/ brlcad/trunk/src/libged/scale_ehy/ brlcad/trunk/src/libged/scale_ell/ brlcad/trunk/src/libged/scale_epa/ brlcad/trunk/src/libged/scale_eto/ brlcad/trunk/src/libged/scale_extrude/ brlcad/trunk/src/libged/scale_hyp/ brlcad/trunk/src/libged/scale_part/ brlcad/trunk/src/libged/scale_rhc/ brlcad/trunk/src/libged/scale_rpc/ brlcad/trunk/src/libged/scale_superell/ brlcad/trunk/src/libged/scale_tgc/ brlcad/trunk/src/libged/scale_tor/ brlcad/trunk/src/libged/trace/ brlcad/trunk/src/libged/translate_extrude/ brlcad/trunk/src/libged/translate_tgc/ brlcad/trunk/src/libged/vutil/ brlcad/trunk/src/libged/wdb_importFg4Section/ Property Changed: ---------------- brlcad/trunk/ brlcad/trunk/include/ brlcad/trunk/regress/ Index: brlcad/trunk =================================================================== --- brlcad/trunk 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk 2020-07-24 14:39:33 UTC (rev 76466) Property changes on: brlcad/trunk ___________________________________________________________________ Modified: svn:mergeinfo ## -5,6 +5,7 ## /brlcad/branches/cmake:43219 /brlcad/branches/dm-fb-merge:75426-76198 /brlcad/branches/gct:62423-62425 +/brlcad/branches/gedplugins:76384-76465 /brlcad/branches/opencl:65867-66137 /brlcad/branches/osg:62110-62113 /brlcad/branches/prep-cache:68236-68933 Index: brlcad/trunk/include =================================================================== --- brlcad/trunk/include 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/include 2020-07-24 14:39:33 UTC (rev 76466) Property changes on: brlcad/trunk/include ___________________________________________________________________ Modified: svn:mergeinfo ## -5,6 +5,7 ## /brlcad/branches/cmake/include:43219 /brlcad/branches/dm-fb-merge/include:75426-76198 /brlcad/branches/gct/include:62423-62425 +/brlcad/branches/gedplugins/include:76384-76465 /brlcad/branches/opencl/include:65867-66137 /brlcad/branches/osg/include:62110-62113 /brlcad/branches/prep-cache/include:68236-68933 Modified: brlcad/trunk/include/ged/commands.h =================================================================== --- brlcad/trunk/include/ged/commands.h 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/include/ged/commands.h 2020-07-24 14:39:33 UTC (rev 76466) @@ -34,6 +34,8 @@ __BEGIN_DECLS +/* Execute plugin based command */ +GED_EXPORT extern int ged_exec(struct ged *gedp, int argc, const char *argv[]); /** * Adjust object's attribute(s) Modified: brlcad/trunk/include/ged/defines.h =================================================================== --- brlcad/trunk/include/ged/defines.h 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/include/ged/defines.h 2020-07-24 14:39:33 UTC (rev 76466) @@ -61,6 +61,7 @@ #define GED_HELP 0x0002 /**< invalid specification, result contains usage */ #define GED_MORE 0x0004 /**< incomplete specification, can specify again interactively */ #define GED_QUIET 0x0008 /**< don't set or modify the result string */ +#define GED_UNKNOWN 0x0010 /**< argv[0] was not a known command */ #define GED_VMIN -2048.0 #define GED_VMAX 2047.0 @@ -241,22 +242,6 @@ typedef void (*ged_create_vlist_callback_ptr)(struct display_list *); typedef void (*ged_free_vlist_callback_ptr)(unsigned int, int); - -/** - * describes a command plugin - */ -struct ged_cmd { - struct bu_list l; - - const char *name; - const char description[80]; - const char *manpage; - - int (*load)(struct ged *); - void (*unload)(struct ged *); - int (*exec)(struct ged *, int, const char *[]); -}; - /* accessor functions for ged_results - calling * applications should not work directly with the * internals of ged_results, which are not guaranteed @@ -294,7 +279,41 @@ } +struct ged_cmd_impl; +struct ged_cmd { + struct ged_cmd_impl *i; +}; +struct ged_plugin { + const struct ged_cmd ** const cmds; + int cmd_cnt; +}; + +/* Report any messages from libged when plugins were initially loaded. + * Can be important when diagnosing command errors. */ +GED_EXPORT const char * ged_init_msgs(); + +/* LIBGED maintains this list - callers should regard it as read only. This + * list will change (size and pointers to individual command strings if + * commands are added or removed - caller is responsible for performing a new + * call to get an updated list and size if commands are altered. */ +GED_EXPORT size_t ged_cmd_list(const char * const **cmd_list); + +/* Report whether a string identifies a valid LIBGED command. If func is + * non-NULL, check that cmd and func both refer to the same function pointer + * (i.e., they are aliases for the same command.) + * + * If func is NULL, a 0 return indicates an valid GED command and non-zero + * indicates a valid command. + * + * If func is non-null: + * 0 indicates both cmd and func strings invoke the same LIBGED function + * 1 indicates that either or both of cmd and func were invalid GED commands + * 2 indicates that both were valid commands, but they did not match. + */ +GED_EXPORT int ged_cmd_valid(const char *cmd, const char *func); + + __END_DECLS #endif /* GED_DEFINES_H */ Index: brlcad/trunk/regress =================================================================== --- brlcad/trunk/regress 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/regress 2020-07-24 14:39:33 UTC (rev 76466) Property changes on: brlcad/trunk/regress ___________________________________________________________________ Modified: svn:mergeinfo ## -5,6 +5,7 ## /brlcad/branches/cmake/regress:43219 /brlcad/branches/dm-fb-merge/regress:75426-76198 /brlcad/branches/gct/regress:62423-62425 +/brlcad/branches/gedplugins/regress:76384-76465 /brlcad/branches/opencl/regress:65867-66137 /brlcad/branches/osg/regress:62110-62113 /brlcad/branches/prep-cache/regress:68236-68933 Modified: brlcad/trunk/regress/CMakeLists.txt =================================================================== --- brlcad/trunk/regress/CMakeLists.txt 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/regress/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -91,6 +91,9 @@ # solids Regression Tests add_subdirectory(solids) +# spdi Regression Tests +add_subdirectory(spdi) + # shaders Regression Tests add_subdirectory(shaders) Modified: brlcad/trunk/src/gtools/gsh.cpp =================================================================== --- brlcad/trunk/src/gtools/gsh.cpp 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/gtools/gsh.cpp 2020-07-24 14:39:33 UTC (rev 76466) @@ -80,7 +80,6 @@ bu_exit(EXIT_SUCCESS, NULL); } - /* If we can't load libged there's not point in continuing */ if (!libged) { bu_vls_free(&msg); @@ -87,6 +86,11 @@ bu_exit(EXIT_FAILURE, "ERROR, could not load libged: %s\n", bu_dlerror()); } + const char *ged_init_str = ged_init_msgs(); + if (strlen(ged_init_str)) { + fprintf(stderr, "%s", ged_init_str); + } + /* FIXME: To draw, we need to init this LIBRT global */ BU_LIST_INIT(&RTG.rtg_vlfree); @@ -169,7 +173,6 @@ /* Start the interactive loop */ while ((line = linenoise(gpmpt)) != NULL) { - int (*func)(struct ged *, int, char *[]); bu_vls_sprintf(&iline, "%s", line); free(line); @@ -192,7 +195,8 @@ /* OK, try a GED command - make an argv array from the input line */ struct bu_vls ged_prefixed = BU_VLS_INIT_ZERO; - bu_vls_sprintf(&ged_prefixed, "ged_%s", bu_vls_addr(&iline)); + //bu_vls_sprintf(&ged_prefixed, "ged_%s", bu_vls_addr(&iline)); + bu_vls_sprintf(&ged_prefixed, "%s", bu_vls_addr(&iline)); char *input = bu_strdup(bu_vls_addr(&ged_prefixed)); bu_vls_free(&ged_prefixed); char **av = (char **)bu_calloc(strlen(input) + 1, sizeof(char *), "argv array"); @@ -201,7 +205,7 @@ /* The "open" and close commands require a bit of * awareness at this level, since the gedp pointer * must respond to them. */ - if (BU_STR_EQUAL(av[0], "ged_open")) { + if (BU_STR_EQUAL(av[0], "open")) { if (ac > 1) { if (gedp) ged_close(gedp); gedp = ged_open("db", av[1], 0); @@ -232,7 +236,7 @@ } - if (BU_STR_EQUAL(av[0], "ged_close")) { + if (BU_STR_EQUAL(av[0], "close")) { ged_close(gedp); gedp = NULL; printf("closed database %s\n", bu_vls_addr(&open_gfile)); @@ -245,6 +249,11 @@ /* If we're not opening or closing, and we have an active gedp, * make a standard libged call */ + ged_exec(gedp, ac, (const char **)av); + printf("%s\n", bu_vls_cstr(gedp->ged_result_str)); + bu_vls_trunc(gedp->ged_result_str, 0); +#if 0 + int (*func)(struct ged *, int, char *[]); *(void **)(&func) = bu_dlsym(libged, av[0]); if (!func) { printf("unrecognzied command: %s\n", av[0]); @@ -252,6 +261,7 @@ (void)func(gedp, ac, av); printf("%s\n", bu_vls_addr(gedp->ged_result_str)); } +#endif bu_free(input, "input copy"); bu_free(av, "input argv"); Modified: brlcad/trunk/src/libged/3ptarb/3ptarb.c =================================================================== --- brlcad/trunk/src/libged/3ptarb/3ptarb.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/3ptarb/3ptarb.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -49,7 +49,7 @@ int -ged_3ptarb(struct ged *gedp, int argc, const char *argv[]) +ged_3ptarb_core(struct ged *gedp, int argc, const char *argv[]) { int i, solve; vect_t vec1; @@ -255,7 +255,27 @@ return GED_OK; } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl threeptarb_cmd_impl = { + "3ptarb", + ged_3ptarb_core, + GED_CMD_DEFAULT +}; +const struct ged_cmd threeptarb_cmd = { &threeptarb_cmd_impl }; +const struct ged_cmd *threeptarb_cmds[] = { &threeptarb_cmd, NULL }; + +static const struct ged_plugin pinfo = { threeptarb_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + + + /* * Local Variables: * tab-width: 8 Copied: brlcad/trunk/src/libged/3ptarb/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/3ptarb/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/3ptarb/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/3ptarb/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-3ptarb SHARED 3ptarb.c) +target_link_libraries(ged-3ptarb libged libbu) +set_property(TARGET ged-3ptarb APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-3ptarb 3ptarb.c) +PLUGIN_SETUP(ged-3ptarb ged) + +CMAKEFILES( + CMakeLists.txt + 3ptarb.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/CMakeLists.txt =================================================================== --- brlcad/trunk/src/libged/CMakeLists.txt 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -1,378 +1,58 @@ +# LIBGED is set up based on a plugin architecture, with common functionality +# defined in a core library. -# if GED command stuff is pushed into the actual subdirs, the autoconf vs cmake -# verification (sh/cmakecheck.sh) will fail on dist-hook. For now, just -# handle it as part of libged -if(BRLCAD_ENABLE_BULLET) - add_definitions(-DHAVE_BULLET=1) - set(LIBGED_CMD_INCLUDE_DIRS - ${LIBGED_CMD_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/simulate - ) - include_directories(SYSTEM - ${CMAKE_CURRENT_SOURCE_DIR}/simulate/bullet - ${CMAKE_CURRENT_SOURCE_DIR}/simulate/LinearMath - ${CMAKE_CURRENT_SOURCE_DIR}/simulate/BulletCollision - ${CMAKE_CURRENT_SOURCE_DIR}/simulate/BulletDynamics - ${CMAKE_CURRENT_SOURCE_DIR}/simulate/BulletSoftBody - ) -endif(BRLCAD_ENABLE_BULLET) -include(simulate/bullet/CMakeLists.txt) - -if(ADAPTAGRAMS_FOUND) - set(LIBGED_CMD_LIBS_LIST ${LIBGED_CMD_LIBS_LIST} ${ADAPTAGRAMS_LIBRARIES}) - set(LIBGED_CMD_INCLUDE_DIRS ${LIBGED_CMD_INCLUDE_DIRS} ${AVOID_INCLUDE_DIR}) -endif(ADAPTAGRAMS_FOUND) - -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/debug") -set(DEBUG_CMD_CPP "${CMAKE_CURRENT_BINARY_DIR}/debug_cmd.cpp") - -add_custom_command(OUTPUT ${DEBUG_CMD_CPP} - COMMAND debug2c ${CMAKE_BINARY_DIR}/cmakefiles.cmake ${DEBUG_CMD_CPP} - DEPENDS debug2c - COMMENT "[DEBUG2C] Scanning for debugging variables" +add_custom_command( + OUTPUT "${CMAKE_BINARY_DIR}/ged_plugins.sentinel" + COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/ged_plugins.sentinel" ) -DISTCLEAN(${DEBUG_CMD_CPP}) -set_source_files_properties(debug/debug.cpp PROPERTIES OBJECT_DEPENDS ${DEBUG_CMD_CPP}) +add_custom_target(ged_plugins_sentinel + DEPENDS ${CMAKE_BINARY_DIR}/ged_plugins.sentinel + ) +function(ged_plugin_library name) + add_library(${name} ${ARGN}) + add_dependencies(ged_plugins_sentinel ${name}) +endfunction(ged_plugin_library name) -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/env") -set(ENV_CMD_C "${CMAKE_CURRENT_BINARY_DIR}/env_cmd.c") +# This target is supplied so applications wanting to run libged +# commands at build time can depend on the plugins being built as well as +# libged itself (otherwise LIBGED commands might fail due to their plugins not +# yet having been built.) +add_custom_target(ged_plugins ALL DEPENDS ged_plugins_sentinel) -add_custom_command(OUTPUT ${ENV_CMD_C} - COMMAND env2c ${CMAKE_BINARY_DIR}/cmakefiles.cmake ${ENV_CMD_C} - DEPENDS env2c - COMMENT "[ENV2C] Scanning for environment variable usage" - ) -DISTCLEAN(${ENV_CMD_C}) -set_source_files_properties(env/env.c PROPERTIES OBJECT_DEPENDS ${ENV_CMD_C}) - set(LIBGED_SOURCES - ${LIBGED_SOURCES} - 3ptarb/3ptarb.c - adc/adc.c - adjust/adjust.c - ae2dir/ae2dir.c - analyze/analyze.c - annotate/annotate.c - arb/arb.c - arced/arced.c - arot/arot.c - attr/attr.cpp - autoview/autoview.c - bb/bb.c - bev/bev.c - bigE/bigE.c - blast/blast.c - bo/bo.c - bot/bot.cpp - bot/check.cpp - bot/extrude.cpp - bot/remesh.cpp - bot_condense/bot_condense.c - bot_decimate/bot_decimate.c - bot_dump/bot_dump.c - bot_face_fuse/bot_face_fuse.c - bot_face_sort/bot_face_sort.c - bot_flip/bot_flip.c - bot_fuse/bot_fuse.c - bot_merge/bot_merge.c - bot_smooth/bot_smooth.c - bot_split/bot_split.c - bot_sync/bot_sync.c - bot_vertex_fuse/bot_vertex_fuse.c - brep/brep.cpp - brep/conversion.cpp - brep/csg.cpp - brep/info.cpp - brep/intersect.cpp - brep/pick.cpp - brep/plot.cpp - brep/tikz.cpp - brep/valid.cpp - cat/cat.c - cc/cc.c - check/check.c - check/check_adj_air.c - check/check_centroid.c - check/check_exp_air.c - check/check_gap.c - check/check_mass.c - check/check_moments.c - check/check_overlaps.c - check/check_surf_area.c - check/check_unconf_air.c - check/check_volume.c - constraint/constraint.c - clone/clone.c - coil/coil.c - color/color.c - columns/columns.c - comb/comb.c - comb_color/comb_color.c - comb_std/comb_std.c - combmem/combmem.c - concat/concat.cpp - copy/copy.c - copyeval/copyeval.c - copymat/copymat.c - cpi/cpi.c - dag/dag.cpp - dbip/dbip.c - debug/debug.cpp - debugbu/debugbu.c - debugdir/debugdir.c - debuglib/debuglib.c - debugnmg/debugnmg.c - decompose/decompose.c - delay/delay.c - dir2ae/dir2ae.c - display_list/display_list.c - draw/draw.c - draw_calc/draw_calc.cpp - dsp/dsp.c - dump/dump.c - dup/dup.c - eac/eac.c - echo/echo.c - edarb/edarb.c - edbot/edbot.c - edcodes/edcodes.c - edcomb/edcomb.c - edit/edit.c - edit_metaball/edit_metaball.c - editit/editit.c - edmater/edmater.c - edpipe/edpipe.c - env/env.c - erase/erase.c - exists/exists.c - expand/expand.c - eye_pos/eye_pos.c - facedef/facedef.c - facetize/facetize.cpp - facetize_log/facetize_log.c - fb2pix/fb2pix.c - fbclear/fbclear.c - find/find.c - form/form.c - fracture/fracture.c - gdiff/gdiff.c - gdiff/gdiff.c + exec.cpp + exec_mapping.cpp + ged_init.cpp + columns.c + display_list.c + draw_calc.cpp + facedef.c ged.c - ged_util/ged_util.c - get/get.c - get_autoview/get_autoview.c - get_comb/get_comb.c - get_eyemodel/get_eyemodel.c - get_obj_bounds/get_obj_bounds.c - get_solid_kp/get_solid_kp.c - get_type/get_type.c - glob/glob.c - gqa/gqa.c - grid/grid.c - grid2model_lu/grid2model_lu.c - grid2view_lu/grid2view_lu.c - group/group.c - heal/heal.c - help/help.cpp - hide/hide.c - how/how.c - human/human.c - illum/illum.c - importFg4Section/importFg4Section.c - inside/inside.c - instance/instance.c - isize/isize.c - item/item.c - joint/joint.c - joint2/joint2.c - keep/keep.c - keypoint/keypoint.c - kill/kill.c - killall/killall.c - killrefs/killrefs.c - killtree/killtree.c - label/label.c - lc/lc.c - libfuncs/libfuncs.c - lint/lint.cpp - list/list.c - loadview/loadview.c - lod/lod.c - log/log.c - lookat/lookat.c - ls/ls.c - lt/lt.c - m2v_point/m2v_point.c - make/make.c - make_name/make_name.c - match/match.c - mater/mater.cpp - mirror/mirror.c - model2grid_lu/model2grid_lu.c - model2view/model2view.c - model2view_lu/model2view_lu.c - move/move.c - move_all/move_all.c - move_arb_edge/move_arb_edge.c - move_arb_face/move_arb_face.c - mrot/mrot.c - nirt/nirt.c - nmg/nmg.c - nmg_cmface/nmg_cmface.c - nmg_collapse/nmg_collapse.c - nmg_fix_normals/nmg_fix_normals.c - nmg_kill_f/nmg_kill_f.c - nmg_kill_v/nmg_kill_v.c - nmg_make_v/nmg_make_v.c - nmg_mm/nmg_mm.c - nmg_move_v/nmg_move_v.c - nmg_simplify/nmg_simplify.c - ocenter/ocenter.c - open/open.c - orient/orient.c - orotate/orotate.c - oscale/oscale.c - otranslate/otranslate.c - overlay/overlay.c - path/path.c - pathlist/pathlist.c - pathsum/pathsum.c - perspective/perspective.c - pix2fb/pix2fb.c - plot/plot.c - pmat/pmat.c - pmodel2view/pmodel2view.c - png/png.c - png2fb/png2fb.c - pnts/pnts.cpp + ged_util.c + get_obj_bounds.c + get_solid_kp.c + inside.c + path.c + pipe.c pnts_util.c - polyclip/polyclip.cpp - prcolor/prcolor.c - prefix/prefix.c - preview/preview.c - process/process.c - protate/protate.c - ps/ps.c - pscale/pscale.c - pset/pset.c - ptranslate/ptranslate.c - pull/pull.c - push/push.c - put/put.c - put_comb/put_comb.c - putmat/putmat.c - qray/qray.c - qvrot/qvrot.c - rcodes/rcodes.c - rect/rect.c - red/red.c - regdef/regdef.c - region/region.c - remove/remove.c - rfarb/rfarb.c - rmap/rmap.c - rmat/rmat.c - rmater/rmater.c - rot/rot.c - rot_point/rot_point.c - rotate_about/rotate_about.c - rotate_arb_face/rotate_arb_face.c - rotate_eto/rotate_eto.c - rotate_extrude/rotate_extrude.c - rotate_hyp/rotate_hyp.c - rotate_tgc/rotate_tgc.c - rrt/rrt.c - rt/rt.c - rtabort/rtabort.c - rtcheck/rtcheck.c - rtwizard/rtwizard.c - savekey/savekey.c - saveview/saveview.c - scale/scale.c - scale_ehy/scale_ehy.c - scale_ell/scale_ell.c - scale_epa/scale_epa.c - scale_eto/scale_eto.c - scale_extrude/scale_extrude.c - scale_hyp/scale_hyp.c - scale_part/scale_part.c - scale_rhc/scale_rhc.c - scale_rpc/scale_rpc.c - scale_superell/scale_superell.c - scale_tgc/scale_tgc.c - scale_tor/scale_tor.c - screengrab/screengrab.c - search/search.c - select/select.c - set_output_script/set_output_script.c - set_transparency/set_transparency.c - set_uplotOutputMode/set_uplotOutputMode.c - setview/setview.c - shaded_mode/shaded_mode.c - shader/shader.c - shells/shells.c - showmats/showmats.c - simulate/ged_command.cpp - simulate/rt_collision_algorithm.cpp - simulate/rt_collision_shape.cpp - simulate/rt_debug_draw.cpp - simulate/rt_instance.cpp - simulate/rt_motion_state.cpp - simulate/simulation.cpp - simulate/utility.cpp - slew/slew.c - solid_report/solid_report.c - solids_on_ray/solids_on_ray.c - sphgroup/sphgroup.c - summary/summary.c - sync/sync.c - tables/tables.c - tire/tire.c - title/title.c - tol/tol.c - tops/tops.c - tra/tra.c - trace/trace.c - track/track.c - translate_extrude/translate_extrude.c - translate_tgc/translate_tgc.c - tree/tree.c - typein/typein.c - unhide/unhide.c - units/units.c - v2m_point/v2m_point.c - vdraw/vdraw.c - version/version.c - view/aet.c - view/center.cpp + polyclip.cpp + qray.c + rotate_eto.c + rotate_extrude.c + rotate_hyp.c + rotate_tgc.c + snap.c + trace.c + track.c + translate_extrude.c + translate_tgc.c + vutil.c view/data_lines.c - view/eye.c - view/quat.c - view/size.c - view/snap.c - view/ypr.c - view/view.c - view2grid_lu/view2grid_lu.c - view2model/view2model.c - view2model_lu/view2model_lu.c - view2model_vec/view2model_vec.c - viewdir/viewdir.c - voxelize/voxelize.c - vrot/vrot.c - vutil/vutil.c - wcodes/wcodes.c - wdb_importFg4Section/wdb_importFg4Section.c - whatid/whatid.c - which/which.cpp - which_shader/which_shader.c - who/who.c - wmater/wmater.c - xpush/xpush.c - zap/zap.c - zoom/zoom.c - ${LIBGED_CMD_SRCS} + wdb_importFg4Section.c ) +set_property(SOURCE ged_init.cpp APPEND PROPERTY COMPILE_DEFINITIONS "GED_PLUGIN_SUFFIX=\"${CMAKE_SHARED_LIBRARY_SUFFIX}\"") + # Include directories needed by libged users set(GED_INCLUDE_DIRS ${BRLCAD_BINARY_DIR}/include @@ -431,6 +111,7 @@ ged_private.h joint/joint.h osg.cpp + pscale/pscale.h pnts_util.h qray.h simulate/NOTES @@ -441,9 +122,239 @@ simulate/rt_motion_state.hpp simulate/simulation.hpp simulate/utility.hpp + include/plugin.h ) CMAKEFILES(${ged_ignore_files}) +# Plugins +add_subdirectory(3ptarb) +add_subdirectory(adc) +add_subdirectory(adjust) +add_subdirectory(ae2dir) +add_subdirectory(analyze) +add_subdirectory(annotate) +add_subdirectory(arb) +add_subdirectory(arced) +add_subdirectory(arot) +add_subdirectory(attr) +add_subdirectory(autoview) +add_subdirectory(bb) +add_subdirectory(bev) +add_subdirectory(bigE) +add_subdirectory(blast) +add_subdirectory(bo) +add_subdirectory(bot) +add_subdirectory(brep) +add_subdirectory(cat) +add_subdirectory(cc) +add_subdirectory(check) +add_subdirectory(clone) +add_subdirectory(coil) +add_subdirectory(color) +add_subdirectory(comb) +add_subdirectory(comb_color) +add_subdirectory(comb_std) +add_subdirectory(combmem) +add_subdirectory(concat) +add_subdirectory(constraint) +add_subdirectory(copy) +add_subdirectory(copyeval) +add_subdirectory(copymat) +add_subdirectory(cpi) +add_subdirectory(dag) +add_subdirectory(dbip) +add_subdirectory(debug) +add_subdirectory(debugbu) +add_subdirectory(debugdir) +add_subdirectory(debuglib) +add_subdirectory(debugnmg) +add_subdirectory(decompose) +add_subdirectory(delay) +add_subdirectory(dir2ae) +add_subdirectory(draw) +add_subdirectory(dsp) +add_subdirectory(dump) +add_subdirectory(dup) +add_subdirectory(eac) +add_subdirectory(echo) +add_subdirectory(edarb) +add_subdirectory(edcodes) +add_subdirectory(edcomb) +add_subdirectory(edit) +add_subdirectory(editit) +add_subdirectory(edmater) +add_subdirectory(env) +add_subdirectory(erase) +add_subdirectory(exists) +add_subdirectory(expand) +add_subdirectory(eye_pos) +add_subdirectory(facetize) +add_subdirectory(fb2pix) +add_subdirectory(fbclear) +add_subdirectory(find) +add_subdirectory(form) +add_subdirectory(fracture) +add_subdirectory(gdiff) +add_subdirectory(get) +add_subdirectory(get_autoview) +add_subdirectory(get_comb) +add_subdirectory(get_eyemodel) +add_subdirectory(get_type) +add_subdirectory(glob) +add_subdirectory(gqa) +add_subdirectory(grid) +add_subdirectory(grid2model_lu) +add_subdirectory(grid2view_lu) +add_subdirectory(group) +add_subdirectory(heal) +add_subdirectory(help) +add_subdirectory(hide) +add_subdirectory(how) +add_subdirectory(human) +add_subdirectory(illum) +add_subdirectory(importFg4Section) +add_subdirectory(inside) +add_subdirectory(instance) +add_subdirectory(isize) +add_subdirectory(item) +add_subdirectory(joint) +add_subdirectory(joint2) +add_subdirectory(keep) +add_subdirectory(keypoint) +add_subdirectory(kill) +add_subdirectory(killall) +add_subdirectory(killrefs) +add_subdirectory(killtree) +add_subdirectory(label) +add_subdirectory(lc) +add_subdirectory(libfuncs) +add_subdirectory(lint) +add_subdirectory(list) +add_subdirectory(lod) +add_subdirectory(log) +add_subdirectory(lookat) +add_subdirectory(ls) +add_subdirectory(lt) +add_subdirectory(m2v_point) +add_subdirectory(make) +add_subdirectory(make_name) +add_subdirectory(match) +add_subdirectory(mater) +add_subdirectory(metaball) +add_subdirectory(mirror) +add_subdirectory(model2grid_lu) +add_subdirectory(model2view) +add_subdirectory(model2view_lu) +add_subdirectory(move) +add_subdirectory(move_all) +add_subdirectory(move_arb_edge) +add_subdirectory(move_arb_face) +add_subdirectory(mrot) +add_subdirectory(nirt) +add_subdirectory(nmg) +add_subdirectory(ocenter) +add_subdirectory(open) +add_subdirectory(orient) +add_subdirectory(orotate) +add_subdirectory(oscale) +add_subdirectory(otranslate) +add_subdirectory(overlay) +add_subdirectory(pathlist) +add_subdirectory(pathsum) +add_subdirectory(perspective) +add_subdirectory(pipe) +add_subdirectory(pix2fb) +add_subdirectory(plot) +add_subdirectory(pmat) +add_subdirectory(pmodel2view) +add_subdirectory(png) +add_subdirectory(png2fb) +add_subdirectory(pnts) +add_subdirectory(prcolor) +add_subdirectory(prefix) +add_subdirectory(process) +add_subdirectory(protate) +add_subdirectory(ps) +add_subdirectory(pscale) +add_subdirectory(pset) +add_subdirectory(ptranslate) +add_subdirectory(pull) +add_subdirectory(push) +add_subdirectory(put) +add_subdirectory(put_comb) +add_subdirectory(putmat) +add_subdirectory(qray) +add_subdirectory(qvrot) +add_subdirectory(rcodes) +add_subdirectory(rect) +add_subdirectory(red) +add_subdirectory(regdef) +add_subdirectory(region) +add_subdirectory(remove) +add_subdirectory(rfarb) +add_subdirectory(rmap) +add_subdirectory(rmat) +add_subdirectory(rmater) +add_subdirectory(rot) +add_subdirectory(rot_point) +add_subdirectory(rrt) +add_subdirectory(rt) +add_subdirectory(rtabort) +add_subdirectory(rtcheck) +add_subdirectory(rtwizard) +add_subdirectory(savekey) +add_subdirectory(saveview) +add_subdirectory(scale) +add_subdirectory(screengrab) +add_subdirectory(search) +add_subdirectory(select) +add_subdirectory(set_output_script) +add_subdirectory(set_transparency) +add_subdirectory(set_uplotOutputMode) +add_subdirectory(setview) +add_subdirectory(shaded_mode) +add_subdirectory(shader) +add_subdirectory(shells) +add_subdirectory(showmats) +add_subdirectory(simulate) +add_subdirectory(slew) +add_subdirectory(solid_report) +add_subdirectory(solids_on_ray) +add_subdirectory(sphgroup) +add_subdirectory(summary) +add_subdirectory(sync) +add_subdirectory(tables) +add_subdirectory(tire) +add_subdirectory(title) +add_subdirectory(tol) +add_subdirectory(tops) +add_subdirectory(tra) +add_subdirectory(track) +add_subdirectory(tree) +add_subdirectory(typein) +add_subdirectory(unhide) +add_subdirectory(units) +add_subdirectory(v2m_point) +add_subdirectory(vdraw) +add_subdirectory(version) +add_subdirectory(view) +add_subdirectory(view2grid_lu) +add_subdirectory(view2model) +add_subdirectory(view2model_lu) +add_subdirectory(view2model_vec) +add_subdirectory(viewdir) +add_subdirectory(voxelize) +add_subdirectory(vrot) +add_subdirectory(wcodes) +add_subdirectory(whatid) +add_subdirectory(which) +add_subdirectory(which_shader) +add_subdirectory(who) +add_subdirectory(wmater) +add_subdirectory(xpush) +add_subdirectory(zap) +add_subdirectory(zoom) + # Local Variables: # tab-width: 8 # mode: cmake @@ -450,3 +361,4 @@ # indent-tabs-mode: t # End: # ex: shiftwidth=2 tabstop=8 + Copied: brlcad/trunk/src/libged/adc/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/adc/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/adc/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/adc/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-adc SHARED adc.c) +target_link_libraries(ged-adc libged libbu) +set_property(TARGET ged-adc APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-adc adc.c) +PLUGIN_SETUP(ged-adc ged) + +CMAKEFILES( + CMakeLists.txt + adc.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/adc/adc.c =================================================================== --- brlcad/trunk/src/libged/adc/adc.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/adc/adc.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -105,7 +105,7 @@ * that multiple attributes can be set with a single command call. */ int -ged_adc(struct ged *gedp, +ged_adc_core(struct ged *gedp, int argc, const char *argv[]) { @@ -698,7 +698,25 @@ gvp->gv_adc.dst = (gvp->gv_adc.dv_dist * INV_GED + 1.0) * M_SQRT1_2; } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl adc_cmd_impl = { + "adc", + ged_adc_core, + GED_CMD_DEFAULT +}; +const struct ged_cmd adc_cmd = { &adc_cmd_impl }; +const struct ged_cmd *adc_cmds[] = { &adc_cmd, NULL }; + +static const struct ged_plugin pinfo = { adc_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: * mode: C Copied: brlcad/trunk/src/libged/adjust/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/adjust/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/adjust/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/adjust/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-adjust SHARED adjust.c) +target_link_libraries(ged-adjust libged libbu) +set_property(TARGET ged-adjust APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-adjust adjust.c) +PLUGIN_SETUP(ged-adjust ged) + +CMAKEFILES( + CMakeLists.txt + adjust.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/adjust/adjust.c =================================================================== --- brlcad/trunk/src/libged/adjust/adjust.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/adjust/adjust.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -33,7 +33,7 @@ int -ged_adjust(struct ged *gedp, int argc, const char *argv[]) +ged_adjust_core(struct ged *gedp, int argc, const char *argv[]) { int status; struct directory *dp; @@ -85,10 +85,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl adjust_cmd_impl = { + "adjust", + ged_adjust_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd adjust_cmd = { &adjust_cmd_impl }; +const struct ged_cmd *adjust_cmds[] = { &adjust_cmd, NULL }; + +static const struct ged_plugin pinfo = { adjust_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/ae2dir/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/ae2dir/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/ae2dir/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/ae2dir/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-ae2dir SHARED ae2dir.c) +target_link_libraries(ged-ae2dir libged libbu) +set_property(TARGET ged-ae2dir APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-ae2dir ae2dir.c) +PLUGIN_SETUP(ged-ae2dir ged) + +CMAKEFILES( + CMakeLists.txt + ae2dir.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/ae2dir/ae2dir.c =================================================================== --- brlcad/trunk/src/libged/ae2dir/ae2dir.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/ae2dir/ae2dir.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -33,7 +33,7 @@ int -ged_ae2dir(struct ged *gedp, int argc, const char *argv[]) +ged_ae2dir_core(struct ged *gedp, int argc, const char *argv[]) { double az, el; vect_t dir; @@ -83,10 +83,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl ae2dir_cmd_impl = { + "ae2dir", + ged_ae2dir_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd ae2dir_cmd = { &ae2dir_cmd_impl }; +const struct ged_cmd *ae2dir_cmds[] = { &ae2dir_cmd, NULL }; + +static const struct ged_plugin pinfo = { ae2dir_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/analyze/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/analyze/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/analyze/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/analyze/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-analyze SHARED analyze.c) +target_link_libraries(ged-analyze libged libbu) +set_property(TARGET ged-analyze APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-analyze analyze.c) +PLUGIN_SETUP(ged-analyze ged) + +CMAKEFILES( + CMakeLists.txt + analyze.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/analyze/analyze.c =================================================================== --- brlcad/trunk/src/libged/analyze/analyze.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/analyze/analyze.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -29,8 +29,6 @@ #include <string.h> #include <assert.h> - - #include "vmath.h" #include "bn.h" #include "bg/polygon.h" @@ -1278,7 +1276,7 @@ int -ged_analyze(struct ged *gedp, int argc, const char *argv[]) +ged_analyze_core(struct ged *gedp, int argc, const char *argv[]) { struct directory *ndp; int i; @@ -1313,6 +1311,25 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl analyze_cmd_impl = { + "analyze", + ged_analyze_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd analyze_cmd = { &analyze_cmd_impl }; +const struct ged_cmd *analyze_cmds[] = { &analyze_cmd, NULL }; + +static const struct ged_plugin pinfo = { analyze_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: * mode: C Copied: brlcad/trunk/src/libged/annotate/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/annotate/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/annotate/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/annotate/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-annotate SHARED annotate.c) +target_link_libraries(ged-annotate libged libbu) +set_property(TARGET ged-annotate APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-annotate annotate.c) +PLUGIN_SETUP(ged-annotate ged) + +CMAKEFILES( + CMakeLists.txt + annotate.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/annotate/annotate.c =================================================================== --- brlcad/trunk/src/libged/annotate/annotate.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/annotate/annotate.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -119,7 +119,7 @@ int -ged_annotate(struct ged *gedp, int argc, const char *argv[]) +ged_annotate_core(struct ged *gedp, int argc, const char *argv[]) { char **object_argv; const char *argv0 = argv[0]; @@ -163,16 +163,35 @@ } bu_vls_free(&objects); - bu_free((void *)object_argv, "ged_annotate"); + bu_free((void *)object_argv, "ged_annotate_core"); return GED_OK; } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl annotate_cmd_impl = { + "annotate", + ged_annotate_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd annotate_cmd = { &annotate_cmd_impl }; +const struct ged_cmd *annotate_cmds[] = { &annotate_cmd, NULL }; + +static const struct ged_plugin pinfo = { annotate_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/arb/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/arb/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/arb/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/arb/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,31 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +set(arb_srcs + arb.c + rotate_arb_face.c + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-arb SHARED ${arb_srcs}) +target_link_libraries(ged-arb libged libbu) +set_property(TARGET ged-arb APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-arb ${arb_srcs}) +PLUGIN_SETUP(ged-arb ged) + +CMAKEFILES( + CMakeLists.txt + ${arb_srcs} + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/arb/arb.c =================================================================== --- brlcad/trunk/src/libged/arb/arb.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/arb/arb.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -35,7 +35,7 @@ int -ged_arb(struct ged *gedp, int argc, const char *argv[]) +ged_arb_core(struct ged *gedp, int argc, const char *argv[]) { struct directory *dp; struct rt_db_internal internal; @@ -129,10 +129,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl arb_cmd_impl = {"arb", ged_arb_core, GED_CMD_DEFAULT}; +const struct ged_cmd arb_cmd = { &arb_cmd_impl }; + +extern int ged_rotate_arb_face_core(struct ged *gedp, int argc, const char *argv[]); +struct ged_cmd_impl rotate_arb_face_cmd_impl = {"rotate_arb_face", ged_rotate_arb_face_core, GED_CMD_DEFAULT}; +const struct ged_cmd rotate_arb_face_cmd = { &rotate_arb_face_cmd_impl }; + +const struct ged_cmd *arb_cmds[] = { &arb_cmd, &rotate_arb_face_cmd, NULL }; + +static const struct ged_plugin pinfo = { arb_cmds, 2 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/arb/rotate_arb_face.c (from rev 76465, brlcad/branches/gedplugins/src/libged/arb/rotate_arb_face.c) =================================================================== --- brlcad/trunk/src/libged/arb/rotate_arb_face.c (rev 0) +++ brlcad/trunk/src/libged/arb/rotate_arb_face.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,232 @@ +/* R O T A T E _ A R B _ F A C E . C + * BRL-CAD + * + * Copyright (c) 2008-2020 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file libged/rotate_arb_face.c + * + * The rotate_arb_face command. + * + */ + +#include "common.h" + +#include <string.h> + +#include "bu/cmd.h" +#include "rt/geom.h" + +#include "../ged_private.h" + + +static const short int arb_vertices[5][24] = { + { 1, 2, 3, 0, 1, 2, 4, 0, 2, 3, 4, 0, 1, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* arb4 */ + { 1, 2, 3, 4, 1, 2, 5, 0, 2, 3, 5, 0, 3, 4, 5, 0, 1, 4, 5, 0, 0, 0, 0, 0 }, /* arb5 */ + { 1, 2, 3, 4, 2, 3, 6, 5, 1, 5, 6, 4, 1, 2, 5, 0, 3, 4, 6, 0, 0, 0, 0, 0 }, /* arb6 */ + { 1, 2, 3, 4, 5, 6, 7, 0, 1, 4, 5, 0, 2, 3, 7, 6, 1, 2, 6, 5, 4, 3, 7, 5 }, /* arb7 */ + { 1, 2, 3, 4, 5, 6, 7, 8, 1, 5, 8, 4, 2, 3, 7, 6, 1, 2, 6, 5, 4, 3, 7, 8 } /* arb8 */ +}; + + +int +ged_rotate_arb_face_core(struct ged *gedp, int argc, const char *argv[]) +{ + struct rt_db_internal intern; + struct rt_arb_internal *arb; + struct directory *dp; + fastf_t planes[7][4]; /* ARBs defining plane equations */ + int arb_type; + int face; + int vi; + mat_t mat; + int i; + int pnt5; /* special arb7 case */ + char *last; + + /* intentionally double for scan */ + double pt[3]; + + static const char *usage = "arb face pt rvec"; + + GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR); + GED_CHECK_READ_ONLY(gedp, GED_ERROR); + GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR); + + /* initialize result */ + bu_vls_trunc(gedp->ged_result_str, 0); + + /* must be wanting help */ + if (argc == 1) { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_HELP; + } + + if (argc != 5) { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_ERROR; + } + + if ((last = strrchr(argv[1], '/')) == NULL) + last = (char *)argv[1]; + else + ++last; + + if (last[0] == '\0') { + bu_vls_printf(gedp->ged_result_str, "illegal input - %s", argv[1]); + return GED_ERROR; + } + + if ((dp = db_lookup(gedp->ged_wdbp->dbip, last, LOOKUP_QUIET)) == RT_DIR_NULL) { + bu_vls_printf(gedp->ged_result_str, "%s not found", argv[1]); + return GED_ERROR; + } + + if (wdb_import_from_path2(gedp->ged_result_str, &intern, argv[1], gedp->ged_wdbp, mat) == GED_ERROR) + return GED_ERROR; + + if (intern.idb_major_type != DB5_MAJORTYPE_BRLCAD || + intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_ARB8) { + bu_vls_printf(gedp->ged_result_str, "Object not an ARB"); + rt_db_free_internal(&intern); + + return GED_OK; + } + + if (sscanf(argv[2], "%d", &face) != 1) { + bu_vls_printf(gedp->ged_result_str, "bad face - %s", argv[2]); + rt_db_free_internal(&intern); + + return GED_ERROR; + } + + /*XXX need better checking of the face */ + face -= 1; + if (face < 0 || 5 < face) { + bu_vls_printf(gedp->ged_result_str, "bad face - %s", argv[2]); + rt_db_free_internal(&intern); + + return GED_ERROR; + } + + if (sscanf(argv[3], "%d", &vi) != 1) { + bu_vls_printf(gedp->ged_result_str, "bad vertex index - %s", argv[2]); + rt_db_free_internal(&intern); + + return GED_ERROR; + } + + + /*XXX need better checking of the vertex index */ + vi -= 1; + if (vi < 0 || 7 < vi) { + bu_vls_printf(gedp->ged_result_str, "bad vertex - %s", argv[2]); + rt_db_free_internal(&intern); + + return GED_ERROR; + } + + if (sscanf(argv[4], "%lf %lf %lf", &pt[X], &pt[Y], &pt[Z]) != 3) { + bu_vls_printf(gedp->ged_result_str, "bad point - %s", argv[3]); + rt_db_free_internal(&intern); + + return GED_ERROR; + } + + arb = (struct rt_arb_internal *)intern.idb_ptr; + RT_ARB_CK_MAGIC(arb); + + arb_type = rt_arb_std_type(&intern, &gedp->ged_wdbp->wdb_tol); + + if (rt_arb_calc_planes(gedp->ged_result_str, arb, arb_type, planes, &gedp->ged_wdbp->wdb_tol)) { + rt_db_free_internal(&intern); + + return GED_ERROR; + } + + /* special case for arb4 */ + if (arb_type == ARB4 && vi >= 3) + vi = 4; + + /* special case for arb6 */ + if (arb_type == ARB6 && vi >= 5) + vi = 6; + + /* special case for arb7 */ + if (arb_type == ARB7) { + /* check if point 5 is in the face */ + pnt5 = 0; + for (i = 0; i < 4; i++) { + if (arb_vertices[arb_type-4][face*4+i]==5) + pnt5=1; + } + + if (pnt5) + vi = 4; + } + + { + /* Apply incremental changes */ + vect_t tempvec; + vect_t work; + fastf_t *plane; + mat_t rmat; + + bn_mat_angles(rmat, pt[X], pt[Y], pt[Z]); + + plane = &planes[face][0]; + VMOVE(work, plane); + MAT4X3VEC(plane, rmat, work); + + /* point notation of fixed vertex */ + VMOVE(tempvec, arb->pt[vi]); + + /* set D of planar equation to anchor at fixed vertex */ + planes[face][3]=VDOT(plane, tempvec); + } + + /* calculate new points for the arb */ + (void)rt_arb_calc_points(arb, arb_type, (const plane_t *)planes, &gedp->ged_wdbp->wdb_tol); + + { + mat_t invmat; + + bn_mat_inv(invmat, mat); + + for (i = 0; i < 8; ++i) { + point_t arb_pt; + + MAT4X3PNT(arb_pt, invmat, arb->pt[i]); + VMOVE(arb->pt[i], arb_pt); + } + + GED_DB_PUT_INTERNAL(gedp, dp, &intern, &rt_uniresource, GED_ERROR); + } + + rt_db_free_internal(&intern); + return GED_OK; +} + + +/* + * Local Variables: + * tab-width: 8 + * mode: C + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Copied: brlcad/trunk/src/libged/arced/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/arced/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/arced/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/arced/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-arced SHARED arced.c) +target_link_libraries(ged-arced libged libbu) +set_property(TARGET ged-arced APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-arced arced.c) +PLUGIN_SETUP(ged-arced ged) + +CMAKEFILES( + CMakeLists.txt + arced.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/arced/arced.c =================================================================== --- brlcad/trunk/src/libged/arced/arced.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/arced/arced.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -31,7 +31,7 @@ int -ged_arced(struct ged *gedp, int argc, const char *argv[]) +ged_arced_core(struct ged *gedp, int argc, const char *argv[]) { struct animate *anp; struct directory *dp; @@ -133,10 +133,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl arced_cmd_impl = { + "arced", + ged_arced_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd arced_cmd = { &arced_cmd_impl }; +const struct ged_cmd *arced_cmds[] = { &arced_cmd, NULL }; + +static const struct ged_plugin pinfo = { arced_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/arot/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/arot/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/arot/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/arot/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-arot SHARED arot.c) +target_link_libraries(ged-arot libged libbu) +set_property(TARGET ged-arot APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-arot arot.c) +PLUGIN_SETUP(ged-arot ged) + +CMAKEFILES( + CMakeLists.txt + arot.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/arot/arot.c =================================================================== --- brlcad/trunk/src/libged/arot/arot.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/arot/arot.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -31,63 +31,9 @@ #include "../ged_private.h" -int -ged_arot_args(struct ged *gedp, int argc, const char *argv[], mat_t rmat) -{ - point_t pt = VINIT_ZERO; - vect_t axisv; - double axis[3]; /* not fastf_t due to sscanf */ - double angle; /* not fastf_t due to sscanf */ - static const char *usage = "x y z angle"; - GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR); - GED_CHECK_VIEW(gedp, GED_ERROR); - GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR); - - /* initialize result */ - bu_vls_trunc(gedp->ged_result_str, 0); - - /* must be wanting help */ - if (argc == 1) { - bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); - return GED_HELP; - } - - if (argc != 5) { - bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); - return GED_ERROR; - } - - if (sscanf(argv[1], "%lf", &axis[X]) != 1) { - bu_vls_printf(gedp->ged_result_str, "%s: bad X value - %s\n", argv[0], argv[1]); - return GED_ERROR; - } - - if (sscanf(argv[2], "%lf", &axis[Y]) != 1) { - bu_vls_printf(gedp->ged_result_str, "%s: bad Y value - %s\n", argv[0], argv[2]); - return GED_ERROR; - } - - if (sscanf(argv[3], "%lf", &axis[Z]) != 1) { - bu_vls_printf(gedp->ged_result_str, "%s: bad Z value - %s\n", argv[0], argv[3]); - return GED_ERROR; - } - - if (sscanf(argv[4], "%lf", &angle) != 1) { - bu_vls_printf(gedp->ged_result_str, "%s: bad angle - %s\n", argv[0], argv[4]); - return GED_ERROR; - } - - VUNITIZE(axis); - VMOVE(axisv, axis); - bn_mat_arb_rot(rmat, pt, axisv, angle*DEG2RAD); - - return GED_OK; -} - - int -ged_arot(struct ged *gedp, int argc, const char *argv[]) +ged_arot_core(struct ged *gedp, int argc, const char *argv[]) { int ret; mat_t rmat; @@ -99,10 +45,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl arot_cmd_impl = { + "arot", + ged_arot_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd arot_cmd = { &arot_cmd_impl }; +const struct ged_cmd *arot_cmds[] = { &arot_cmd, NULL }; + +static const struct ged_plugin pinfo = { arot_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/attr/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/attr/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/attr/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/attr/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-attr SHARED attr.cpp) +target_link_libraries(ged-attr libged libbu) +set_property(TARGET ged-attr APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-attr attr.cpp) +PLUGIN_SETUP(ged-attr ged) + +CMAKEFILES( + CMakeLists.txt + attr.cpp + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/attr/attr.cpp =================================================================== --- brlcad/trunk/src/libged/attr/attr.cpp 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/attr/attr.cpp 2020-07-24 14:39:33 UTC (rev 76466) @@ -288,8 +288,8 @@ } -int -ged_attr(struct ged *gedp, int argc, const char *argv[]) +extern "C" int +ged_attr_core(struct ged *gedp, int argc, const char *argv[]) { int ret = GED_OK; size_t i; @@ -357,7 +357,7 @@ if (path_cnt == 0) { bu_vls_printf(gedp->ged_result_str, "Cannot locate objects matching %s\n", argv[2]); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } if (scmd == ATTR_SORT) { @@ -374,7 +374,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } bu_sort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair), attr_cmp, NULL); /* get a jump on calculating name and value lengths */ @@ -389,7 +389,7 @@ /* pretty print */ if ((attr_pretty_print(gedp, dp, argv[2])) != GED_OK) { ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } if (argc == 3) { /* just list the already sorted attribute-value pairs */ @@ -420,7 +420,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } bu_sort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair), attr_cmp, NULL); @@ -449,7 +449,7 @@ argv[i]); bu_avs_free(&avs); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } if (do_separators) { if (c_sep == -1) @@ -477,7 +477,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } bu_sort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair), attr_cmp, NULL); @@ -550,7 +550,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &lavs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } val = bu_avs_get(&lavs, oattr); if (val) { @@ -561,7 +561,7 @@ "Error: failed to update attributes\n"); bu_avs_free(&lavs); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } /* lavs is freed by db5_update_attributes() */ } else { @@ -576,7 +576,7 @@ bu_vls_printf(gedp->ged_result_str, "Error: attribute names and values must be in pairs!!!\n"); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } for (i = 0; i < path_cnt; i++) { size_t j = 3; @@ -587,7 +587,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } bu_sort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair), attr_cmp, NULL); while (j < (size_t)argc) { @@ -603,7 +603,7 @@ "Error: failed to update attributes\n"); bu_avs_free(&avs); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } /* avs is freed by db5_update_attributes() */ } @@ -619,7 +619,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } bu_sort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair), attr_cmp, NULL); @@ -635,7 +635,7 @@ "Error: failed to update attributes\n"); bu_avs_free(&avs); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } /* avs is freed by db5_replace_attributes() */ } @@ -646,7 +646,7 @@ bu_vls_printf(gedp->ged_result_str, "Error: attribute names and values must be in pairs!!!\n"); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } for (i = 0; i < path_cnt; i++) { size_t j = 3; @@ -657,7 +657,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } bu_sort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair), attr_cmp, NULL); @@ -685,7 +685,7 @@ "Error: failed to update attributes\n"); bu_avs_free(&avs); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } /* avs is freed by db5_replace_attributes() */ @@ -703,7 +703,7 @@ if (db5_get_attributes(gedp->ged_wdbp->dbip, &avs, dp)) { bu_vls_printf(gedp->ged_result_str, "Cannot get attributes for object %s\n", dp->d_namep); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } /* get a jump on calculating name and value lengths */ @@ -718,7 +718,7 @@ /* pretty print */ if ((attr_pretty_print(gedp, dp, dp->d_namep)) != GED_OK) { ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } if (argc == 3) { @@ -734,10 +734,10 @@ bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", cmd_name, usage); ret = GED_ERROR; - goto ged_attr_memfree; + goto ged_attr_core_memfree; } -ged_attr_memfree: +ged_attr_core_memfree: bu_free(paths, "db_ls paths"); @@ -745,11 +745,29 @@ } -// Local Variables: -// tab-width: 8 -// mode: C++ -// c-basic-offset: 4 -// indent-tabs-mode: t -// c-file-style: "stroustrup" -// End: -// ex: shiftwidth=4 tabstop=8 + +#ifdef GED_PLUGIN +#include "../include/plugin.h" +extern "C" { + struct ged_cmd_impl attr_cmd_impl = { "attr", ged_attr_core, GED_CMD_DEFAULT }; + const struct ged_cmd attr_pcmd = { &attr_cmd_impl }; + const struct ged_cmd *attr_cmds[] = { &attr_pcmd, NULL }; + + static const struct ged_plugin pinfo = { attr_cmds, 1 }; + + COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() + { + return &pinfo; + } +} +#endif + +/* + * Local Variables: + * tab-width: 8 + * mode: C + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Copied: brlcad/trunk/src/libged/autoview/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/autoview/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/autoview/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/autoview/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-autoview SHARED autoview.c) +target_link_libraries(ged-autoview libged libbu) +set_property(TARGET ged-autoview APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-autoview autoview.c) +PLUGIN_SETUP(ged-autoview ged) + +CMAKEFILES( + CMakeLists.txt + autoview.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/autoview/autoview.c =================================================================== --- brlcad/trunk/src/libged/autoview/autoview.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/autoview/autoview.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -24,8 +24,7 @@ */ #include "common.h" - - +#include "dm.h" #include "../ged_private.h" /* @@ -36,7 +35,7 @@ * */ int -ged_autoview(struct ged *gedp, int argc, const char *argv[]) +ged_autoview_core(struct ged *gedp, int argc, const char *argv[]) { int is_empty = 1; vect_t min, max; @@ -111,10 +110,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl autoview_cmd_impl = { + "autoview", + ged_autoview_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd autoview_cmd = { &autoview_cmd_impl }; +const struct ged_cmd *autoview_cmds[] = { &autoview_cmd, NULL }; + +static const struct ged_plugin pinfo = { autoview_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/bb/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/bb/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/bb/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/bb/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-bb SHARED bb.c) +target_link_libraries(ged-bb libged libbu) +set_property(TARGET ged-bb APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-bb bb.c) +PLUGIN_SETUP(ged-bb ged) + +CMAKEFILES( + CMakeLists.txt + bb.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/bb/bb.c =================================================================== --- brlcad/trunk/src/libged/bb/bb.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/bb/bb.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -38,7 +38,7 @@ int -ged_bb(struct ged *gedp, int argc, const char *argv[]) +ged_bb_core(struct ged *gedp, int argc, const char *argv[]) { point_t rpp_min, rpp_max; point_t obj_min, obj_max; @@ -308,10 +308,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl bb_cmd_impl = { + "bb", + ged_bb_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd bb_cmd = { &bb_cmd_impl }; +const struct ged_cmd *bb_cmds[] = { &bb_cmd, NULL }; + +static const struct ged_plugin pinfo = { bb_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/bev/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/bev/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/bev/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/bev/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-bev SHARED bev.c) +target_link_libraries(ged-bev libged libbu) +set_property(TARGET ged-bev APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-bev bev.c) +PLUGIN_SETUP(ged-bev ged) + +CMAKEFILES( + CMakeLists.txt + bev.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/bev/bev.c =================================================================== --- brlcad/trunk/src/libged/bev/bev.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/bev/bev.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -78,7 +78,7 @@ int -ged_bev(struct ged *gedp, int argc, const char *argv[]) +ged_bev_core(struct ged *gedp, int argc, const char *argv[]) { static const char *usage = "[-t] new_obj obj1 op obj2 op obj3 ..."; @@ -308,10 +308,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl bev_cmd_impl = { + "bev", + ged_bev_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd bev_cmd = { &bev_cmd_impl }; +const struct ged_cmd *bev_cmds[] = { &bev_cmd, NULL }; + +static const struct ged_plugin pinfo = { bev_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/bigE/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/bigE/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/bigE/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/bigE/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-bigE SHARED bigE.c) +target_link_libraries(ged-bigE libged libbu) +set_property(TARGET ged-bigE APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-bigE bigE.c) +PLUGIN_SETUP(ged-bigE ged) + +CMAKEFILES( + CMakeLists.txt + bigE.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/bigE/bigE.c =================================================================== --- brlcad/trunk/src/libged/bigE/bigE.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/bigE/bigE.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -1979,7 +1979,7 @@ int -ged_E(struct ged *gedp, int argc, const char *argv[]) +ged_E_core(struct ged *gedp, int argc, const char *argv[]) { int i; int c; @@ -2128,6 +2128,25 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl bigE_cmd_impl = { + "E", + ged_E_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd bigE_cmd = { &bigE_cmd_impl }; +const struct ged_cmd *bigE_cmds[] = { &bigE_cmd, NULL }; + +static const struct ged_plugin pinfo = { bigE_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: * mode: C Copied: brlcad/trunk/src/libged/blast/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/blast/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/blast/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/blast/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-blast SHARED blast.c) +target_link_libraries(ged-blast libged libbu) +set_property(TARGET ged-blast APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-blast blast.c) +PLUGIN_SETUP(ged-blast ged) + +CMAKEFILES( + CMakeLists.txt + blast.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/blast/blast.c =================================================================== --- brlcad/trunk/src/libged/blast/blast.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/blast/blast.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -33,7 +33,7 @@ * */ int -ged_blast(struct ged *gedp, int argc, const char *argv[]) +ged_blast_core(struct ged *gedp, int argc, const char *argv[]) { static const char *usage = "object(s)"; @@ -64,10 +64,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl blast_cmd_impl = { + "blast", + ged_blast_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd blast_cmd = { &blast_cmd_impl }; +const struct ged_cmd *blast_cmds[] = { &blast_cmd, NULL }; + +static const struct ged_plugin pinfo = { blast_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/bo/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/bo/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/bo/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/bo/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-bo SHARED bo.c) +target_link_libraries(ged-bo libged libbu) +set_property(TARGET ged-bo APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-bo bo.c) +PLUGIN_SETUP(ged-bo ged) + +CMAKEFILES( + CMakeLists.txt + bo.c + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 Modified: brlcad/trunk/src/libged/bo/bo.c =================================================================== --- brlcad/trunk/src/libged/bo/bo.c 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/bo/bo.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -35,7 +35,7 @@ int -ged_bo(struct ged *gedp, int argc, const char *argv[]) +ged_bo_core(struct ged *gedp, int argc, const char *argv[]) { int c; unsigned int minor_type=0; @@ -238,10 +238,29 @@ } +#ifdef GED_PLUGIN +#include "../include/plugin.h" +struct ged_cmd_impl bo_cmd_impl = { + "bo", + ged_bo_core, + GED_CMD_DEFAULT +}; + +const struct ged_cmd bo_cmd = { &bo_cmd_impl }; +const struct ged_cmd *bo_cmds[] = { &bo_cmd, NULL }; + +static const struct ged_plugin pinfo = { bo_cmds, 1 }; + +COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() +{ + return &pinfo; +} +#endif /* GED_PLUGIN */ + /* * Local Variables: + * mode: C * tab-width: 8 - * mode: C * indent-tabs-mode: t * c-file-style: "stroustrup" * End: Copied: brlcad/trunk/src/libged/bot/CMakeLists.txt (from rev 76465, brlcad/branches/gedplugins/src/libged/bot/CMakeLists.txt) =================================================================== --- brlcad/trunk/src/libged/bot/CMakeLists.txt (rev 0) +++ brlcad/trunk/src/libged/bot/CMakeLists.txt 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,47 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${BRLCAD_BINARY_DIR}/include + ${BRLCAD_SOURCE_DIR}/include + ${BU_INCLUDE_DIRS} + ${GED_INCLUDE_DIRS} + ) + +set(BOT_SRCS + bot_condense.c + bot.cpp + bot_decimate.c + bot_dump.c + bot_face_fuse.c + bot_face_sort.c + bot_flip.c + bot_fuse.c + bot_merge.c + bot_smooth.c + bot_split.c + bot_sync.c + bot_vertex_fuse.c + edbot.c + check.cpp + extrude.cpp + remesh.cpp + ) + +add_definitions(-DGED_PLUGIN) +ged_plugin_library(ged-bot SHARED ${BOT_SRCS}) +target_link_libraries(ged-bot libged libbu) +set_property(TARGET ged-bot APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) +VALIDATE_STYLE(ged-bot ${BOT_SRCS}) +PLUGIN_SETUP(ged-bot ged) + +CMAKEFILES( + CMakeLists.txt + ${BOT_SRCS} + ) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 + Modified: brlcad/trunk/src/libged/bot/bot.cpp =================================================================== --- brlcad/trunk/src/libged/bot/bot.cpp 2020-07-24 13:46:02 UTC (rev 76465) +++ brlcad/trunk/src/libged/bot/bot.cpp 2020-07-24 14:39:33 UTC (rev 76466) @@ -326,7 +326,7 @@ } extern "C" int -ged_bot(struct ged *gedp, int argc, const char *argv[]) +ged_bot_core(struct ged *gedp, int argc, const char *argv[]) { int help = 0; struct _ged_bot_info gb; @@ -434,11 +434,103 @@ return ret; } -// Local Variables: -// tab-width: 8 -// mode: C++ -// c-basic-offset: 4 -// indent-tabs-mode: t -// c-file-style: "stroustrup" -// End: -// ex: shiftwidth=4 tabstop=8 + +#ifdef GED_PLUGIN +#include "../include/plugin.h" +extern "C" { + struct ged_cmd_impl bot_cmd_impl = { "bot", ged_bot_core, GED_CMD_DEFAULT }; + const struct ged_cmd bot_cmd = { &bot_cmd_impl }; + + struct ged_cmd_impl bot_condense_cmd_impl = {"bot_condense", ged_bot_condense_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_condense_cmd = { &bot_condense_cmd_impl }; + + struct ged_cmd_impl bot_decimate_cmd_impl = {"bot_decimate", ged_bot_decimate_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_decimate_cmd = { &bot_decimate_cmd_impl }; + + struct ged_cmd_impl bot_dump_cmd_impl = {"bot_dump", ged_bot_dump_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_dump_cmd = { &bot_dump_cmd_impl }; + + struct ged_cmd_impl bot_face_fuse_cmd_impl = {"bot_face_fuse", ged_bot_face_fuse_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_face_fuse_cmd = { &bot_face_fuse_cmd_impl }; + + struct ged_cmd_impl bot_face_sort_cmd_impl = {"bot_face_sort", ged_bot_face_sort_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_face_sort_cmd = { &bot_face_sort_cmd_impl }; + + struct ged_cmd_impl bot_flip_cmd_impl = {"bot_flip", ged_bot_flip_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_flip_cmd = { &bot_flip_cmd_impl }; + + struct ged_cmd_impl bot_fuse_cmd_impl = {"bot_fuse", ged_bot_fuse_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_fuse_cmd = { &bot_fuse_cmd_impl }; + + struct ged_cmd_impl bot_merge_cmd_impl = {"bot_merge", ged_bot_merge_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_merge_cmd = { &bot_merge_cmd_impl }; + + struct ged_cmd_impl bot_smooth_cmd_impl = {"bot_smooth", ged_bot_smooth_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_smooth_cmd = { &bot_smooth_cmd_impl }; + + struct ged_cmd_impl bot_split_cmd_impl = {"bot_split", ged_bot_split_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_split_cmd = { &bot_split_cmd_impl }; + + struct ged_cmd_impl bot_sync_cmd_impl = {"bot_sync", ged_bot_sync_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_sync_cmd = { &bot_sync_cmd_impl }; + + struct ged_cmd_impl bot_vertex_fuse_cmd_impl = {"bot_vertex_fuse", ged_bot_vertex_fuse_core, GED_CMD_DEFAULT}; + const struct ged_cmd bot_vertex_fuse_cmd = { &bot_vertex_fuse_cmd_impl }; + + struct ged_cmd_impl dbot_dump_cmd_impl = {"dbot_dump", ged_dbot_dump_core, GED_CMD_DEFAULT}; + const struct ged_cmd dbot_dump_cmd = { &dbot_dump_cmd_impl }; + + struct ged_cmd_impl find_bot_edge_cmd_impl = {"find_bot_edge", ged_find_bot_edge_nearest_pnt_core, GED_CMD_DEFAULT}; + const struct ged_cmd find_bot_edge_cmd = { &find_bot_edge_cmd_impl }; + + struct ged_cmd_impl find_bot_pnt_cmd_impl = {"find_bot_pnt", ged_find_bot_pnt_nearest_pnt_core, GED_CMD_DEFAULT}; + const struct ged_cmd find_bot_pnt_cmd = { &find_bot_pnt_cmd_impl }; + + struct ged_cmd_impl get_bot_edges_cmd_impl = {"get_bot_edges", ged_get_bot_edges_core, GED_CMD_DEFAULT}; + const struct ged_cmd get_bot_edges_cmd = { &get_bot_edges_cmd_impl }; + + /* + struct ged_cmd_impl _cmd_impl = {"", , GED_CMD_DEFAULT}; + const struct ged_cmd _cmd = { &_cmd_impl }; + */ + + + const struct ged_cmd *bot_cmds[] = { + &bot_cmd, + &bot_condense_cmd, + &bot_decimate_cmd, + &bot_dump_cmd, + &bot_face_fuse_cmd, + &bot_face_sort_cmd, + &bot_flip_cmd, + &bot_fuse_cmd, + &bot_merge_cmd, + &bot_smooth_cmd, + &bot_split_cmd, + &bot_sync_cmd, + &bot_vertex_fuse_cmd, + &dbot_dump_cmd, + &find_bot_edge_cmd, + &find_bot_pnt_cmd, + &get_bot_edges_cmd, + NULL + }; + + static const struct ged_plugin pinfo = { bot_cmds, 17 }; + + COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info() + { + return &pinfo; + } +} +#endif + +/* + * Local Variables: + * tab-width: 8 + * mode: C + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Copied: brlcad/trunk/src/libged/bot/bot_condense.c (from rev 76465, brlcad/branches/gedplugins/src/libged/bot/bot_condense.c) =================================================================== --- brlcad/trunk/src/libged/bot/bot_condense.c (rev 0) +++ brlcad/trunk/src/libged/bot/bot_condense.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,92 @@ +/* B O T _ C O N D E N S E . C + * BRL-CAD + * + * Copyright (c) 2008-2020 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file libged/bot_condense.c + * + * The bot_condense command. + * + */ + +#include "common.h" + +#include <stdlib.h> +#include <ctype.h> +#include <string.h> + +#include "rt/geom.h" + +#include "../ged_private.h" + + +int +ged_bot_condense_core(struct ged *gedp, int argc, const char *argv[]) +{ + struct directory *old_dp, *new_dp; + struct rt_db_internal intern; + struct rt_bot_internal *bot; + int count2=0; + static const char *usage = "new_bot old_bot"; + + GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR); + GED_CHECK_READ_ONLY(gedp, GED_ERROR); + GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR); + + /* initialize result */ + bu_vls_trunc(gedp->ged_result_str, 0); + + /* must be wanting help */ + if (argc == 1) { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_HELP; + } + + if (argc != 3) { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_ERROR; + } + + GED_DB_LOOKUP(gedp, old_dp, argv[2], LOOKUP_NOISY, GED_ERROR & GED_QUIET); + GED_DB_GET_INTERNAL(gedp, &intern, old_dp, bn_mat_identity, &rt_uniresource, GED_ERROR); + + if (intern.idb_major_type != DB5_MAJORTYPE_BRLCAD || intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_BOT) { + bu_vls_printf(gedp->ged_result_str, "%s: %s is not a BOT solid!\n", argv[0], argv[2]); + return GED_ERROR; + } + + bot = (struct rt_bot_internal *)intern.idb_ptr; + RT_BOT_CK_MAGIC(bot); + + count2 = rt_bot_condense(bot); + bu_vls_printf(gedp->ged_result_str, "%s: %d dead vertices eliminated\n", argv[0], count2); + + GED_DB_DIRADD(gedp, new_dp, argv[1], RT_DIR_PHONY_ADDR, 0, RT_DIR_SOLID, (void *)&intern.idb_type, GED_ERROR); + GED_DB_PUT_INTERNAL(gedp, new_dp, &intern, &rt_uniresource, GED_ERROR); + + return GED_OK; +} + +/* + * Local Variables: + * mode: C + * tab-width: 8 + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Copied: brlcad/trunk/src/libged/bot/bot_decimate.c (from rev 76465, brlcad/branches/gedplugins/src/libged/bot/bot_decimate.c) =================================================================== --- brlcad/trunk/src/libged/bot/bot_decimate.c (rev 0) +++ brlcad/trunk/src/libged/bot/bot_decimate.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,201 @@ +/* B O T _ D E C I M A T E . C + * BRL-CAD + * + * Copyright (c) 2008-2020 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file libged/bot_decimate.c + * + * The bot_decimate command. + * + */ + +#include "common.h" + +#include <stdlib.h> +#include <ctype.h> +#include <string.h> + +#include "bu/getopt.h" +#include "rt/geom.h" +#include "ged.h" + + +int +ged_bot_decimate_core(struct ged *gedp, int argc, const char *argv[]) +{ + int c; + struct rt_db_internal intern; + struct rt_bot_internal *bot; + struct directory *dp; + fastf_t max_chord_error = -1.0; + fastf_t max_normal_error = -1.0; + fastf_t min_edge_length = -1.0; + fastf_t feature_size = -1.0; + static const char *usage = "-f feature_size (to use the newer GCT decimator)" + "\nOR: -c maximum_chord_error -n maximum_normal_error -e minimum_edge_length new_bot_name current_bot_name"; + + GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR); + GED_CHECK_READ_ONLY(gedp, GED_ERROR); + GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR); + + /* initialize result */ + bu_vls_trunc(gedp->ged_result_str, 0); + + /* must be wanting help */ + if (argc == 1) { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_HELP; + } + + if (argc < 5 || argc > 9) { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_ERROR; + } + + /* process args */ + bu_optind = 1; + bu_opterr = 0; + + while ((c = bu_getopt(argc, (char * const *)argv, "c:n:e:f:")) != -1) { + switch (c) { + case 'c': + max_chord_error = atof(bu_optarg); + + if (max_chord_error < 0.0) { + bu_vls_printf(gedp->ged_result_str, + "Maximum chord error cannot be less than zero"); + return GED_ERROR; + } + + break; + + case 'n': + max_normal_error = atof(bu_optarg); + + if (max_normal_error < 0.0) { + bu_vls_printf(gedp->ged_result_str, + "Maximum normal error cannot be less than zero"); + return GED_ERROR; + } + + break; + + case 'e': + min_edge_length = atof(bu_optarg); + + if (min_edge_length < 0.0) { + bu_vls_printf(gedp->ged_result_str, + "minimum edge length cannot be less than zero"); + return GED_ERROR; + } + + break; + + case 'f': + feature_size = atof(bu_optarg); + + if (feature_size < 0.0) { + bu_vls_printf(gedp->ged_result_str, + "minimum feature size cannot be less than zero"); + return GED_ERROR; + } + + break; + + default: { + bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage); + return GED_ERROR; + } + } + } + + if (feature_size >= 0.0 && (max_chord_error >= 0.0 || max_normal_error >= 0.0 || min_edge_length >= 0.0)) { + bu_vls_printf(gedp->ged_result_str, "-f may not be used with -c, -n, or -e"); + return GED_ERROR; + } + + argc -= bu_optind; + argv += bu_optind; + + /* make sure new solid does not already exist */ + GED_CHECK_EXISTS(gedp, argv[0], LOOKUP_QUIET, GED_ERROR); + + /* make sure current solid does exist */ + GED_DB_LOOKUP(gedp, dp, argv[1], LOOKUP_QUIET, GED_ERROR); + + /* import the current solid */ + RT_DB_INTERNAL_INIT(&intern); + GED_DB_GET_INTERNAL(gedp, &intern, dp, NULL, gedp->ged_wdbp->wdb_resp, GED_ERROR); + + /* make sure this is a BOT solid */ + if (intern.idb_major_type != DB5_MAJORTYPE_BRLCAD || intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_BOT) { + bu_vls_printf(gedp->ged_result_str, "%s is not a BOT solid\n", argv[1]); + rt_db_free_internal(&intern); + return GED_ERROR; + } + + bot = (struct rt_bot_internal *)intern.idb_ptr; + + RT_BOT_CK_MAGIC(bot); + + /* convert maximum error, edge length, and feature size to mm */ + if (max_chord_error > 0.0) { + max_chord_error = max_chord_error * gedp->ged_wdbp->dbip->dbi_local2base; + } + + if (min_edge_length > 0.0) { + min_edge_length = min_edge_length * gedp->ged_wdbp->dbip->dbi_local2base; + } + + if (feature_size >= 0.0) { + /* use the new GCT decimator */ + const size_t orig_num_faces = bot->num_faces; + size_t edges_removed; + feature_size *= gedp->ged_wdbp->dbip->dbi_local2base; + edges_removed = rt_bot_decimate_gct(bot, feature_size); + bu_log("original face count = %zu\n", orig_num_faces); + bu_log("\tedges removed = %zu\n", edges_removed); + bu_log("\tnew face count = %zu\n", bot->num_faces); + } else { + /* use the old decimator */ + if (rt_bot_decimate(bot, max_chord_error, max_normal_error, min_edge_length) < 0) { + bu_vls_printf(gedp->ged_result_str, "Decimation Error\n"); + rt_db_free_internal(&intern); + return GED_ERROR; + } + } + + /* save the result to the database */ + /* XXX - should this be rt_db_put_internal() instead? */ + if (wdb_put_internal(gedp->ged_wdbp, argv[0], &intern, 1.0) < 0) { + bu_vls_printf(gedp->ged_result_str, + "Failed to write decimated BOT back to database\n"); + return GED_ERROR; + } + + return GED_OK; +} + +/* + * Local Variables: + * mode: C + * tab-width: 8 + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Copied: brlcad/trunk/src/libged/bot/bot_dump.c (from rev 76465, brlcad/branches/gedplugins/src/libged/bot/bot_dump.c) =================================================================== --- brlcad/trunk/src/libged/bot/bot_dump.c (rev 0) +++ brlcad/trunk/src/libged/bot/bot_dump.c 2020-07-24 14:39:33 UTC (rev 76466) @@ -0,0 +1,1623 @@ +/* B O T _ D U M P . C + * BRL-CAD + * + * Copyright (c) 2008-2020 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file libged/bot_dump.c + * + * The bot_dump command. + * + */ + +#include "common.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <string.h> +#include <ctype.h> +#include "bio.h" +#include "bnetwork.h" + +#include "bu/cv.h" +#include "bu/getopt.h" +#include "bu/units.h" +#include "vmath.h" +#include "nmg.h" +#include "rt/geom.h" + +#include "raytrace.h" +#include "wdb.h" + +#include "brlcad_version.h" + +#include "raytrace.h" + +#include "dm/bview.h" +#include "dm.h" + +#include "../ged_private.h" + + +#define V3ARGS_SCALE(_a) (_a)[X]*cfactor, (_a)[Y]*cfactor, (_a)[Z]*cfactor + +static char usage[] = "[-b] [-n] [-m directory] [-o file] [-t dxf|obj|sat|stl] [-u units] [bot1 bot2 ...]"; + + +struct _ged_bot_dump_client_data { + struct ged *gedp; + FILE *fp; + int fd; + char *file_ext; +}; + + +struct _ged_obj_material { + struct bu_list l; + struct bu_vls name; + unsigned char r; + unsigned char g; + unsigned char b; + fastf_t a; +}; + + +static int using_dbot_dump; +struct bu_list HeadObjMaterials = BU_LIST_INIT_ZERO; +struct bu_vls obj_materials_file = BU_VLS_INIT_ZERO; +FILE *obj_materials_fp; +int num_obj_materials; +int curr_obj_red; +int curr_obj_green; +int curr_obj_blue; +fastf_t curr_obj_alpha; + +enum otype { + OTYPE_DXF = 1, + OTYPE_OBJ, + OTYPE_SAT, + OTYPE_STL +}; + +static enum otype output_type; +static int binary; +static int normals; +static fastf_t cfactor; +static char *output_file; /* output filename */ +static char *output_directory; /* directory name to hold output files */ +static unsigned int total_faces; +static int v_offset; +static int curr_line_num; + +static int curr_body_id; +static int curr_lump_id; +static int curr_shell_id; +static int curr_face_id; +static int curr_loop_id; +static int curr_edge_id; + +/* Byte swaps a four byte value */ +static void +lswap(unsigned int *v) +{ + unsigned int r; + + r =*v; + *v = ((r & 0xff) << 24) | ((r & 0xff00) << 8) | ((r & 0xff0000) >> 8) + | ((r & 0xff000000) >> 24); +} + + +static struct _ged_obj_material * +obj_get_material(int red, int green, int blue, fastf_t transparency) +{ + struct _ged_obj_material *gomp; + + for (BU_LIST_FOR(gomp, _ged_obj_material, &HeadObjMaterials)) { + if (gomp->r == red && + gomp->g == green && + gomp->b == blue && + ZERO(gomp->a - transparency)) { + return gomp; + } + } + + BU_GET(gomp, struct _ged_obj_material); + BU_LIST_APPEND(&HeadObjMaterials, &gomp->l); + gomp->r = red; + gomp->g = green; + gomp->b = blue; + gomp->a = transparency; + bu_vls_init(&gomp->name); + bu_vls_printf(&gomp->name, "matl_%d", ++num_obj_materials); + + /* Write out newmtl to mtl file */ + fprintf(obj_materials_fp, "newmtl %s\n", bu_vls_addr(&gomp->name)); + fprintf(obj_materials_fp, "Kd %f %f %f\n", + (fastf_t)gomp->r / 255.0, + (fastf_t)gomp->g / 255.0, + (fastf_t)gomp->b / 255.0); + fprintf(obj_materials_fp, "d %f\n", gomp->a); + fprintf(obj_materials_fp, "illum 1\n"); + + return gomp; +} + + +static void +obj_free_materials() { + struct _ged_obj_material *gomp; + + while (BU_LIST_WHILE(gomp, _ged_obj_material, &HeadObjMaterials)) { + BU_LIST_DEQUEUE(&gomp->l); + bu_vls_free(&gomp->name); + BU_PUT(gomp, struct _ged_obj_material); + } +} + + +static void +sat_write_header(FILE *fp) +{ + time_t now; + + /* SAT header consists of three lines: + * + * 1: SAT_version num_records num_objects history_boolean + * 2: strlen product_id_str strlen version_str strlen date_str + * 3: cnv_to_mm resabs_value resnor_value + * + * When num_records is zero, it looks for an end marker. + */ + fprintf(fp, "400 0 1 0\n"); + + time(&now); + fprintf(fp, "%ld BRL-CAD(%s)-bot_dump 16 ACIS 8.0 Unknown %ld %s", + (long)strlen(brlcad_version())+18, brlcad_version(), (long)strlen(ctime(&now)) - 1, ctime(&now)); + + /* FIXME: this includes abs tolerance info, should probably output ours */ + fprintf(fp, "1 9.9999999999999995e-007 1e-010\n"); +} + + +static void +sat_write_bot(struct rt_bot_internal *bot, FILE *fp, char *UNUSED(name)) +{ + int i, j; + fastf_t *vertices; + int *faces; + int first_vertex; + int first_coedge; + int first_face; + int num_vertices = bot->num_vertices; + int num_faces = bot->num_faces; + + vertices = bot->vertices; + faces = bot->faces; + + curr_body_id = curr_line_num; + curr_lump_id = curr_body_id + 1; + curr_shell_id = curr_lump_id + 1; + curr_face_id = curr_shell_id + 1 + num_vertices*2 + num_faces*6; + + fprintf(fp, "-%d body $-1 $%d $-1 $-1 #\n", curr_body_id, curr_lump_id); + fprintf(fp, "-%d lump $-1 $-1 $%d $%d #\n", curr_lump_id, curr_shell_id, curr_body_id); + fprintf(fp, "-%d shell $-1 $-1 $-1 $%d $-1 $%d #\n", curr_shell_id, curr_face_id, curr_lump_id); + + curr_line_num += 3; + + /* Dump out vertices */ + first_vertex = curr_line_num; + for (i = 0; i < num_vertices; i++) { + curr_edge_id = -1; + for (j = 0; j < num_faces; j++) { + if (faces[3*j]+first_vertex == curr_line_num) { + curr_edge_id = first_vertex + num_vertices*2 + num_faces*3 + j*3; + break; + } else if (faces[3*j+1]+first_vertex == curr_line_num) { + curr_edge_id = first_vertex + num_vertices*2 + num_faces*3 + j*3 + 1; + break; + } else if (faces[3*j+2]+first_vertex == curr_line_num) { + curr_edge_id = first_vertex + num_vertices*2 + num_faces*3 + j*3 + 2; + break; + } + } + + fprintf(fp, "-%d vertex $-1 $%d $%d #\n", curr_line_num, curr_edge_id, curr_line_num+num_vertices); + ++curr_line_num; + } + + /* Dump out points */ + for (i = 0; i < num_vertices; i++) { + fprintf(fp, "-%d point $-1 %f %f %f #\n", curr_line_num, V3ARGS_SCALE(&vertices[3*i])); + ++curr_line_num; + } + + /* Dump out coedges */ + first_coedge = curr_line_num; + curr_loop_id = first_coedge+num_faces*7; + for (i = 0; i < num_faces; i++) { + fprintf(fp, "-%d coedge $-1 $%d $%d $%d $%d forward $%d $-1 #\n", + curr_line_num, curr_line_num+1, curr_line_num+2, curr_line_num, + curr_line_num+num_faces*3, curr_loop_id); + ++curr_line_num; + fprintf(fp, "-%d coedge $-1 $%d $%d $%d $%d forward $%d $-1 #\n", + curr_line_num, curr_line_num+1, curr_line_num-1, curr_line_num, + curr_line_num+num_faces*3, curr_loop_id); + ++curr_line_num; + fprintf(fp, "-%d coedge $-1 $%d $%d $%d $%d forward $%d $-1 #\n", + curr_line_num, curr_line_num-2, curr_line_num-1, curr_line_num, + curr_line_num+num_faces*3, curr_loop_id); + ++curr_line_num; + ++curr_loop_id; + } + + /* Dump out edges */ + for (i = 0; i < num_faces; i++) { + fprintf(fp, "-%d edge $-1 $%d $%d $%d $%d forward #\n", curr_line_num, + faces[3*i]+first_vertex, faces[3*i+1]+first_vertex, + first_coedge + i*3, curr_line_num + num_faces*5); + ++curr_line_num; + fprintf(fp, "-%d edge $-1 $%d $%d $%d $%d forward #\n", curr_line_num, + faces[3*i+1]+first_vertex, faces[3*i+2]+first_vertex, + first_coedge + i*3 + 1, curr_line_num + num_faces*5); + ++curr_line_num; + fprintf(fp, "-%d edge $-1 $%d $%d $%d $%d forward #\n", curr_line_num, + faces[3*i+2]+first_vertex, faces[3*i]+first_vertex, + first_coedge + i*3 + 2, curr_line_num + num_faces*5); + ++curr_line_num; + } + + /* Dump out faces */ + first_face = curr_line_num; + for (i = 0; i < num_faces-1; i++) { + fprintf(fp, "-%d face $-1 $%d $%d $%d $-1 $%d forward single #\n", + curr_line_num, curr_line_num+1, curr_line_num+num_faces, + curr_shell_id, curr_line_num + num_faces*5); + ++curr_line_num; + } + fprintf(fp, "-%d face $-1 $-1 $%d $%d $-1 $%d forward single #\n", + curr_line_num, curr_line_num+num_faces, curr_shell_id, + curr_line_num + num_faces*5); + ++curr_line_num; + + /* Dump out loops */ + for (i = 0; i < num_faces; i++) { + fprintf(fp, "-%d loop $-1 $-1 $%d $%d #\n", + curr_line_num, first_coedge+i*3, first_face+i); + ++curr_line_num; + } + + /* Dump out straight-curves for each edge */ + for (i = 0; i < num_faces; i++) { + point_t A; + point_t B; + point_t C; + vect_t BmA; + vect_t CmB; + vect_t AmC; + int vi; + + vi = 3*faces[3*i]; + VSET(A, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+1]; + VSET(B, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+2]; + VSET(C, vertices[vi], vertices[vi+1], vertices[vi+2]); + VSUB2(BmA, B, A); + VSUB2(CmB, C, B); + VSUB2(AmC, A, C); + VUNITIZE(BmA); + VUNITIZE(CmB); + VUNITIZE(AmC); + + fprintf(fp, "-%d straight-curve $-1 %f %f %f %f %f %f I I #\n", curr_line_num, V3ARGS_SCALE(A), V3ARGS(BmA)); + ++curr_line_num; + fprintf(fp, "-%d straight-curve $-1 %f %f %f %f %f %f I I #\n", curr_line_num, V3ARGS_SCALE(B), V3ARGS(CmB)); + ++curr_line_num; + fprintf(fp, "-%d straight-curve $-1 %f %f %f %f %f %f I I #\n", curr_line_num, V3ARGS_SCALE(C), V3ARGS(AmC)); + ++curr_line_num; + } + + /* Dump out plane-surfaces for each face */ + for (i = 0; i < num_faces; i++) { + point_t A; + point_t B; + point_t C; + point_t center; + vect_t BmA; + vect_t CmA; + vect_t norm; + int vi; + fastf_t sf = 1.0/3.0; + + vi = 3*faces[3*i]; + VSET(A, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+1]; + VSET(B, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+2]; + VSET(C, vertices[vi], vertices[vi+1], vertices[vi+2]); + + VADD3(center, A, B, C); + VSCALE(center, center, sf); + + VSUB2(BmA, B, A); + VSUB2(CmA, C, A); + if (bot->orientation != RT_BOT_CW) { + VCROSS(norm, BmA, CmA); + } else { + VCROSS(norm, CmA, BmA); + } + VUNITIZE(norm); + + VUNITIZE(BmA); + + fprintf(fp, "-%d plane-surface $-1 %f %f %f %f %f %f %f %f %f forward_v I I I I #\n", + curr_line_num, V3ARGS_SCALE(A), V3ARGS(norm), V3ARGS(BmA)); + + ++curr_line_num; + } +} + + +static void +dxf_write_bot(struct rt_bot_internal *bot, FILE *fp, char *name) +{ + fastf_t *vertices; + int num_faces, *faces; + point_t A; + point_t B; + point_t C; + int i, vi; + + vertices = bot->vertices; + num_faces = bot->num_faces; + faces = bot->faces; + + for (i = 0; i < num_faces; i++) { + vi = 3*faces[3*i]; + VSET(A, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+1]; + VSET(B, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+2]; + VSET(C, vertices[vi], vertices[vi+1], vertices[vi+2]); + + VSCALE(A, A, cfactor); + VSCALE(B, B, cfactor); + VSCALE(C, C, cfactor); + + fprintf(fp, "0\n3DFACE\n8\n%s\n62\n7\n", name); + fprintf(fp, "%d\n%f\n%d\n%f\n%d\n%f\n", + 10, A[X], 20, A[Y], 30, A[Z]); + fprintf(fp, "%d\n%f\n%d\n%f\n%d\n%f\n", + 11, B[X], 21, B[Y], 31, B[Z]); + fprintf(fp, "%d\n%f\n%d\n%f\n%d\n%f\n", + 12, C[X], 22, C[Y], 32, C[Z]); + fprintf(fp, "%d\n%f\n%d\n%f\n%d\n%f\n", + 12, C[X], 22, C[Y], 32, C[Z]); + } + +} + + +static void +obj_write_bot(struct rt_bot_internal *bot, FILE *fp, char *name) +{ + int num_vertices; + fastf_t *vertices; + int num_faces, *faces; + point_t A; + point_t B; + point_t C; + vect_t BmA; + vect_t CmA; + vect_t norm; + int i, vi; + struct _ged_obj_material *gomp; + + if (using_dbot_dump) { + gomp = obj_get_material(curr_obj_red, + curr_obj_green, + curr_obj_blue, + curr_obj_alpha); + fprintf(fp, "usemtl %s\n", bu_vls_addr(&gomp->name)); + } + + num_vertices = bot->num_vertices; + vertices = bot->vertices; + num_faces = bot->num_faces; + faces = bot->faces; + + fprintf(fp, "g %s\n", name); + + for (i = 0; i < num_vertices; i++) { + fprintf(fp, "v %f %f %f\n", V3ARGS_SCALE(&vertices[3*i])); + } + + if (normals) { + for (i = 0; i < num_faces; i++) { + vi = 3*faces[3*i]; + VSET(A, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+1]; + VSET(B, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+2]; + VSET(C, vertices[vi], vertices[vi+1], vertices[vi+2]); + + VSUB2(BmA, B, A); + VSUB2(CmA, C, A); + if (bot->orientation != RT_BOT_CW) { + VCROSS(norm, BmA, CmA); + } else { + VCROSS(norm, CmA, BmA); + } + VUNITIZE(norm); + + fprintf(fp, "vn %f %f %f\n", V3ARGS(norm)); + } + } + + if (normals) { + for (i = 0; i < num_faces; i++) { + fprintf(fp, "f %d//%d %d//%d %d//%d\n", faces[3*i]+v_offset, i+1, faces[3*i+1]+v_offset, i+1, faces[3*i+2]+v_offset, i+1); + } + } else { + for (i = 0; i < num_faces; i++) { + fprintf(fp, "f %d %d %d\n", faces[3*i]+v_offset, faces[3*i+1]+v_offset, faces[3*i+2]+v_offset); + } + } + + v_offset += num_vertices; +} + + +static void +stl_write_bot(struct rt_bot_internal *bot, FILE *fp, char *name) +{ + fastf_t *vertices; + int num_faces, *faces; + point_t A; + point_t B; + point_t C; + vect_t BmA; + vect_t CmA; + vect_t norm; + int i, vi; + + vertices = bot->vertices; + num_faces = bot->num_faces; + faces = bot->faces; + + fprintf(fp, "solid %s\n", name); + for (i = 0; i < num_faces; i++) { + vi = 3*faces[3*i]; + VSET(A, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+1]; + VSET(B, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+2]; + VSET(C, vertices[vi], vertices[vi+1], vertices[vi+2]); + + VSUB2(BmA, B, A); + VSUB2(CmA, C, A); + if (bot->orientation != RT_BOT_CW) { + VCROSS(norm, BmA, CmA); + } else { + VCROSS(norm, CmA, BmA); + } + VUNITIZE(norm); + + fprintf(fp, " facet normal %f %f %f\n", V3ARGS(norm)); + fprintf(fp, " outer loop\n"); + fprintf(fp, " vertex %f %f %f\n", V3ARGS_SCALE(A)); + fprintf(fp, " vertex %f %f %f\n", V3ARGS_SCALE(B)); + fprintf(fp, " vertex %f %f %f\n", V3ARGS_SCALE(C)); + fprintf(fp, " endloop\n"); + fprintf(fp, " endfacet\n"); + } + fprintf(fp, "endsolid %s\n", name); +} + + +static void +stl_write_bot_binary(struct rt_bot_internal *bot, int fd, char *UNUSED(name)) +{ + fastf_t *vertices; + size_t num_faces; + int *faces; + point_t A; + point_t B; + point_t C; + vect_t BmA; + vect_t CmA; + vect_t norm; + unsigned long i, j, vi; + + vertices = bot->vertices; + num_faces = bot->num_faces; + faces = bot->faces; + + /* Write out the vertex data for each triangle */ + for (i = 0; (size_t)i < num_faces; i++) { + float flts[12]; + float *flt_ptr; + unsigned char vert_buffer[50]; + int ret; + + vi = 3*faces[3*i]; + VSET(A, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+1]; + VSET(B, vertices[vi], vertices[vi+1], vertices[vi+2]); + vi = 3*faces[3*i+2]; + VSET(C, vertices[vi], vertices[vi+1], vertices[vi+2]); + + VSUB2(BmA, B, A); + VSUB2(CmA, C, A); + if (bot->orientation != RT_BOT_CW) { + VCROSS(norm, BmA, CmA); + } else { + VCROSS(norm, CmA, BmA); + } + VUNITIZE(norm); + + VSCALE(A, A, cfactor); + VSCALE(B, B, cfactor); + VSCALE(C, C, cfactor); + @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits