00001 /* P L A N E . H 00002 * BRL-CAD 00003 * 00004 * Copyright (c) 1985-2006 United States Government as represented by 00005 * the U.S. Army Research Laboratory. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * as published by the Free Software Foundation; either version 2 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this file; see the file named COPYING for more 00019 * information. 00020 */ 00021 00022 /** \addtogroup librt */ 00023 /*@{*/ 00024 /** @file plane.h 00025 * This header file describes the plane_specific structure, which 00026 * is for ARS processing, and the tri_specific structure, 00027 * which is for ARB and PG processing. 00028 * 00029 * Author - 00030 * Michael John Muuss 00031 * 00032 * Source - 00033 * SECAD/VLD Computing Consortium, Bldg 394 00034 * The U. S. Army Ballistic Research Laboratory 00035 * Aberdeen Proving Ground, Maryland 21005 00036 * 00037 * 00038 * $Header: /cvsroot/brlcad/brlcad/src/librt/plane.h,v 14.9 2006/01/18 06:46:17 brlcad Exp $ 00039 */ 00040 /*@}*/ 00041 00042 #ifndef PLANE_H 00043 #define PLANE_H seen 00044 00045 #define MAXPTS 4 /* All we need are 4 points */ 00046 #define pl_A pl_points[0] /* Synonym for A point */ 00047 00048 struct plane_specific { 00049 int pl_npts; /* number of points on plane */ 00050 point_t pl_points[MAXPTS]; /* Actual points on plane */ 00051 vect_t pl_Xbasis; /* X (B-A) vector (for 2d coords) */ 00052 vect_t pl_Ybasis; /* Y (C-A) vector (for 2d coords) */ 00053 vect_t pl_N; /* Unit-length Normal (outward) */ 00054 fastf_t pl_NdotA; /* Normal dot A */ 00055 fastf_t pl_2d_x[MAXPTS]; /* X 2d-projection of points */ 00056 fastf_t pl_2d_y[MAXPTS]; /* Y 2d-projection of points */ 00057 fastf_t pl_2d_com[MAXPTS]; /* pre-computed common-term */ 00058 struct plane_specific *pl_forw; /* Forward link */ 00059 char pl_code[MAXPTS+1]; /* Face code string. Decorative. */ 00060 }; 00061 00062 /* 00063 * Describe the tri_specific structure. 00064 */ 00065 struct tri_specific { 00066 point_t tri_A; /* triangle vertex (A) */ 00067 vect_t tri_BA; /* B - A (second point) */ 00068 vect_t tri_CA; /* C - A (third point) */ 00069 vect_t tri_wn; /* facet normal (non-unit) */ 00070 vect_t tri_N; /* unit normal vector */ 00071 fastf_t *tri_normals; /* unit vertex normals A, B, C (this is malloced storage) */ 00072 int tri_surfno; /* solid specific surface number */ 00073 struct tri_specific *tri_forw; /* Next facet */ 00074 }; 00075 00076 typedef struct tri_specific tri_specific_double; 00077 00078 /* 00079 * A more memory conservative version 00080 */ 00081 struct tri_float_specific { 00082 float tri_A[3]; /* triangle vertex (A) */ 00083 float tri_BA[3]; /* B - A (second point) */ 00084 float tri_CA[3]; /* C - A (third point) */ 00085 float tri_wn[3]; /* facet normal (non-unit) */ 00086 float tri_N[3]; /* unit normal vector */ 00087 signed char *tri_normals; /* unit vertex normals A, B, C (this is malloced storage) */ 00088 int tri_surfno; /* solid specific surface number */ 00089 struct tri_float_specific *tri_forw; /* Next facet */ 00090 }; 00091 00092 typedef struct tri_float_specific tri_specific_float; 00093 00094 #endif /* PLANE_H */ 00095 00096 /* 00097 * Local Variables: 00098 * mode: C 00099 * tab-width: 8 00100 * c-basic-offset: 4 00101 * indent-tabs-mode: t 00102 * End: 00103 * ex: shiftwidth=4 tabstop=8 00104 */