BRL-CAD
db_internal.h File Reference
#include "common.h"
#include <stdio.h>
#include "bu/magic.h"
#include "bu/avs.h"
#include "bn/mat.h"
#include "rt/defines.h"
#include "rt/resource.h"
Include dependency graph for db_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rt_db_internal
 

Macros

#define idb_type   idb_minor_type
 
#define RT_DB_INTERNAL_INIT(_p)
 
#define RT_DB_INTERNAL_INIT_ZERO   {RT_DB_INTERNAL_MAGIC, -1, -1, NULL, NULL, BU_AVS_INIT_ZERO}
 
#define RT_CK_DB_INTERNAL(_p)   BU_CKMAG(_p, RT_DB_INTERNAL_MAGIC, "rt_db_internal")
 

Functions

int rt_db_get_internal (struct rt_db_internal *ip, const struct directory *dp, const struct db_i *dbip, const mat_t mat, struct resource *resp)
 
int rt_db_put_internal (struct directory *dp, struct db_i *dbip, struct rt_db_internal *ip, struct resource *resp)
 
int rt_fwrite_internal (FILE *fp, const char *name, const struct rt_db_internal *ip, double conv2mm)
 
void rt_db_free_internal (struct rt_db_internal *ip)
 
int rt_db_lookup_internal (struct db_i *dbip, const char *obj_name, struct directory **dpp, struct rt_db_internal *ip, int noisy, struct resource *resp)
 

Macro Definition Documentation

◆ idb_type

#define idb_type   idb_minor_type

Definition at line 54 of file db_internal.h.

◆ RT_DB_INTERNAL_INIT

#define RT_DB_INTERNAL_INIT (   _p)
Value:
{ \
(_p)->idb_magic = RT_DB_INTERNAL_MAGIC; \
(_p)->idb_major_type = -1; \
(_p)->idb_minor_type = -1; \
(_p)->idb_meth = (const struct rt_functab *) ((void *)0); \
(_p)->idb_ptr = ((void *)0); \
bu_avs_init_empty(&(_p)->idb_avs); \
}
#define RT_DB_INTERNAL_MAGIC
Definition: magic.h:175

Definition at line 55 of file db_internal.h.

◆ RT_DB_INTERNAL_INIT_ZERO

#define RT_DB_INTERNAL_INIT_ZERO   {RT_DB_INTERNAL_MAGIC, -1, -1, NULL, NULL, BU_AVS_INIT_ZERO}

Definition at line 63 of file db_internal.h.

◆ RT_CK_DB_INTERNAL

#define RT_CK_DB_INTERNAL (   _p)    BU_CKMAG(_p, RT_DB_INTERNAL_MAGIC, "rt_db_internal")

Definition at line 64 of file db_internal.h.

Function Documentation

◆ rt_db_get_internal()

int rt_db_get_internal ( struct rt_db_internal ip,
const struct directory dp,
const struct db_i dbip,
const mat_t  mat,
struct resource resp 
)

Get an object from the database, and convert it into its internal (i.e., unserialized in-memory) representation. Applies the provided matrix transform only to the in-memory internal being returned.

Returns - <0 On error id On success.

◆ rt_db_put_internal()

int rt_db_put_internal ( struct directory dp,
struct db_i dbip,
struct rt_db_internal ip,
struct resource resp 
)

Convert the internal representation of a solid to the external one, and write it into the database. On success only, the internal representation is freed.

Returns - <0 error 0 success

◆ rt_fwrite_internal()

int rt_fwrite_internal ( FILE *  fp,
const char *  name,
const struct rt_db_internal ip,
double  conv2mm 
)

Put an object in internal format out onto a file in external format. Used by LIBWDB.

Can't really require a dbip parameter, as many callers won't have one.

THIS ROUTINE ONLY SUPPORTS WRITING V4 GEOMETRY.

Returns - 0 OK <0 error

◆ rt_db_free_internal()

void rt_db_free_internal ( struct rt_db_internal ip)

◆ rt_db_lookup_internal()

int rt_db_lookup_internal ( struct db_i dbip,
const char *  obj_name,
struct directory **  dpp,
struct rt_db_internal ip,
int  noisy,
struct resource resp 
)

Convert an object name to a rt_db_internal pointer

Looks up the named object in the directory of the specified model, obtaining a directory pointer. Then gets that object from the database and constructs its internal representation. Returns ID_NULL on error, otherwise returns the type of the object.