#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "machine.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "raytrace.h"
#include "rtgeom.h"
Include dependency graph for g_submodel.c:
Go to the source code of this file.
Data Structures | |
struct | submodel_specific |
struct | submodel_gobetween |
struct | goodies |
Defines | |
#define | RT_SUBMODEL_O(m) bu_offsetof(struct rt_submodel_internal, m) |
#define | RT_SUBMODEL_SPECIFIC_MAGIC 0x73756253 |
#define | RT_CK_SUBMODEL_SPECIFIC(_p) BU_CKMAG(_p,RT_SUBMODEL_SPECIFIC_MAGIC,"submodel_specific") |
#define | RT_SUBMODEL_SEG_MISS(SEG) (SEG).seg_stp=RT_SOLTAB_NULL |
Functions | |
int | rt_submodel_prep (struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip) |
void | rt_submodel_print (register const struct soltab *stp) |
int | rt_submodel_a_miss (struct application *ap) |
int | rt_submodel_a_hit (struct application *ap, struct partition *PartHeadp, struct seg *segHeadp) |
int | rt_submodel_shot (struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead) |
void | rt_submodel_vshot (struct soltab **stp, struct xray **rp, struct seg *segp, int n, struct application *ap) |
void | rt_submodel_norm (register struct hit *hitp, struct soltab *stp, register struct xray *rp) |
void | rt_submodel_curve (register struct curvature *cvp, register struct hit *hitp, struct soltab *stp) |
void | rt_submodel_uv (struct application *ap, struct soltab *stp, register struct hit *hitp, register struct uvcoord *uvp) |
void | rt_submodel_free (register struct soltab *stp) |
int | rt_submodel_class (const struct soltab *stp, const fastf_t *min, const fastf_t *max, const struct bn_tol *tol) |
HIDDEN union tree * | rt_submodel_wireframe_leaf (struct db_tree_state *tsp, struct db_full_path *pathp, struct rt_db_internal *ip, genptr_t client_data) |
int | rt_submodel_plot (struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol) |
int | rt_submodel_tess (struct nmgregion **r, struct model *m, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol) |
int | rt_submodel_import (struct rt_db_internal *ip, const struct bu_external *ep, register const fastf_t *mat, const struct db_i *dbip) |
int | rt_submodel_export (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip) |
int | rt_submodel_import5 (struct rt_db_internal *ip, const struct bu_external *ep, register const fastf_t *mat, const struct db_i *dbip) |
int | rt_submodel_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip) |
int | rt_submodel_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local) |
void | rt_submodel_ifree (struct rt_db_internal *ip) |
Variables | |
const struct bu_structparse | rt_submodel_parse [] |
This solid is particularly useful when instancing millions of copies of a given complex object, such as a detailed tree.
Author - Michael John Muuss
Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5066
Definition in file g_submodel.c.
|
Definition at line 61 of file g_submodel.c. |
|
Definition at line 77 of file g_submodel.c. Referenced by rt_submodel_prep(). |
|
Definition at line 78 of file g_submodel.c. Referenced by rt_submodel_a_hit(), rt_submodel_free(), rt_submodel_print(), and rt_submodel_shot(). |
|
Definition at line 536 of file g_submodel.c. |
|
|
R T _ S U B M O D E L _ P R I N T Definition at line 264 of file g_submodel.c. References bn_mat_print(), bu_log(), bu_log_indent_delta(), submodel_specific::m2subm, RT_CK_SUBMODEL_SPECIFIC, rt_pr_soltab(), RT_VISIT_ALL_SOLTABS_END, RT_VISIT_ALL_SOLTABS_START, submodel_specific::rtip, and submodel_specific::subm2m. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ A _ M I S S Definition at line 289 of file g_submodel.c. Referenced by rt_submodel_shot(). |
|
|
R T _ S U B M O D E L _ S H O T Intersect a ray with a submodel. If an intersection occurs, a struct seg will be acquired and filled in. Returns - 0 MISS >0 HIT Definition at line 464 of file g_submodel.c. References application::a_ray, application::a_resource, application::a_rt_i, BU_ASSERT_LONG, BU_GETSTRUCT, BU_PTBL_END, BU_PTBL_GET, BU_PTBL_SET, submodel_specific::m2subm, MAT3X3VEC, MAT4X3PNT, NULL, xray::r_dir, xray::r_pt, resource::re_cpu, RT_CK_RESOURCE, RT_CK_RTI, RT_CK_SOLTAB, RT_CK_SUBMODEL_SPECIFIC, rt_init_resource(), rt_shootray(), rt_submodel_a_hit(), rt_submodel_a_miss(), rt_i::rti_resources, submodel_specific::rtip, soltab::st_specific, VDOT, and VSUB2. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ V S H O T Vectorized version. Definition at line 544 of file g_submodel.c. References rt_vstub(). Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ N O R M Given ONE ray distance, return the normal and entry/exit point. Definition at line 560 of file g_submodel.c. References bu_log(), directory::d_namep, RT_CK_HIT, soltab::st_dp, and VDOT. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ C U R V E Return the curvature of the submodel. Definition at line 583 of file g_submodel.c. References bn_vec_ortho(), and bu_log(). Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ U V For a hit on the surface of an submodel, return the (u,v) coordinates of the hit point, 0 <= u,v <= 1. u = azimuth v = elevation Definition at line 603 of file g_submodel.c. |
|
R T _ S U B M O D E L _ F R E E Definition at line 616 of file g_submodel.c. References BU_CK_PTBL, bu_free(), BU_PTBL_FOR, NULL, RT_CK_RESOURCE, RT_CK_RTI, RT_CK_SUBMODEL_SPECIFIC, rt_clean_resource(), rt_free_rti(), rt_uniresource, rt_i::rti_resources, and submodel_specific::rtip. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ C L A S S Definition at line 650 of file g_submodel.c. References RT_CLASSIFY_UNIMPLEMENTED. |
|
R T _ S U B M O D E L _ W I R E F R A M E _ L E A F This routine must be prepared to run in parallel. This routine should be generally exported for other uses. Definition at line 666 of file g_submodel.c. References BN_CK_TOL, bu_bomb(), bu_free(), bu_is_parallel(), bu_log(), DB_FULL_PATH_CUR_DIR, db_path_to_string(), goodies::dbip, DEBUG_TREEWALK, rt_functab::ft_name, rt_db_internal::idb_meth, RT_CK_DB_INTERNAL, RT_CK_DBI, RT_CK_RESOURCE, RT_CK_TESS_TOL, RT_G_DEBUG, TREE_NULL, db_tree_state::ts_m, db_tree_state::ts_resp, db_tree_state::ts_tol, db_tree_state::ts_ttol, and goodies::vheadp. Referenced by rt_submodel_plot(). Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ P L O T Not unlike mged/dodraw.c drawtrees() Note: The submodel will be drawn entirely in one color (for mged, typically this is red), because we can't return a vlblock, only one vlist, which by definition, is all one color. Definition at line 718 of file g_submodel.c. References bu_log(), bu_vls_addr(), bu_vls_strlen(), db_close(), db_dirbuild(), db_is_directory_non_empty(), db_open(), db_walk_tree(), DBI_NULL, rt_submodel_internal::dbip, goodies::dbip, rt_submodel_internal::file, rt_db_internal::idb_ptr, LOCAL, MAT_COPY, NULL, rt_submodel_internal::root2leaf, RT_CK_DB_INTERNAL, RT_CK_DBI, rt_initial_tree_state, RT_SUBMODEL_CK_MAGIC, rt_submodel_wireframe_leaf(), state, rt_submodel_internal::treetop, and goodies::vheadp. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ T E S S Returns - -1 failure 0 OK. *r points to nmgregion that holds this tessellation. Definition at line 786 of file g_submodel.c. References rt_db_internal::idb_ptr, LOCAL, RT_CK_DB_INTERNAL, and RT_SUBMODEL_CK_MAGIC. |
|
R T _ S U B M O D E L _ I M P O R T Import an SUBMODEL from the database format to the internal format. Apply modeling transformations as well. Definition at line 804 of file g_submodel.c. References bn_mat_print(), BU_CK_EXTERNAL, bu_free(), bu_log(), bu_malloc(), bu_struct_parse(), bu_vls_addr(), bu_vls_free(), bu_vls_init(), bu_vls_strcpy(), bu_vls_strlen(), DB5_MAJORTYPE_BRLCAD, DBID_STRSOL, rt_submodel_internal::dbip, bu_external::ext_buf, ID_NULL, ID_SUBMODEL, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, LOCAL, rt_submodel_internal::magic, MAT_COPY, NULL, rt_submodel_internal::root2leaf, RT_CK_DB_INTERNAL, RT_CK_DBI, RT_SUBMODEL_INTERNAL_MAGIC, rt_submodel_parse, record::ss, record::strsol::ss_args, and record::u_id. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ E X P O R T The name is added by the caller, in the usual place. Definition at line 865 of file g_submodel.c. References BU_ASSERT, bu_calloc(), BU_CK_EXTERNAL, bu_log(), bu_vls_addr(), bu_vls_free(), bu_vls_init(), bu_vls_struct_print(), DB_SS_LEN, DB_SS_NGRAN, DBID_STRSOL, bu_external::ext_buf, bu_external::ext_nbytes, rt_submodel_internal::file, ID_SUBMODEL, rt_db_internal::idb_ptr, rt_submodel_internal::meth, NAMESIZE, RT_CK_DB_INTERNAL, RT_SUBMODEL_CK_MAGIC, rt_submodel_parse, record::ss, record::strsol::ss_args, record::strsol::ss_id, record::strsol::ss_keyword, and rt_submodel_internal::treetop. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ I M P O R T 5 Import an SUBMODEL from the database format to the internal format. Apply modeling transformations as well. Definition at line 909 of file g_submodel.c. References bn_mat_print(), BU_CK_EXTERNAL, bu_free(), bu_log(), bu_malloc(), bu_struct_parse(), bu_vls_addr(), bu_vls_free(), bu_vls_init(), bu_vls_strlen(), bu_vls_strncpy(), DB5_MAJORTYPE_BRLCAD, rt_submodel_internal::dbip, bu_external::ext_buf, bu_external::ext_nbytes, ID_NULL, ID_SUBMODEL, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, LOCAL, rt_submodel_internal::magic, MAT_COPY, NULL, rt_submodel_internal::root2leaf, RT_CK_DB_INTERNAL, RT_CK_DBI, RT_SUBMODEL_INTERNAL_MAGIC, and rt_submodel_parse. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ E X P O R T 5 The name is added by the caller, in the usual place. Definition at line 962 of file g_submodel.c. References BU_ASSERT, bu_calloc(), BU_CK_EXTERNAL, bu_log(), bu_vls_addr(), bu_vls_free(), bu_vls_init(), bu_vls_strlen(), bu_vls_struct_print(), bu_external::ext_buf, bu_external::ext_nbytes, rt_submodel_internal::file, ID_SUBMODEL, rt_db_internal::idb_ptr, rt_submodel_internal::meth, RT_CK_DB_INTERNAL, RT_SUBMODEL_CK_MAGIC, rt_submodel_parse, and rt_submodel_internal::treetop. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ D E S C R I B E Make human-readable formatted presentation of this solid. First line describes type of solid. Additional lines are indented one tab, and give parameter values. Definition at line 1001 of file g_submodel.c. References bu_vls_addr(), bu_vls_printf(), bu_vls_strcat(), rt_submodel_internal::file, rt_db_internal::idb_ptr, rt_submodel_internal::meth, RT_SUBMODEL_CK_MAGIC, and rt_submodel_internal::treetop. Here is the call graph for this function: ![]() |
|
R T _ S U B M O D E L _ I F R E E Free the storage associated with the rt_db_internal version of this solid. Definition at line 1023 of file g_submodel.c. References bu_free(), GENPTR_NULL, rt_db_internal::idb_ptr, rt_submodel_internal::magic, RT_CK_DB_INTERNAL, and RT_SUBMODEL_CK_MAGIC. Here is the call graph for this function: ![]() |
|
Initial value: { {"%S", 1, "file", RT_SUBMODEL_O(file), BU_STRUCTPARSE_FUNC_NULL }, {"%S", 1, "treetop", RT_SUBMODEL_O(treetop), BU_STRUCTPARSE_FUNC_NULL }, {"%d", 1, "meth", RT_SUBMODEL_O(meth), BU_STRUCTPARSE_FUNC_NULL }, {"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL } } Definition at line 63 of file g_submodel.c. Referenced by rt_submodel_export(), rt_submodel_export5(), rt_submodel_import(), and rt_submodel_import5(). |