BRL-CAD
comb.h File Reference
#include "common.h"
#include "opennurbs.h"
#include "vmath.h"
#include "bu/vls.h"
#include "rt/defines.h"
Include dependency graph for comb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int rt_comb_import4 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t matrix, const struct db_i *dbip, struct resource *resp)
 
int rt_comb_export4 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp)
 
void db_comb_describe (struct bu_vls *str, const struct rt_comb_internal *comb, int verbose, double mm2local)
 
int rt_comb_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local)
 
int rt_comb_get_color (unsigned char rgb[3], const struct rt_comb_internal *comb)
 
int db_comb_mvall (struct directory *dp, struct db_i *dbip, const char *old_name, const char *new_name, struct bu_ptbl *stack)
 
int rt_comb_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp)
 
int db_comb_children (struct db_i *dbip, struct rt_comb_internal *comb, struct directory ***children, int **bool_ops, matp_t **mats)
 
void rt_comb_brep (ON_Brep **b, const struct rt_db_internal *ip, const struct bn_tol *tol, const struct db_i *dbip)
 

Function Documentation

◆ rt_comb_import4()

int rt_comb_import4 ( struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  matrix,
const struct db_i dbip,
struct resource resp 
)

Import a combination record from a V4 database into internal form.

◆ rt_comb_export4()

int rt_comb_export4 ( struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip,
struct resource resp 
)

◆ db_comb_describe()

void db_comb_describe ( struct bu_vls str,
const struct rt_comb_internal comb,
int  verbose,
double  mm2local 
)

◆ rt_comb_describe()

int rt_comb_describe ( struct bu_vls str,
const struct rt_db_internal ip,
int  verbose,
double  mm2local 
)

OBJ[ID_COMBINATION].ft_describe() method

◆ rt_comb_get_color()

int rt_comb_get_color ( unsigned char  rgb[3],
const struct rt_comb_internal comb 
)

fills in rgb with the color for a given comb combination

returns truthfully if a color could be got. note that this routine will not (and cannot) handle the color inherit/override flag as that is set on some higher-level parent combination.

◆ db_comb_mvall()

int db_comb_mvall ( struct directory dp,
struct db_i dbip,
const char *  old_name,
const char *  new_name,
struct bu_ptbl stack 
)

change all matching object names in the comb tree from old_name to new_name

calling function must supply an initialized bu_ptbl, and free it once done.

◆ rt_comb_import5()

int rt_comb_import5 ( struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  mat,
const struct db_i dbip,
struct resource resp 
)

Read a combination object in v5 external (on-disk) format, and convert it into the internal format described in rtgeom.h

This is an unusual conversion, because some of the data is taken from attributes, not just from the object body. By the time this is called, the attributes will already have been cracked into ip->idb_avs, we get the attributes from there.

Returns - 0 OK -1 FAIL

◆ db_comb_children()

int db_comb_children ( struct db_i dbip,
struct rt_comb_internal comb,
struct directory ***  children,
int **  bool_ops,
matp_t **  mats 
)

Return a RT_DIR_NULL terminated array of directory pointers that holds the set of immediate children associated with comb. The caller is responsible for freeing the array, but not the directory structures pointed to by the array.

Optionally, pointers may also be supplied to collect arrays holding the boolean operations and matrices associated with the comb entries. For boolean operations, the caller is responsible for freeing the array. For matrices, both the array and the matrices themselves must be freed by the caller. The boolean operations array is zero terminated, the matrix array is NULL terminated. For example:

int i = 0;
struct directory *wdp;
struct directory **children = NULL;
int *bool_ops = NULL;
matp_t *matrices = NULL;
db_comb_children(dbip, comb, &children, &bool_ops, &matrices);
if (db_comb_children(dbip, comb, &bool_ops, &matrices) > 0) {
i = 0;
wdp = children[0];
while (wdp != RT_DIR_NULL) {
char obuf[1024];
bu_log("%s child %d: %d %s\n", dp->d_namep, i, bool_ops[ind], wdp->d_namep);
if (mats[ind]){
bn_mat_print_guts("", mats[i], obuf, 1024);
bu_log("%s %s\n", wdp->d_namep, obuf);
}
i++;
wdp = children[i];
}
}
i = 0;
while (mats[i]) {
bu_free(mats[i], "free matrix");
i++;
}
bu_free(mats, "free mats array");
bu_free(bool_ops, "free ops");
bu_free(children, "free children struct directory ptr array");
int db_comb_children(struct db_i *dbip, struct rt_comb_internal *comb, struct directory ***children, int **bool_ops, matp_t **mats)
#define RT_DIR_NULL
Definition: directory.h:78
void bn_mat_print_guts(const char *title, const mat_t m, char *buf, int buflen)
int bu_log(const char *,...) _BU_ATTR_PRINTF12
void bu_free(void *ptr, const char *str)
fastf_t * matp_t
pointer to a 4x4 matrix
Definition: vmath.h:369
char * d_namep
pointer to name string
Definition: directory.h:61

◆ rt_comb_brep()

void rt_comb_brep ( ON_Brep **  b,
const struct rt_db_internal ip,
const struct bn_tol tol,
const struct db_i dbip 
)