db5_bin.c File Reference

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include "machine.h"
#include "bu.h"
#include "vmath.h"
#include "db5.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "nurb.h"
#include "./debug.h"

Include dependency graph for db5_bin.c:

Go to the source code of this file.

Functions

int rt_bin_expm_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp)
int rt_bin_unif_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp)
int rt_bin_unif_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp)
int rt_bin_expm_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp)
int rt_bin_mime_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp)
int rt_binunif_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp, const int minor_type)
void rt_binunif_dump (struct rt_binunif_internal *bip)
int rt_binexpm_import5 (struct rt_db_internal *ip, const unsigned char minor_type, const struct bu_external *ep, const struct db_i *dbip)
int rt_binmime_import5 (struct rt_db_internal *ip, const unsigned char minor_type, const struct bu_external *ep, const struct db_i *dbip)
int rt_bin_import5 (struct rt_db_internal *ip, const unsigned char major_type, const unsigned char minor_type, const struct bu_external *ep, const struct db_i *dbip)
int rt_binunif_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp, const int minor_type)
int rt_binunif_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local)
void rt_binunif_free (struct rt_binunif_internal *bip)
void rt_binunif_ifree (struct rt_db_internal *ip)
int rt_retrieve_binunif (struct rt_db_internal *intern, struct db_i *dbip, char *name)
void rt_binunif_make (const struct rt_functab *ftp, struct rt_db_internal *intern, double diameter)
int rt_binunif_tclget (Tcl_Interp *interp, const struct rt_db_internal *intern, const char *attr)
int rt_binunif_tcladjust (Tcl_Interp *interp, struct rt_db_internal *intern, int argc, char **argv)

Variables

const char * binu_types []
const int binu_sizes []


Detailed Description

Handle bulk binary objects

Author - Paul J. Tanenbaum

Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5066

Definition in file db5_bin.c.


Function Documentation

int rt_bin_expm_export5 struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip,
struct resource resp
 

Definition at line 105 of file db5_bin.c.

References bu_log().

Here is the call graph for this function:

int rt_bin_unif_export5 struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip,
struct resource resp
 

Definition at line 116 of file db5_bin.c.

References bu_log().

Here is the call graph for this function:

int rt_bin_unif_import5 struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  mat,
const struct db_i dbip,
struct resource resp
 

Definition at line 126 of file db5_bin.c.

References bu_log().

Here is the call graph for this function:

int rt_bin_expm_import5 struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  mat,
const struct db_i dbip,
struct resource resp
 

Definition at line 136 of file db5_bin.c.

References bu_log().

Here is the call graph for this function:

int rt_bin_mime_import5 struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  mat,
const struct db_i dbip,
struct resource resp
 

Definition at line 147 of file db5_bin.c.

References bu_log().

Here is the call graph for this function:

int rt_binunif_import5 struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  mat,
const struct db_i dbip,
struct resource resp,
const int  minor_type
 

R T _ B I N U N I F _ I M P O R T 5

Import a uniform-array binary object from the database format to the internal structure.

Definition at line 164 of file db5_bin.c.

References bcopy, bu_bomb(), BU_CK_EXTERNAL, bu_cv_cookie(), bu_cv_optimize(), bu_cv_w_cookie(), bu_glong(), bu_gshort(), bu_log(), bu_malloc(), rt_binunif_internal::count, DB5_MAJORTYPE_BINARY_UNIF, DB5_MINORTYPE_BINU_16BITINT, DB5_MINORTYPE_BINU_16BITINT_U, DB5_MINORTYPE_BINU_32BITINT, DB5_MINORTYPE_BINU_32BITINT_U, DB5_MINORTYPE_BINU_8BITINT, DB5_MINORTYPE_BINU_8BITINT_U, DB5_MINORTYPE_BINU_DOUBLE, DB5_MINORTYPE_BINU_FLOAT, bu_external::ext_buf, bu_external::ext_nbytes, ID_BINUNIF, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_minor_type, rt_db_internal::idb_ptr, rt_binunif_internal::magic, ntohd(), ntohf(), RT_BINUNIF_INTERNAL_MAGIC, RT_CK_DB_INTERNAL, SIZEOF_NETWORK_DOUBLE, SIZEOF_NETWORK_FLOAT, rt_binunif_internal::type, rt_binunif_internal::u, and rt_binunif_internal::uint8.

Referenced by rt_bin_import5().

Here is the call graph for this function:

int rt_binexpm_import5 struct rt_db_internal ip,
const unsigned char  minor_type,
const struct bu_external ep,
const struct db_i dbip
 

R T _ B I N E X P M _ I M P O R T 5

Import an experimental binary object from the database format to the internal structure.

Definition at line 295 of file db5_bin.c.

References bu_log().

Referenced by rt_bin_import5().

Here is the call graph for this function:

int rt_binmime_import5 struct rt_db_internal ip,
const unsigned char  minor_type,
const struct bu_external ep,
const struct db_i dbip
 

R T _ B I N M I M E _ I M P O R T 5

Import a MIME-typed binary object from the database format to the internal structure.

Definition at line 312 of file db5_bin.c.

References bu_log().

Referenced by rt_bin_import5().

Here is the call graph for this function:

int rt_bin_import5 struct rt_db_internal ip,
const unsigned char  major_type,
const unsigned char  minor_type,
const struct bu_external ep,
const struct db_i dbip
 

R T _ B I N _ I M P O R T 5

Wrapper for importing binary objects from the database format to the internal structure.

Definition at line 329 of file db5_bin.c.

References DB5_MAJORTYPE_BINARY_EXPM, DB5_MAJORTYPE_BINARY_MIME, DB5_MAJORTYPE_BINARY_UNIF, rt_binexpm_import5(), rt_binmime_import5(), rt_binunif_import5(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_binunif_export5 struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip,
struct resource resp,
const int  minor_type
 

R T _ B I N U N I F _ E X P O R T 5

Create the "body" portion of external form

Definition at line 354 of file db5_bin.c.

References bcopy, bu_bomb(), bu_cv_cookie(), bu_cv_optimize(), bu_cv_w_cookie(), BU_INIT_EXTERNAL, bu_log(), bu_malloc(), bu_plong(), rt_binunif_internal::count, DB5_MINORTYPE_BINU_16BITINT, DB5_MINORTYPE_BINU_16BITINT_U, DB5_MINORTYPE_BINU_32BITINT, DB5_MINORTYPE_BINU_32BITINT_U, DB5_MINORTYPE_BINU_64BITINT, DB5_MINORTYPE_BINU_64BITINT_U, DB5_MINORTYPE_BINU_8BITINT, DB5_MINORTYPE_BINU_8BITINT_U, DB5_MINORTYPE_BINU_DOUBLE, DB5_MINORTYPE_BINU_FLOAT, bu_external::ext_buf, bu_external::ext_nbytes, htond(), htonf(), rt_db_internal::idb_minor_type, rt_db_internal::idb_ptr, RT_CK_BINUNIF, RT_CK_DB_INTERNAL, SIZEOF_NETWORK_DOUBLE, SIZEOF_NETWORK_FLOAT, rt_binunif_internal::type, rt_binunif_internal::u, and rt_binunif_internal::uint8.

Referenced by rt_binunif_tclget().

Here is the call graph for this function:

int rt_binunif_describe struct bu_vls str,
const struct rt_db_internal ip,
int  verbose,
double  mm2local
 

R T _ B I N U N I F _ D E S C R I B E

Make human-readable formatted presentation of this object. First line describes type of object. Additional lines are indented one tab, and give parameter values.

Definition at line 458 of file db5_bin.c.

References bu_log(), bu_vls_strcat(), rt_binunif_internal::count, DB5_MINORTYPE_BINU_16BITINT, DB5_MINORTYPE_BINU_16BITINT_U, DB5_MINORTYPE_BINU_32BITINT, DB5_MINORTYPE_BINU_32BITINT_U, DB5_MINORTYPE_BINU_64BITINT, DB5_MINORTYPE_BINU_64BITINT_U, DB5_MINORTYPE_BINU_8BITINT, DB5_MINORTYPE_BINU_8BITINT_U, DB5_MINORTYPE_BINU_ATM_MASK, DB5_MINORTYPE_BINU_DOUBLE, DB5_MINORTYPE_BINU_FLOAT, DB5_MINORTYPE_BINU_WID_MASK, rt_db_internal::idb_ptr, RT_CK_BINUNIF, and rt_binunif_internal::type.

Here is the call graph for this function:

int rt_retrieve_binunif struct rt_db_internal intern,
struct db_i dbip,
char *  name
 

Definition at line 544 of file db5_bin.c.

References bu_free_external(), bu_log(), db5_get_raw_internal_ptr(), DB5_MAJORTYPE_BINARY_UNIF, DB5_MINORTYPE_BINU_16BITINT, DB5_MINORTYPE_BINU_16BITINT_U, DB5_MINORTYPE_BINU_32BITINT, DB5_MINORTYPE_BINU_32BITINT_U, DB5_MINORTYPE_BINU_64BITINT, DB5_MINORTYPE_BINU_64BITINT_U, DB5_MINORTYPE_BINU_8BITINT, DB5_MINORTYPE_BINU_8BITINT_U, DB5_MINORTYPE_BINU_DOUBLE, DB5_MINORTYPE_BINU_FLOAT, db5_type_descrip_from_codes(), db_get_external(), db_lookup(), DEBUG_HF, DEBUG_VOL, DIR_NULL, bu_external::ext_buf, ID_BINUNIF, rt_db_internal::idb_ptr, LOOKUP_NOISY, db5_raw_internal::major_type, db5_raw_internal::minor_type, NULL, rt_binunif_dump(), RT_CK_BINUNIF, rt_db_get_internal5(), RT_G_DEBUG, RT_INIT_DB_INTERNAL, rt_uniresource, and type.

Here is the call graph for this function:

void rt_binunif_make const struct rt_functab ftp,
struct rt_db_internal intern,
double  diameter
 

Definition at line 636 of file db5_bin.c.

References BU_ASSERT, bu_calloc(), rt_binunif_internal::count, DB5_MAJORTYPE_BINARY_UNIF, DB5_MINORTYPE_BINU_8BITINT, ID_BINUNIF, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, rt_binunif_internal::int8, rt_binunif_internal::magic, NULL, RT_BINUNIF_INTERNAL_MAGIC, rt_binunif_internal::type, and rt_binunif_internal::u.

Here is the call graph for this function:

int rt_binunif_tclget Tcl_Interp interp,
const struct rt_db_internal intern,
const char *  attr
 

Definition at line 655 of file db5_bin.c.

References bu_free_external(), bu_vls_init(), bu_vls_printf(), bu_vls_strcat(), bu_vls_strcpy(), rt_db_internal::idb_minor_type, rt_db_internal::idb_ptr, NULL, rt_binunif_export5(), RT_CHECK_BINUNIF, status, TCL_ERROR, and TCL_OK.

Here is the call graph for this function:

int rt_binunif_tcladjust Tcl_Interp interp,
struct rt_db_internal intern,
int  argc,
char **  argv
 

Definition at line 720 of file db5_bin.c.

References binu_sizes, binu_types, bu_realloc(), rt_binunif_internal::count, DB5_MINORTYPE_BINU_64BITINT, rt_db_internal::idb_ptr, interp, NULL, RT_CHECK_BINUNIF, RT_CK_DB_INTERNAL, TCL_ERROR, rt_binunif_internal::type, rt_binunif_internal::u, rt_binunif_internal::uint8, and void().

Here is the call graph for this function:


Variable Documentation

const int binu_sizes[]
 

Initial value:

{
        0,
        0,
        SIZEOF_NETWORK_FLOAT,
        SIZEOF_NETWORK_DOUBLE,
        1,
        2,
        4,
        8,
        0,
        0,
        0,
        0,
        1,
        2,
        4,
        8
}

Definition at line 83 of file db5_bin.c.

Referenced by rt_binunif_tcladjust().


Generated on Mon Sep 18 01:25:04 2006 for BRL-CAD by  doxygen 1.4.6