Skip to content

Commit

Permalink
Make the db_search_context container private
Browse files Browse the repository at this point in the history
Ultimately most of the utility of db_search_context is internal, for passing
data around the implementation.  The caller can just pass in the callback and
data directly to db_search and let the implementation manage it internally as
it pleases.
  • Loading branch information
starseeker committed Nov 25, 2024
1 parent 7392e07 commit 2a0a53f
Show file tree
Hide file tree
Showing 25 changed files with 163 additions and 155 deletions.
18 changes: 7 additions & 11 deletions include/rt/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@

__BEGIN_DECLS

/**
* @brief Execution context for the -exec filter.
*/
struct db_search_context {
bu_clbk_t clbk; /**< @brief A function that evaluates an array of strings and returns a boolean. */
void *u1; /**< @brief A pointer that will be passed to the callback. */
void *u2; /**< @brief A pointer that will be passed to the callback. */
};

/**
* @brief Search for objects in a geometry database using filters
*
Expand Down Expand Up @@ -76,8 +67,11 @@ struct db_search_context {
* @param dbip The database instance pointer corresponding to the
* current geometry database.
*
* @param ctx Context for -exec. Can be NULL if there are no -exec filters present.
* @param clbk Optional callback function to call for -exec
*
* @param u1 Optional user data pointer
*
* @param u2 Optional user data pointer
*
* @return Negative return values indicate a problem with the search,
* and non-negative values indicate a successful search. Non-negative
Expand Down Expand Up @@ -118,7 +112,9 @@ RT_EXPORT extern int db_search(struct bu_ptbl *results,
int path_c,
struct directory **path_v,
struct db_i *dbip,
struct db_search_context *ctx
bu_clbk_t clbk,
void *u1,
void *u2
);

/* These are the possible search flags. */
Expand Down
6 changes: 3 additions & 3 deletions src/conv/step/g-step/Trees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Comb_Tree_to_STEP(struct directory *dp, struct rt_wdb *wdbp, AP203_Contents *sc)
const char *solid_search = "! -type comb";
struct bu_ptbl breps = BU_PTBL_INIT_ZERO;

(void)db_search(&breps, DB_SEARCH_RETURN_UNIQ_DP, solid_search, 1, &dp, wdbp->dbip, NULL);
(void)db_search(&breps, DB_SEARCH_RETURN_UNIQ_DP, solid_search, 1, &dp, wdbp->dbip, NULL, NULL, NULL);
for (int j = (int)BU_PTBL_LEN(&breps) - 1; j >= 0; j--) {
struct directory *curr_dp = (struct directory *)BU_PTBL_GET(&breps, j);
struct rt_db_internal solid_intern;
Expand All @@ -74,7 +74,7 @@ Comb_Tree_to_STEP(struct directory *dp, struct rt_wdb *wdbp, AP203_Contents *sc)
const char *comb_search = "-type comb";
struct bu_ptbl combs = BU_PTBL_INIT_ZERO;

(void)db_search(&combs, DB_SEARCH_RETURN_UNIQ_DP, comb_search, 1, &dp, wdbp->dbip, NULL);
(void)db_search(&combs, DB_SEARCH_RETURN_UNIQ_DP, comb_search, 1, &dp, wdbp->dbip, NULL, NULL, NULL);
for (int j = (int)BU_PTBL_LEN(&combs) - 1; j >= 0; j--) {
struct directory *curr_dp = (struct directory *)BU_PTBL_GET(&combs, j);
int is_wrapper = !Comb_Is_Wrapper(curr_dp, wdbp);
Expand Down Expand Up @@ -126,7 +126,7 @@ Comb_Tree_to_STEP(struct directory *dp, struct rt_wdb *wdbp, AP203_Contents *sc)
struct bu_ptbl comb_children = BU_PTBL_INIT_ZERO;
struct directory *ccs_dp = (*it);

(void)db_search(&comb_children, DB_SEARCH_RETURN_UNIQ_DP, comb_children_search, 1, &ccs_dp, wdbp->dbip, NULL);
(void)db_search(&comb_children, DB_SEARCH_RETURN_UNIQ_DP, comb_children_search, 1, &ccs_dp, wdbp->dbip, NULL, NULL, NULL);
Add_Assembly_Product((*it), wdbp->dbip, &comb_children, sc);
db_search_free(&comb_children);
}
Expand Down
14 changes: 7 additions & 7 deletions src/gtools/gdiff/gdiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ do_diff(struct db_i *left_dbip, struct db_i *right_dbip, struct diff_state *stat
struct bu_ptbl right_dbip_filtered = BU_PTBL_INIT_ZERO;
s_flags |= DB_SEARCH_HIDDEN;
s_flags |= DB_SEARCH_RETURN_UNIQ_DP;
(void)db_search(&left_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL);
(void)db_search(&right_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, right_dbip, NULL);
(void)db_search(&left_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL, NULL, NULL);
(void)db_search(&right_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, right_dbip, NULL, NULL, NULL);

BU_PTBL_INIT(&results_filtered);
for (i = 0; i < (int)BU_PTBL_LEN(&results); i++) {
Expand Down Expand Up @@ -134,8 +134,8 @@ do_diff(struct db_i *left_dbip, struct db_i *right_dbip, struct diff_state *stat
s_flags |= DB_SEARCH_HIDDEN;
s_flags |= DB_SEARCH_RETURN_UNIQ_DP;

(void)db_search(&left_dbip3_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL);
(void)db_search(&right_dbip3_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, right_dbip, NULL);
(void)db_search(&left_dbip3_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL, NULL, NULL);
(void)db_search(&right_dbip3_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, right_dbip, NULL, NULL, NULL);

BU_PTBL_INIT(&diff3_results_filtered);
for (i = 0; i < (int)BU_PTBL_LEN(&diff3_results); i++) {
Expand Down Expand Up @@ -201,9 +201,9 @@ do_diff3(struct db_i *left_dbip, struct db_i *ancestor_dbip, struct db_i *right_
struct bu_ptbl right_dbip_filtered = BU_PTBL_INIT_ZERO;
s_flags |= DB_SEARCH_HIDDEN;
s_flags |= DB_SEARCH_RETURN_UNIQ_DP;
(void)db_search(&left_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL);
(void)db_search(&ancestor_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL);
(void)db_search(&right_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, right_dbip, NULL);
(void)db_search(&left_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL, NULL, NULL);
(void)db_search(&ancestor_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, left_dbip, NULL, NULL, NULL);
(void)db_search(&right_dbip_filtered, s_flags, (const char *)bu_vls_addr(state->search_filter), 0, NULL, right_dbip, NULL, NULL, NULL);

BU_PTBL_INIT(&results_filtered);
for (i = 0; i < (int)BU_PTBL_LEN(&results); i++) {
Expand Down
12 changes: 6 additions & 6 deletions src/gtools/gist/InformationGatherer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ InformationGatherer::getNumEntities(std::string component)
// TODO/NOTE: is union the best heuristic for 'entities'?
struct directory* dp = db_lookup(g->dbip, component.c_str(), LOOKUP_QUIET);
const char* filter = "-bool u";
int entities = db_search(NULL, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, filter, 1, &dp, g->dbip, NULL);
int entities = db_search(NULL, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, filter, 1, &dp, g->dbip, NULL, NULL, NULL);

return entities > 0 ? entities : 0; // clamp errors to 0
}
Expand Down Expand Up @@ -488,7 +488,7 @@ InformationGatherer::gatherInformation(std::string UNUSED(name))
int totalEntities = 0;
// gather groups and regions
const char* sFilter = "-above -type region";
if (db_search(&results, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, sFilter, 1, &dp, g->dbip, NULL) >= 0) {
if (db_search(&results, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, sFilter, 1, &dp, g->dbip, NULL, NULL, NULL) >= 0) {
res_len = BU_PTBL_LEN(&results);
infoMap["assemblies"] = std::to_string(res_len);
totalEntities += res_len;
Expand All @@ -497,7 +497,7 @@ InformationGatherer::gatherInformation(std::string UNUSED(name))
res_len = 0;
// gather primitive shapes
sFilter = "-not -type region -and -not -type comb";
if (db_search(&results, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, sFilter, 1, &dp, g->dbip, NULL) >= 0) {
if (db_search(&results, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, sFilter, 1, &dp, g->dbip, NULL, NULL, NULL) >= 0) {
res_len = BU_PTBL_LEN(&results);
infoMap["primitives"] = std::to_string(res_len);
totalEntities += res_len;
Expand All @@ -506,7 +506,7 @@ InformationGatherer::gatherInformation(std::string UNUSED(name))
res_len = 0;
// gather primitive shapes
sFilter = "-type region";
if (db_search(&results, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, sFilter, 1, &dp, g->dbip, NULL) >= 0) {
if (db_search(&results, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, sFilter, 1, &dp, g->dbip, NULL, NULL, NULL) >= 0) {
res_len = BU_PTBL_LEN(&results);
infoMap["regions"] = std::to_string(res_len);
totalEntities += res_len;
Expand Down Expand Up @@ -563,11 +563,11 @@ InformationGatherer::gatherInformation(std::string UNUSED(name))
bool hasImplicit = false;
const char* tfilter = "-type brep -or -type bot -or -type vol -or -type sketch";

if (db_search(NULL, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, tfilter, 1, &dp, g->dbip, NULL) > 0) {
if (db_search(NULL, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, tfilter, 1, &dp, g->dbip, NULL, NULL, NULL) > 0) {
hasExplicit = true;
}
tfilter = "-below -type region -not -type comb -not -type brep -not -type bot -not -type vol -not -type sketch";
if (db_search(NULL, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, tfilter, 1, &dp, g->dbip, NULL) > 0) {
if (db_search(NULL, DB_SEARCH_HIDDEN | DB_SEARCH_QUIET, tfilter, 1, &dp, g->dbip, NULL, NULL, NULL) > 0) {
hasImplicit = true;
}

Expand Down
12 changes: 6 additions & 6 deletions src/libgcv/plugins/rhino/rhino_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ polish_output(const gcv_opts& gcv_options, db_i& db, rt_wdb& wdb)
if (0 > db_search(&found, DB_SEARCH_RETURN_UNIQ_DP,
(std::string() +
"-attr rhino::type=ON_Layer -or ( ( -attr rhino::type=ON_InstanceDefinition -or -attr rhino::type=ON_InstanceRef ) -not -name IDef* -not -name "
+ gcv_options.default_name + "* )").c_str(), 0, NULL, &db, NULL))
+ gcv_options.default_name + "* )").c_str(), 0, NULL, &db, NULL, NULL, NULL))
bu_bomb("db_search() failed");

const char * const ignored_attributes[] = {"rhino::type", "rhino::uuid"};
Expand All @@ -906,11 +906,11 @@ polish_output(const gcv_opts& gcv_options, db_i& db, rt_wdb& wdb)
// Set region flags, add .r suffix to regions if not already present
renamed.clear();
const char *reg_search = "-type comb -above=1 -type shape";
if (0 > db_search(&found, DB_SEARCH_RETURN_UNIQ_DP, reg_search, 0, NULL, &db, NULL))
if (0 > db_search(&found, DB_SEARCH_RETURN_UNIQ_DP, reg_search, 0, NULL, &db, NULL, NULL, NULL))
bu_bomb("db_search() failed");
bu_ptbl found_instances = BU_PTBL_INIT_ZERO;
AutoPtr<bu_ptbl, db_search_free> autofree_found_instances(&found_instances);
if (0 > db_search(&found_instances, DB_SEARCH_TREE, reg_search, 0, NULL, &db, NULL))
if (0 > db_search(&found_instances, DB_SEARCH_TREE, reg_search, 0, NULL, &db, NULL, NULL, NULL))
bu_bomb("db_search() failed");

if (BU_PTBL_LEN(&found)) {
Expand Down Expand Up @@ -963,7 +963,7 @@ polish_output(const gcv_opts& gcv_options, db_i& db, rt_wdb& wdb)
BU_PTBL_INIT(&found);

renamed.clear();
if (0 > db_search(&found, DB_SEARCH_TREE, "-type shape", 0, NULL, &db, NULL))
if (0 > db_search(&found, DB_SEARCH_TREE, "-type shape", 0, NULL, &db, NULL, NULL, NULL))
bu_bomb("db_search() failed");

if (BU_PTBL_LEN(&found)) {
Expand Down Expand Up @@ -1024,7 +1024,7 @@ polish_output(const gcv_opts& gcv_options, db_i& db, rt_wdb& wdb)
BU_PTBL_INIT(&found);

if (0 > db_search(&found, DB_SEARCH_RETURN_UNIQ_DP,
"-attr rhino::type=ON_InstanceDefinition -not -below -type comb", 0, NULL, &db, NULL))
"-attr rhino::type=ON_InstanceDefinition -not -below -type comb", 0, NULL, &db, NULL, NULL, NULL))
bu_bomb("db_search() failed");

if (BU_PTBL_LEN(&found)) {
Expand All @@ -1042,7 +1042,7 @@ polish_output(const gcv_opts& gcv_options, db_i& db, rt_wdb& wdb)
BU_PTBL_INIT(&found);

if (0 > db_search(&found, DB_SEARCH_TREE,
"-type shape -not -below -type region", 0, NULL, &db, NULL))
"-type shape -not -below -type region", 0, NULL, &db, NULL, NULL, NULL))
bu_bomb("db_search() failed");

if (BU_PTBL_LEN(&found)) {
Expand Down
2 changes: 1 addition & 1 deletion src/libged/analyze/op_pnts_vol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ op_pnts_vol(
* non non-volumetric object types in its hierarchy. If
* there is such an object, abandon the test. */
const char *tfilter = "! -type shape";
if (db_search(NULL, DB_SEARCH_QUIET, tfilter, 1, &dp, gedp->dbip, NULL) > 0) {
if (db_search(NULL, DB_SEARCH_QUIET, tfilter, 1, &dp, gedp->dbip, NULL, NULL, NULL) > 0) {
bu_vls_printf(gedp->ged_result_str, "Non-solid object found in %s, aborting\n", vol_obj);
rt_db_free_internal(&tpnts_intern);
return -1;
Expand Down
2 changes: 1 addition & 1 deletion src/libged/brep/brep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ _brep_cmd_dump(void *bs, int argc, const char **argv)
struct bu_ptbl breps = BU_PTBL_INIT_ZERO;
const char *brep_search = "-type brep";
db_update_nref(gedp->dbip, &rt_uniresource);
(void)db_search(&breps, DB_SEARCH_TREE, brep_search, 1, &gb->dp, gedp->dbip, NULL);
(void)db_search(&breps, DB_SEARCH_TREE, brep_search, 1, &gb->dp, gedp->dbip, NULL, NULL, NULL);
for (size_t i = 0; i < BU_PTBL_LEN(&breps); i++) {
struct db_full_path *fp = (struct db_full_path *)BU_PTBL_GET(&breps, i);
mat_t m;
Expand Down
2 changes: 1 addition & 1 deletion src/libged/brep/tikz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ brep_tikz(struct _ged_brep_info *gb, const char *outfile)
struct bu_ptbl breps = BU_PTBL_INIT_ZERO;
const char *brep_search = "-type brep";
db_update_nref(gedp->dbip, &rt_uniresource);
(void)db_search(&breps, DB_SEARCH_TREE|DB_SEARCH_RETURN_UNIQ_DP, brep_search, 1, &gb->dp, gedp->dbip, NULL);
(void)db_search(&breps, DB_SEARCH_TREE|DB_SEARCH_RETURN_UNIQ_DP, brep_search, 1, &gb->dp, gedp->dbip, NULL, NULL, NULL);
for(size_t i = 0; i < BU_PTBL_LEN(&breps); i++) {
struct rt_db_internal bintern;
struct rt_brep_internal *b_ip = NULL;
Expand Down
16 changes: 8 additions & 8 deletions src/libged/comb/comb.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,15 @@ comb_flatten(struct ged *gedp, struct directory *dp)
struct directory **dp_curr;

/* if there are non-union booleans in this comb's tree, error out */
result_cnt = db_search(NULL, DB_SEARCH_TREE, only_unions_in_tree_plan, 1, &dp, gedp->dbip, NULL);
result_cnt = db_search(NULL, DB_SEARCH_TREE, only_unions_in_tree_plan, 1, &dp, gedp->dbip, NULL, NULL, NULL);
if (result_cnt) {
bu_vls_printf(gedp->ged_result_str, "ERROR: %s tree contains non-union booleans", dp->d_namep);
return BRLCAD_ERROR;
}

/* Find the solids and combs in the tree */
(void)db_search(&solids, DB_SEARCH_RETURN_UNIQ_DP, solids_in_tree_plan, 1, &dp, gedp->dbip, NULL);
(void)db_search(&combs, DB_SEARCH_RETURN_UNIQ_DP, combs_in_tree_plan, 1, &dp, gedp->dbip, NULL);
(void)db_search(&solids, DB_SEARCH_RETURN_UNIQ_DP, solids_in_tree_plan, 1, &dp, gedp->dbip, NULL, NULL, NULL);
(void)db_search(&combs, DB_SEARCH_RETURN_UNIQ_DP, combs_in_tree_plan, 1, &dp, gedp->dbip, NULL, NULL, NULL);

/* If it's all solids already, nothing to do */
if (!BU_PTBL_LEN(&combs)) {
Expand All @@ -267,7 +267,7 @@ comb_flatten(struct ged *gedp, struct directory *dp)
obj_cnt = db_ls(gedp->dbip, DB_LS_TOPS, NULL, &all_paths);
bu_vls_init(&plan_string);
bu_vls_sprintf(&plan_string, "-mindepth 1 ! -below -name %s -type comb", dp->d_namep);
(void)db_search(&combs_outside_of_tree, DB_SEARCH_RETURN_UNIQ_DP, bu_vls_addr(&plan_string), obj_cnt, all_paths, gedp->dbip, NULL);
(void)db_search(&combs_outside_of_tree, DB_SEARCH_RETURN_UNIQ_DP, bu_vls_addr(&plan_string), obj_cnt, all_paths, gedp->dbip, NULL, NULL, NULL);
bu_vls_free(&plan_string);

/* Done searching - now we can free the path list and clear the original tree */
Expand Down Expand Up @@ -339,7 +339,7 @@ comb_lift_region(struct ged *gedp, struct directory *dp)
int failure_case = 0;

/* Find the regions - need full paths here, because we'll be checking parents */
(void)db_search(&regions, DB_SEARCH_TREE, regions_in_tree_plan, 1, &dp, gedp->dbip, NULL);
(void)db_search(&regions, DB_SEARCH_TREE, regions_in_tree_plan, 1, &dp, gedp->dbip, NULL, NULL, NULL);

/* If it's all non-region combs and solids already, nothing to do except possibly set the region flag*/
if (!BU_PTBL_LEN(&regions)) {
Expand All @@ -353,7 +353,7 @@ comb_lift_region(struct ged *gedp, struct directory *dp)
obj_cnt = db_ls(gedp->dbip, DB_LS_TOPS, NULL, &all_paths);
bu_vls_init(&plan_string);
bu_vls_sprintf(&plan_string, "-mindepth 1 ! -below -name %s -type comb", dp->d_namep);
(void)db_search(&combs_outside_of_tree, DB_SEARCH_RETURN_UNIQ_DP, bu_vls_addr(&plan_string), obj_cnt, all_paths, gedp->dbip, NULL);
(void)db_search(&combs_outside_of_tree, DB_SEARCH_RETURN_UNIQ_DP, bu_vls_addr(&plan_string), obj_cnt, all_paths, gedp->dbip, NULL, NULL, NULL);
bu_vls_free(&plan_string);

/* release our db_ls path */
Expand Down Expand Up @@ -425,7 +425,7 @@ comb_lift_region(struct ged *gedp, struct directory *dp)

bu_ptbl_init(&stack, 64, "comb mvall working stack");

(void)db_search(&combs_in_tree, DB_SEARCH_RETURN_UNIQ_DP, combs_in_tree_plan, 1, &dp, gedp->dbip, NULL);
(void)db_search(&combs_in_tree, DB_SEARCH_RETURN_UNIQ_DP, combs_in_tree_plan, 1, &dp, gedp->dbip, NULL, NULL, NULL);
bu_ptbl_ins(&combs_in_tree, (long *)dp);
for (BU_PTBL_FOR(dp_curr, (struct directory **), &regions_to_wrap)) {
if ((*dp_curr) != dp) {
Expand Down Expand Up @@ -474,7 +474,7 @@ comb_decimate(struct ged *gedp, struct directory *dp)
struct db_i *dbip = gedp->dbip;

BU_ALLOC(bot_dps, struct bu_ptbl);
if (db_search(bot_dps, DB_SEARCH_RETURN_UNIQ_DP, bot_objs, 1, &dp, gedp->dbip, NULL) < 0) {
if (db_search(bot_dps, DB_SEARCH_RETURN_UNIQ_DP, bot_objs, 1, &dp, gedp->dbip, NULL, NULL, NULL) < 0) {
bu_log("Problem searching for BoTs - aborting.\n");
ret = BRLCAD_ERROR;
goto comb_decimate_memfree;
Expand Down
2 changes: 1 addition & 1 deletion src/libged/edit/edit2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ cmd_perturb::exec(struct ged *gedp, void *u_data, int argc, const char **argv)
return BRLCAD_OK;

struct bu_ptbl objs = BU_PTBL_INIT_ZERO;
if (db_search(&objs, DB_SEARCH_RETURN_UNIQ_DP, "-type shape", 1, &einfo->dp, einfo->gedp->dbip, NULL) < 0) {
if (db_search(&objs, DB_SEARCH_RETURN_UNIQ_DP, "-type shape", 1, &einfo->dp, einfo->gedp->dbip, NULL, NULL, NULL) < 0) {
bu_vls_printf(gedp->ged_result_str, "search error\n");
return BRLCAD_ERROR;
}
Expand Down
6 changes: 3 additions & 3 deletions src/libged/facetize/brep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _nonovlp_brep_facetize(struct _ged_facetize_state *s, int argc, const char **arg
/* If anything specified has subtractions or intersections, we can't facetize it with
* this logic - that would require all-up Boolean evaluation processing. */
const char *non_union = "-bool + -or -bool -";
if (db_search(NULL, DB_SEARCH_QUIET, non_union, newobj_cnt, dpa, s->dbip, NULL) > 0) {
if (db_search(NULL, DB_SEARCH_QUIET, non_union, newobj_cnt, dpa, s->dbip, NULL, NULL, NULL) > 0) {
bu_free(dpa, "dp array");
bu_vls_printf(s->gedp->ged_result_str, "Found intersection or subtraction objects in specified inputs - currently unsupported. Aborting.\n");
return BRLCAD_ERROR;
Expand All @@ -63,7 +63,7 @@ _nonovlp_brep_facetize(struct _ged_facetize_state *s, int argc, const char **arg
/* If anything other than combs or breps exists in the specified inputs, we can't
* process with this logic - requires a preliminary brep conversion. */
const char *obj_types = "! -type c -and ! -type brep";
if (db_search(NULL, DB_SEARCH_QUIET, obj_types, newobj_cnt, dpa, s->dbip, NULL) > 0) {
if (db_search(NULL, DB_SEARCH_QUIET, obj_types, newobj_cnt, dpa, s->dbip, NULL, NULL, NULL) > 0) {
bu_free(dpa, "dp array");
bu_vls_printf(s->gedp->ged_result_str, "Found objects in specified inputs which are not of type comb or brep- currently unsupported. Aborting.\n");
return BRLCAD_ERROR;
Expand Down Expand Up @@ -103,7 +103,7 @@ _nonovlp_brep_facetize(struct _ged_facetize_state *s, int argc, const char **arg
const char *active_breps = "-type brep";
struct bu_ptbl *br;
BU_ALLOC(br, struct bu_ptbl);
if (db_search(br, DB_SEARCH_RETURN_UNIQ_DP, active_breps, newobj_cnt, dpa, wgedp->dbip, NULL) < 0) {
if (db_search(br, DB_SEARCH_RETURN_UNIQ_DP, active_breps, newobj_cnt, dpa, wgedp->dbip, NULL, NULL, NULL) < 0) {
bu_free(dpa, "dp array");
bu_free(br, "brep results");
return BRLCAD_ERROR;
Expand Down
Loading

0 comments on commit 2a0a53f

Please sign in to comment.