#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include "machine.h"
#include "bu.h"
#include "vmath.h"
#include "bn.h"
#include "db5.h"
#include "raytrace.h"
#include "./debug.h"
Include dependency graph for db5_comb.c:
Go to the source code of this file.
Data Structures | |
struct | db_tree_counter_state |
struct | rt_comb_v5_serialize_state |
Defines | |
#define | DB_TREE_COUNTER_STATE_MAGIC 0x64546373 |
#define | DB_CK_TREE_COUNTER_STATE(_p) BU_CKMAG(_p, DB_TREE_COUNTER_STATE_MAGIC, "db_tree_counter_state"); |
#define | DB5COMB_TOKEN_LEAF 1 |
#define | DB5COMB_TOKEN_UNION 2 |
#define | DB5COMB_TOKEN_INTERSECT 3 |
#define | DB5COMB_TOKEN_SUBTRACT 4 |
#define | DB5COMB_TOKEN_XOR 5 |
#define | DB5COMB_TOKEN_NOT 6 |
#define | RT_COMB_V5_SERIALIZE_STATE_MAGIC 0x43357373 |
#define | RT_CK_COMB_V5_SERIALIZE_STATE(_p) BU_CKMAG(_p, RT_COMB_V5_SERIALIZE_STATE_MAGIC, "rt_comb_v5_serialize_state") |
#define | MAX_V5_STACK 8000 |
Functions | |
long | db_tree_counter (const union tree *tp, struct db_tree_counter_state *tcsp) |
void | rt_comb_v5_serialize (const union tree *tp, struct rt_comb_v5_serialize_state *ssp) |
int | rt_comb_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp) |
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, const int minor_type) |
The on-disk record looks like this: width byte n matricies (only non-identity matricies stored). n leaves len of RPN expression. (len=0 signals all-union expression) depth of stack Section 1: matricies Section 2: leaves Section 3: (Optional) RPN expression.
Encoding of a matrix is (ELEMENTS_PER_MAT * SIZEOF_NETWORK_DOUBLE) bytes, in network order (big-Endian, IEEE double precision).
Author - Michael John Muuss
Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5068 USA
Definition in file db5_comb.c.
|
Definition at line 83 of file db5_comb.c. Referenced by rt_comb_export5(). |
|
Definition at line 84 of file db5_comb.c. Referenced by db_tree_counter(). |
|
Definition at line 151 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Definition at line 152 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Definition at line 153 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Definition at line 154 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Definition at line 155 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Definition at line 156 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Definition at line 167 of file db5_comb.c. Referenced by rt_comb_export5(). |
|
Definition at line 168 of file db5_comb.c. Referenced by rt_comb_v5_serialize(). |
|
Referenced by rt_comb_import5(). |
|
D B _ T R E E _ C O U N T E R Count number of non-identity matricies, number of leaf nodes, number of operator nodes, etc. Returns - maximum depth of stack needed to unpack this tree, if serialized. Notes - We over-estimate the size of the width fields used for holding the matrix subscripts. The caller is responsible for correcting by saying: tcsp->leafbytes -= tcsp->n_leaf * (8 - db5_enc_len[wid]); Definition at line 102 of file db5_comb.c. References bn_mat_is_identity(), bu_bomb(), bu_log(), DB_CK_TREE_COUNTER_STATE, db_tree_counter_state::leafbytes, db_tree_counter_state::n_leaf, db_tree_counter_state::n_mat, db_tree_counter_state::n_oper, db_tree_counter_state::non_union_seen, OP_DB_LEAF, OP_INTERSECT, OP_NOT, OP_SUBTRACT, OP_UNION, OP_XOR, RT_CK_TREE, tree::tree_node::tb_left, tree::tree_node::tb_right, tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, tree::tr_b, and tree::tr_l. Referenced by rt_comb_export5(). Here is the call graph for this function: ![]() |
|
R T _ C O M B _ V 5 _ S E R I A L I Z E In one single pass through the tree, serialize out all three output sections at once. Definition at line 177 of file db5_comb.c. References bcopy, bn_mat_is_identity(), BU_ASSERT_LONG, bu_bomb(), bu_log(), db5_encode_length(), DB5COMB_TOKEN_INTERSECT, DB5COMB_TOKEN_LEAF, DB5COMB_TOKEN_NOT, DB5COMB_TOKEN_SUBTRACT, DB5COMB_TOKEN_UNION, DB5COMB_TOKEN_XOR, ELEMENTS_PER_MAT, rt_comb_v5_serialize_state::exprp, htond(), rt_comb_v5_serialize_state::leafp, rt_comb_v5_serialize_state::mat_num, rt_comb_v5_serialize_state::matp, rt_comb_v5_serialize_state::nmat, OP_DB_LEAF, OP_INTERSECT, OP_NOT, OP_SUBTRACT, OP_UNION, OP_XOR, RT_CK_COMB_V5_SERIALIZE_STATE, RT_CK_TREE, SIZEOF_NETWORK_DOUBLE, tree::tree_node::tb_left, tree::tree_node::tb_right, tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, tree::tr_b, tree::tr_l, and rt_comb_v5_serialize_state::wid. Referenced by rt_comb_export5(). Here is the call graph for this function: ![]() |
|