Revision: 65513
          http://sourceforge.net/p/brlcad/code/65513
Author:   ejno
Date:     2015-07-01 19:28:43 +0000 (Wed, 01 Jul 2015)
Log Message:
-----------
remove wdb_bot_decimate() (unused duplicate of ged_decimate())

Modified Paths:
--------------
    brlcad/trunk/src/mged/wdb_obj.c

Modified: brlcad/trunk/src/mged/wdb_obj.c
===================================================================
--- brlcad/trunk/src/mged/wdb_obj.c     2015-07-01 18:52:35 UTC (rev 65512)
+++ brlcad/trunk/src/mged/wdb_obj.c     2015-07-01 19:28:43 UTC (rev 65513)
@@ -1626,148 +1626,6 @@
 
 
 int
-wdb_bot_decimate_cmd(struct rt_wdb *wdbp,
-                    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;
-
-    if (argc < 5 || argc > 9) {
-       struct bu_vls vls;
-
-       bu_vls_init(&vls);
-       bu_vls_printf(&vls, "helplib_alias wdb_bot_decimate %s", argv[0]);
-       Tcl_Eval(wdbp->wdb_interp, bu_vls_addr(&vls));
-       bu_vls_free(&vls);
-       return TCL_ERROR;
-    }
-
-    /* process args */
-    bu_optind = 1;
-    bu_opterr = 0;
-    while ((c=bu_getopt(argc, (char * const *)argv, "c:n:e:")) != -1) {
-       switch (c) {
-           case 'c':
-               max_chord_error = atof(bu_optarg);
-               if (max_chord_error < 0.0) {
-                   Tcl_AppendResult(wdbp->wdb_interp,
-                                    "Maximum chord error cannot be less than 
zero",
-                                    (char *)NULL);
-                   return TCL_ERROR;
-               }
-               break;
-           case 'n':
-               max_normal_error = atof(bu_optarg);
-               if (max_normal_error < 0.0) {
-                   Tcl_AppendResult(wdbp->wdb_interp,
-                                    "Maximum normal error cannot be less than 
zero",
-                                    (char *)NULL);
-                   return TCL_ERROR;
-               }
-               break;
-           case 'e':
-               min_edge_length = atof(bu_optarg);
-               if (min_edge_length < 0.0) {
-                   Tcl_AppendResult(wdbp->wdb_interp,
-                                    "minimum edge length cannot be less than 
zero",
-                                    (char *)NULL);
-                   return TCL_ERROR;
-               }
-               break;
-           default:
-               {
-                   struct bu_vls vls;
-
-                   bu_vls_init(&vls);
-                   bu_vls_printf(&vls, "helplib_alias wdb_bot_decimate %s",
-                                 argv[0]);
-                   Tcl_Eval(wdbp->wdb_interp, bu_vls_addr(&vls));
-                   bu_vls_free(&vls);
-                   return TCL_ERROR;
-               }
-       }
-    }
-
-    argc -= bu_optind;
-    argv += bu_optind;
-
-    /* make sure new solid does not already exist */
-    dp = db_lookup(wdbp->dbip, argv[0], LOOKUP_QUIET);
-    if (dp != RT_DIR_NULL) {
-       Tcl_AppendResult(wdbp->wdb_interp, argv[0], " already exists!!\n", 
(char *)NULL);
-       return TCL_ERROR;
-    }
-
-    /* make sure current solid does exist */
-    dp = db_lookup(wdbp->dbip, argv[1], LOOKUP_QUIET);
-    if (dp == RT_DIR_NULL) {
-       Tcl_AppendResult(wdbp->wdb_interp, argv[1], " Does not exist\n", (char 
*)NULL);
-       return TCL_ERROR;
-    }
-
-    /* import the current solid */
-    RT_DB_INTERNAL_INIT(&intern);
-    if (rt_db_get_internal(&intern, dp, wdbp->dbip, NULL, wdbp->wdb_resp) < 0) 
{
-       Tcl_AppendResult(wdbp->wdb_interp, "Failed to get internal form of ", 
argv[1],
-                        "\n", (char *)NULL);
-       return TCL_ERROR;
-    }
-
-    /* make sure this is a BOT solid */
-    if (intern.idb_major_type != DB5_MAJORTYPE_BRLCAD ||
-       intern.idb_minor_type != DB5_MINORTYPE_BRLCAD_BOT) {
-       Tcl_AppendResult(wdbp->wdb_interp, argv[1], " is not a BOT solid\n", 
(char *)NULL);
-       rt_db_free_internal(&intern);
-       return TCL_ERROR;
-    }
-
-    bot = (struct rt_bot_internal *)intern.idb_ptr;
-
-    RT_BOT_CK_MAGIC(bot);
-
-    /* convert maximum error and edge length to mm */
-    max_chord_error = max_chord_error * wdbp->dbip->dbi_local2base;
-    min_edge_length = min_edge_length * wdbp->dbip->dbi_local2base;
-
-    /* do the decimation */
-    if (rt_bot_decimate(bot, max_chord_error, max_normal_error, 
min_edge_length) < 0) {
-       Tcl_AppendResult(wdbp->wdb_interp, "Decimation Error\n", (char *)NULL);
-       rt_db_free_internal(&intern);
-       return TCL_ERROR;
-    }
-
-    /* save the result to the database */
-    if (wdb_put_internal(wdbp, argv[0], &intern, 1.0) < 0) {
-       Tcl_AppendResult(wdbp->wdb_interp, "Failed to write decimated BOT back 
to database\n", (char *)NULL);
-       return TCL_ERROR;
-    }
-
-    return TCL_OK;
-}
-
-
-/*
- * Usage:
- * procname
- */
-static int
-wdb_bot_decimate_tcl(void *clientData,
-                    int argc,
-                    const char *argv[])
-{
-    struct rt_wdb *wdbp = (struct rt_wdb *)clientData;
-
-    return wdb_bot_decimate_cmd(wdbp, argc-1, argv+1);
-}
-
-
-int
 wdb_move_arb_edge_cmd(struct rt_wdb *wdbp,
                      int argc,
                      const char *argv[])
@@ -10357,7 +10215,6 @@
     {"attr",           wdb_attr_tcl},
     {"bo",             wdb_bo_tcl},
     {"bot_face_sort",  wdb_bot_face_sort_tcl},
-    {"bot_decimate",   wdb_bot_decimate_tcl},
     {"c",              wdb_comb_std_tcl},
     {"cat",            wdb_cat_tcl},
     {"comb",           wdb_comb_tcl},

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to