g_dsp.c File Reference

#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>
#include "machine.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "raytrace.h"
#include "rtgeom.h"
#include "./debug.h"
#include "plot3.h"

Include dependency graph for g_dsp.c:

Go to the source code of this file.

Data Structures

struct  dsp_rpp
struct  dsp_bb
struct  dsp_bb_layer
struct  dsp_specific
struct  bbox_isect
struct  isect_stuff

Defines

#define FULL_DSP_DEBUGGING   1
#define ORDERED_ISECT   1
#define DIM_BB_CHILDREN   4
#define NUM_BB_CHILDREN   (DIM_BB_CHILDREN*DIM_BB_CHILDREN)
#define MAGIC_dsp_bb   234
#define DSP_BB_CK(_p)   BU_CKMAG(_p, MAGIC_dsp_bb, "dsp_bb")
#define LAYER(l, x, y)   l->p[l->dim[1]*y+x]
#define dlog   if (RT_G_DEBUG & DEBUG_HF) bu_log
#define BBOX_PLANES   7
#define XMIN   0
#define XMAX   1
#define YMIN   2
#define YMAX   3
#define ZMIN   4
#define ZMAX   5
#define ZMID   6
#define ZTOP   7
#define DSP(_p, _x, _y)   dsp_val(_p, _x, _y, __FILE__, __LINE__)
#define XCNT(_p)   (((struct rt_dsp_internal *)_p)->dsp_xcnt)
#define YCNT(_p)   (((struct rt_dsp_internal *)_p)->dsp_ycnt)
#define XSIZ(_p)   (_p->dsp_i.dsp_xcnt - 1)
#define YSIZ(_p)   (_p->dsp_i.dsp_ycnt - 1)
#define DSP_O(m)   bu_offsetof(struct rt_dsp_internal, m)
#define DSP_AO(a)   bu_offsetofarray(struct rt_dsp_internal, a)
#define PLOT_LAYERS
#define BBOX_PT(_x, _y, _z)
#define ADD_SEG(isect, in, out, min, max, r, g, b)   add_seg(isect, in, out, min, max, r, g, b, __LINE__)
#define RT_DSP_SEG_MISS(SEG)   (SEG).seg_stp=RT_SOLTAB_NULL
#define SMOOTHSTEP(x)   ((x)*(x)*(3 - 2*(x)))
#define MOVE(_pt)
#define DRAW(_pt)
#define IMPORT_FAIL(_s)

Functions

int rt_retrieve_binunif (struct rt_db_internal *intern, const struct db_i *dbip, const char *name)
void rt_binunif_ifree (struct rt_db_internal *ip)
unsigned short dsp_val (struct rt_dsp_internal *dsp_i, unsigned x, unsigned y, char *file, int line)
void rt_dsp_print (register const struct soltab *stp)
int rt_dsp_prep (struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip)
int dsp_in_rpp (struct isect_stuff *isect, register const fastf_t *min, register const fastf_t *max)
int rt_dsp_shot (struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead)
void rt_dsp_vshot (struct soltab **stp, struct xray **rp, struct seg *segp, int n, struct application *ap)
void rt_dsp_norm (register struct hit *hitp, struct soltab *stp, register struct xray *rp)
void rt_dsp_curve (register struct curvature *cvp, register struct hit *hitp, struct soltab *stp)
void rt_dsp_uv (struct application *ap, struct soltab *stp, register struct hit *hitp, register struct uvcoord *uvp)
void rt_dsp_free (register struct soltab *stp)
int rt_dsp_class (void)
int rt_dsp_plot (struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
int rt_dsp_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_dsp_import (struct rt_db_internal *ip, const struct bu_external *ep, register const fastf_t *mat, const struct db_i *dbip)
int rt_dsp_export (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
int rt_dsp_import5 (struct rt_db_internal *ip, const struct bu_external *ep, register const fastf_t *mat, const struct db_i *dbip, struct resource *resp, const int minor_type)
int rt_dsp_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_dsp_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local, struct resource *resp, struct db_i *db_ip)
void rt_dsp_ifree (struct rt_db_internal *ip)
int rt_dsp_tclget (Tcl_Interp *interp, const struct rt_db_internal *intern, const char *attr)
int rt_dsp_tcladjust (Tcl_Interp *interp, struct rt_db_internal *intern, int argc, char **argv)
void rt_dsp_make (const struct rt_functab *ftp, struct rt_db_internal *intern, double diameter)
int project_pt (point_t out, int A[3], int B[3], int C[3], point_t pt)
int dsp_pos (point_t out, struct soltab *stp, point_t p)

Variables

const struct bu_structparse rt_dsp_parse []
const struct bu_structparse rt_dsp_ptab []
const struct bu_structparse fake_dsp_printab []


Detailed Description

Intersect a ray with a displacement map.

The bounding box planes (in dsp coordinates) are numbered 0 .. 5

For purposes of the "struct hit" surface number, the "non-elevation" surfaces are numbered 0 .. 7 where:

Plane # Name plane dist -------------------------------------------------- 0 XMIN (dist = 0) 1 XMAX (dist = xsiz) 2 YMIN (dist = 0) 3 YMAX (dist = ysiz) 4 ZMIN (dist = 0) 5 ZMAX (dsp_max)

6 ZMID (dsp_min) 7 ZTOP (computed)

if the "struct hit" surfno surface is ZMAX, then hit_vpriv[X,Y] holds the cell that was hit. hit_vpriv[Z] is 0 if this was an in-hit. 1 if an out-hit

Authors - Lee A. Butler

Source - SECAD/VLD Computing Consortium, Bldg 394 The U. S. Army Ballistic Research Laboratory Aberdeen Proving Ground, Maryland 21005-5066

Definition in file g_dsp.c.


Define Documentation

#define FULL_DSP_DEBUGGING   1
 

Definition at line 1 of file g_dsp.c.

#define BBOX_PT _x,
_y,
_z   ) 
 

Value:

VSET(pt, (fastf_t)_x, (fastf_t)_y, (fastf_t)_z); \
        MAT4X3PNT(bbpt, dsp_ip->dsp_stom, pt); \
        VMINMAX( stp->st_min, stp->st_max, bbpt)

Referenced by rt_dsp_prep().

#define SMOOTHSTEP x   )     ((x)*(x)*(3 - 2*(x)))
 

#define MOVE _pt   ) 
 

Value:

MAT4X3PNT(m_pt, dsp_ip->dsp_stom, _pt); \
        RT_ADD_VLIST( vhead, m_pt, BN_VLIST_LINE_MOVE )

Referenced by rt_dsp_plot().

#define DRAW _pt   ) 
 

Value:

MAT4X3PNT(m_pt, dsp_ip->dsp_stom, _pt); \
        RT_ADD_VLIST( vhead, m_pt, BN_VLIST_LINE_DRAW )

Referenced by rt_dsp_plot().

#define IMPORT_FAIL _s   ) 
 

Value:

bu_log("rt_dsp_import(%d) '%s' %s\n", __LINE__, \
               bu_vls_addr(&dsp_ip->dsp_name), _s);\
        bu_free( (char *)dsp_ip , "rt_dsp_import: dsp_ip" ); \
        ip->idb_type = ID_NULL; \
        ip->idb_ptr = (genptr_t)NULL; \
        return -2

Referenced by rt_dsp_import(), and rt_dsp_import5().


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