home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / raytrace / rayshade / src / csg.h < prev    next >
C/C++ Source or Header  |  1991-07-18  |  1KB  |  50 lines

  1. /*
  2.  * csg.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * $Id: csg.h,v 4.0 91/07/17 14:37:06 kolb Exp Locker: kolb $
  17.  *
  18.  * $Log:    csg.h,v $
  19.  * Revision 4.0  91/07/17  14:37:06  kolb
  20.  * Initial version.
  21.  * 
  22.  */
  23. #ifndef CSG_H
  24. #define CSG_H
  25.  
  26. #define GeomCsgCreate(t)    GeomCreate((GeomRef)CsgCreate(t), CsgMethods())
  27.  
  28. /*
  29.  * CSG (Constructive Solid Geometry)
  30.  */
  31. #define CSG_UNION    0
  32. #define CSG_INTERSECT    1
  33. #define CSG_DIFFERENCE    2
  34.  
  35. typedef struct Csg {
  36.     char operator;            /* Union, Intersect, or Difference */
  37.     struct Geom *obj1, *obj2;
  38.     int (*intmeth)();        /* Intersection method. */
  39.     Float bounds[2][3];
  40. } Csg;
  41.  
  42. extern char    *CsgName();
  43. extern Csg    *CsgCreate();
  44. extern int    CsgIntersect(), CsgConvert();
  45. extern void    CsgBounds();
  46. extern int    FirstCsgGeom();
  47. extern Methods    *CsgMethods();
  48.  
  49. #endif /* CSG_H */
  50.