home *** CD-ROM | disk | FTP | other *** search
/ VRML Tools for 3D Cyberspace / VRML_Tools_For_3D_Cyberspace.iso / amber / include / univ.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-01  |  3.2 KB  |  146 lines

  1. //**********************************************************************
  2. //  DIVE Laboratories, Inc.
  3. //  Copyright(c) 1995
  4. //  All rights reserved.
  5. //  FILE:   UNIV.HPP
  6. //
  7. //  DESCRIPTION
  8. //  This file provides the function prototypes for the universeClass
  9. //
  10. //  Author: M. Doucet
  11. //
  12. //  Modification History:
  13. //  4/27/95    Created
  14. //
  15. //**********************************************************************
  16. #ifndef _UNIV_HPP
  17. #define _UNIV_HPP
  18.  
  19. #include "slink.hpp"
  20. #include "geometry.hpp"
  21. #include "shapes.hpp"
  22. #include "intxmsg.hpp"
  23.  
  24. #ifndef AMBERRT
  25. #include "light.hpp"
  26. #ifdef INDIGO2
  27. #include <X11/Intrinsic.h>
  28. #endif
  29. #endif
  30.  
  31. #define RENDER_NORMAL              0x01
  32. #define RENDER_BOUNDINGBOX        0x02
  33. #define RENDER_BOTHSIDES            0x08
  34. #define RENDER_FOG                    0x10
  35. #define RENDER_MATERIAL             0x20
  36.  
  37. class channelClass;
  38. class geoStateClass;
  39. class universePrivateClass;
  40. class simClass;
  41.  
  42. class universeClass {
  43.  
  44.     friend class amberClass;
  45.     friend class amberPrivateClass;
  46.     friend class channelClass;
  47.     friend class materialClass;
  48.     friend class textureClass;
  49.     friend class geometryClass;
  50.     friend class geometryPrivateClass;
  51.     friend class simClass;
  52.  
  53. private:
  54.     
  55.     universePrivateClass *data;
  56.  
  57. public:
  58.  
  59. #ifndef AMBERRT
  60.  
  61.     // Light
  62.     lightClass *light0,
  63.                   *light1,
  64.                   *light2,
  65.                   *light3,
  66.                   *light4,
  67.                   *light5,
  68.                   *light6,
  69.                   *light7;
  70.  
  71.     // Light functions
  72.     void            resetLights();
  73.     void            clearLights();
  74.     void        setAmbientLight(F4 col);
  75.     void        getAmbientLight(F4 col);
  76.  
  77.  
  78.     // Universe rendering
  79.     void             render(channelClass *ch);
  80.  
  81. #endif
  82.  
  83.     // Geometry functions
  84.     int            addGeo(geometryClass *g);
  85.     geometryClass *getGeo(int index);
  86.     geometryClass *getGeo(char *name);
  87.     void           removeGeo(geometryClass *g);
  88.     void           removeAllGeo();
  89.  
  90.     // Picking Functions
  91. #ifdef ADVANCED_COLLISION
  92.     Vres    heightAboveNearest(V3 fromPos);
  93. #endif
  94.  
  95.     // Picking Functions
  96.     geometryClass*    pickGeometry( V3 fromPos, V3 toPos );
  97.     polygonClass*    pickPolygon( V3 fromPos, V3 toPos );
  98.     intxMsgClass*    pick( V3 fromPos, V3 toPos, flagType polyIntx=TRUE );
  99.  
  100. #ifdef BRYON_HUH
  101.     //Pick Exclusion Functions:
  102.     void    setExcludedGeo( geometryClass *eGeo, flagType childFlag=FALSE);
  103.     void    addExcludedGeo( geometryClass *eGeo, flagType childFlag=FALSE);
  104.     void    removeExcludedGeo( geometryClass *iGeo, flagTyoe childFlag=FALSE);
  105.     void    clearExcludedList( void );
  106.     void    getExcludedList( sLinkClass *eList );
  107. #endif
  108.  
  109.     // Utility functions
  110.     void   recomputeExtents();
  111.     int    getNumPolygons();
  112.     void   getExtents(V3 ext);
  113.     Vres      getRadius();
  114.     void   getMidpoint(V3 mid);
  115.     int    getId();
  116.     float  frameRate();
  117.     float  deltaTime();
  118.     void   resetFrameCnt();
  119.  
  120.     // Name functions
  121.     char *getFilename();
  122.     void  setName(char *nm);
  123.     char *getName();
  124.  
  125.     // File functions
  126.     void save(char *filename);
  127.     void saveAllGeos(fileEnumType fileType=_VRML_FILE);
  128.     void read(char *filename);
  129.  
  130.     // Universe Law Controls
  131.     //
  132. #ifdef AMBERRT
  133.     void addLaw(LAWFUNCPTR func);
  134.     void removeLaw(LAWFUNCPTR func);
  135. #endif
  136.     void addLaw(GEOLAWFUNCPTR func);
  137.     void removeLaw(GEOLAWFUNCPTR func);
  138.  
  139.     // Constructor & Destructor
  140.     universeClass(int makeCurrent=1);
  141.     ~universeClass();
  142. };
  143.  
  144. #endif
  145.  
  146.