g_pg.c File Reference

#include "common.h"
#include <stdio.h>
#include <math.h>
#include "machine.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "./debug.h"
#include "./plane.h"
#include "noalias.h"

Include dependency graph for g_pg.c:

Go to the source code of this file.

Defines

#define TRI_NULL   ((struct tri_specific *)0)
#define MAXHITS   128

Functions

HIDDEN int rt_pgface (struct soltab *stp, fastf_t *ap, fastf_t *bp, fastf_t *cp, const struct bn_tol *tol)
int rt_pg_prep (struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip)
void rt_pg_print (register const struct soltab *stp)
int rt_pg_shot (struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead)
void rt_pg_free (struct soltab *stp)
void rt_pg_norm (register struct hit *hitp, struct soltab *stp, register struct xray *rp)
void rt_pg_uv (struct application *ap, struct soltab *stp, register struct hit *hitp, register struct uvcoord *uvp)
int rt_pg_class (void)
int rt_pg_plot (struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
int rt_pg_plot_poly (struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
void rt_pg_curve (register struct curvature *cvp, register struct hit *hitp, struct soltab *stp)
int rt_pg_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_pg_import (struct rt_db_internal *ip, const struct bu_external *ep, const fastf_t *mat, const struct db_i *dbip)
int rt_pg_export (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
int rt_pg_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const fastf_t *mat, const struct db_i *dbip)
int rt_pg_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
int rt_pg_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local)
void rt_pg_ifree (struct rt_db_internal *ip)
int rt_pg_to_bot (struct rt_db_internal *ip, const struct bn_tol *tol, struct resource *resp)


Detailed Description

Intersect a ray with a Polygonal Object that has no explicit topology. It is assumed that the solid has no holes.

Author - Michael John Muuss

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

Definition in file g_pg.c.


Define Documentation

#define TRI_NULL   ((struct tri_specific *)0)
 

Definition at line 60 of file g_pg.c.

#define MAXHITS   128
 


Function Documentation

HIDDEN int rt_pgface struct soltab stp,
fastf_t ap,
fastf_t bp,
fastf_t cp,
const struct bn_tol tol
 

R T _ P G F A C E

This function is called with pointers to 3 points, and is used to prepare PG faces. ap, bp, cp point to vect_t points.

Return - 0 if the 3 points didn't form a plane (eg, colinear, etc). # pts (3) if a valid plane resulted.

Definition at line 144 of file g_pg.c.

References bu_free(), BU_GETSTRUCT, bu_log(), DEBUG_ARB8, LOCAL, MAGNITUDE, RT_G_DEBUG, soltab::st_specific, tri_specific::tri_A, tri_specific::tri_BA, tri_specific::tri_CA, tri_specific::tri_forw, tri_specific::tri_N, tri_specific::tri_wn, VCROSS, VMOVE, VSUB2, and VUNITIZE.

Referenced by rt_pg_prep().

Here is the call graph for this function:

int rt_pg_prep struct soltab stp,
struct rt_db_internal ip,
struct rt_i rtip
 

R T _ P G _ P R E P

This routine is used to prepare a list of planar faces for being shot at by the triangle routines.

Process a PG, which is represented as a vector from the origin to the first point, and many vectors from the first point to the remaining points.

Definition at line 79 of file g_pg.c.

References rt_db_internal::idb_ptr, LOCAL, rt_pg_internal::npoly, rt_pg_internal::rt_pg_face_internal::npts, rt_pg_internal::poly, RT_PG_CK_MAGIC, rt_pgface(), rt_i::rti_tol, soltab::st_max, soltab::st_min, rt_pg_internal::rt_pg_face_internal::verts, VMINMAX, and VMOVE.

Here is the call graph for this function:

void rt_pg_print register const struct soltab stp  ) 
 

R T _ P G _ P R I N T

Definition at line 187 of file g_pg.c.

References bu_log(), tri_specific::tri_A, tri_specific::tri_BA, tri_specific::tri_CA, tri_specific::tri_forw, tri_specific::tri_N, TRI_NULL, tri_specific::tri_wn, and VPRINT.

Here is the call graph for this function:

int rt_pg_shot struct soltab stp,
register struct xray rp,
struct application ap,
struct seg seghead
 

R T _ P G _ S H O T

Function - Shoot a ray at a polygonal object.

Returns - 0 MISS >0 HIT

Definition at line 217 of file g_pg.c.

References application::a_rt_i, bu_log(), bn_tol::dist, FAST, LOCAL, MAXHITS, NEAR_ZERO, RT_HIT_MAGIC, rt_hitsort(), rt_i::rti_tol, SQRT_SMALL_FASTF, soltab::st_specific, tri_specific::tri_A, tri_specific::tri_BA, tri_specific::tri_CA, tri_specific::tri_forw, tri_specific::tri_N, tri_specific::tri_wn, VCROSS, VDOT, VJOIN1, VMOVE, and VSUB2.

Here is the call graph for this function:

void rt_pg_free struct soltab stp  ) 
 

R T _ P G _ F R E E

Definition at line 444 of file g_pg.c.

References bu_free(), soltab::st_specific, tri_specific::tri_forw, and TRI_NULL.

Here is the call graph for this function:

void rt_pg_norm register struct hit hitp,
struct soltab stp,
register struct xray rp
 

R T _ P G _ N O R M

Definition at line 461 of file g_pg.c.

void rt_pg_uv struct application ap,
struct soltab stp,
register struct hit hitp,
register struct uvcoord uvp
 

R T _ P G _ U V

Definition at line 470 of file g_pg.c.

int rt_pg_class void   ) 
 

R T _ P G _ C L A S S

Definition at line 481 of file g_pg.c.

void rt_pg_curve register struct curvature cvp,
register struct hit hitp,
struct soltab stp
 

R T _ P G _ C U R V E

Definition at line 556 of file g_pg.c.

References bn_vec_ortho().

Here is the call graph for this function:

int rt_pg_tess struct nmgregion **  r,
struct model m,
struct rt_db_internal ip,
const struct rt_tess_tol ttol,
const struct bn_tol tol
 

R T _ P G _ T E S S

Definition at line 566 of file g_pg.c.

References BU_LIST_FIRST, bu_malloc(), rt_db_internal::idb_ptr, rt_pg_internal::max_npts, nmg_find_pt_in_shell(), nmg_mrsv(), rt_pg_internal::npoly, rt_pg_internal::poly, RT_CK_DB_INTERNAL, and RT_PG_CK_MAGIC.

Here is the call graph for this function:

int rt_pg_import struct rt_db_internal ip,
const struct bu_external ep,
const fastf_t mat,
const struct db_i dbip
 

R T _ P G _ I M P O R T

Read all the polygons in as a complex dynamic structure. The caller is responsible for freeing the dynamic memory. (vid rt_pg_ifree).

Definition at line 648 of file g_pg.c.

References BU_CK_EXTERNAL, bu_log(), bu_malloc(), DB5_MAJORTYPE_BRLCAD, bu_external::ext_buf, bu_external::ext_nbytes, ID_P_DATA, ID_P_HEAD, ID_POLY, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, rt_pg_internal::magic, rt_pg_internal::max_npts, rt_pg_internal::npoly, record::p, rt_pg_internal::poly, RT_CK_DB_INTERNAL, RT_PG_INTERNAL_MAGIC, and record::u_id.

Here is the call graph for this function:

int rt_pg_export struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip
 

R T _ P G _ E X P O R T

The name will be added by the caller. Generally, only libwdb will set conv2mm != 1.0

Definition at line 721 of file g_pg.c.

References bu_calloc(), BU_CK_EXTERNAL, bu_log(), bu_external::ext_buf, bu_external::ext_nbytes, ID_P_DATA, ID_P_HEAD, ID_POLY, rt_db_internal::idb_ptr, rt_pg_internal::npoly, record::p, record::polyhead::p_id, rt_pg_internal::poly, record::q, record::polydata::q_count, record::polydata::q_id, RT_CK_DB_INTERNAL, RT_PG_CK_MAGIC, VMOVE, and VSCALE.

Here is the call graph for this function:

int rt_pg_import5 struct rt_db_internal ip,
const struct bu_external ep,
const fastf_t mat,
const struct db_i dbip
 

Definition at line 766 of file g_pg.c.

References bu_log().

Here is the call graph for this function:

int rt_pg_export5 struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip
 

Definition at line 775 of file g_pg.c.

References bu_log().

Here is the call graph for this function:

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

R T _ P G _ 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 791 of file g_pg.c.

References bu_vls_strcat(), ELEMENTS_PER_VECT, rt_db_internal::idb_ptr, INTCLAMP, RT_PG_CK_MAGIC, X, Y, and Z.

Here is the call graph for this function:

void rt_pg_ifree struct rt_db_internal ip  ) 
 

R T _ P G _ I F R E E

Free the storage associated with the rt_db_internal version of this solid.

Definition at line 852 of file g_pg.c.

References bu_free(), rt_db_internal::idb_ptr, rt_pg_internal::rt_pg_face_internal::norms, rt_pg_internal::npoly, rt_pg_internal::poly, RT_CK_DB_INTERNAL, RT_PG_CK_MAGIC, and rt_pg_internal::rt_pg_face_internal::verts.

Here is the call graph for this function:


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