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

  1. //**********************************************************************
  2. //  DIVE Laboratories, Inc.
  3. //  Copyright(c) 1995
  4. //  All rights reserved.
  5. //  FILE:   CHANNEL.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 _CHANNEL_HPP
  17. #define _CHANNEL_HPP
  18.  
  19. #ifdef INDIGO2
  20. #include <sys/types.h>
  21. #include <sys/time.h>
  22. #include <X11/Intrinsic.h>
  23. #include <GL/GLwMDrawA.h>
  24. #include <GL/gl.h>
  25. #include <unistd.h>
  26. #endif
  27.  
  28. #include"position.hpp"
  29. #include"vector.hpp"
  30. #include"quat.hpp"
  31. #include"univ.hpp"
  32. #include"intxmsg.hpp"
  33. class channelPrivateClass;
  34.  
  35. class channelClass {
  36.  
  37. private:
  38.  
  39.     friend class amberClass;
  40.     friend class lightPrivateClass;
  41.     friend class universePrivateClass;
  42.  
  43.     channelPrivateClass *data;
  44.  
  45. public:
  46.  
  47. #ifndef AMBERRT
  48.  
  49.     // Rendering Utilities
  50.     void        initRenderSurface();
  51.     int        renderSurfaceOk();
  52.     void     createRay(D2 mousePos, Vres length, V3 from, V3 to);
  53.     intxMsgClass *pick(D2 mousePos, flagType=TRUE);
  54.     polygonClass*    pickPolygon(D2 mousePos);
  55.     geometryClass*    pickGeometry(D2 mousePos);
  56.  
  57. #endif
  58.  
  59.  
  60.     // Channel Universe functions
  61.     void             setUniverse(universeClass *u);
  62.     universeClass *getUniverse();
  63.  
  64.     //    Rotation
  65.    void    rotate(int rotAxis, Vres rads );
  66.    void  rotate(vectorClass *axis, Vres rads);
  67.  
  68.     // Orientation
  69.     void  initOrientation();
  70.     void    setOrientation(quatClass q);
  71.     void  getOrientation(quatClass &q);
  72.  
  73.     // Direction
  74.    void    alignAxis(int axis, vectorClass *v);
  75.     void     getAxis(int axis, V3 vals);
  76.     void  getAxis(int axis, vectorClass &vec);
  77.  
  78.     // Position
  79.     void  translate(vectorClass delta, frameEnum frame=_LOCAL);
  80.  
  81.    void    setPosition(positionClass *pos );
  82.    void    setPosition(V3 pos);
  83.    void    setPosition(Vres posX, Vres posY, Vres posZ );
  84.     void     getPosition(V3 pos);
  85.     void     getDirection(V3 pos);
  86.  
  87.     // Performance
  88.     void    viewPerformance();
  89.     void  resetPerformance();
  90.  
  91.     // Perspective
  92.     void    setPerspective(Vres viewingAngle=45.0);
  93.     void  resetPerspective();
  94.     
  95.     // Clipping and View Angle
  96.     void    setPlanes(Vres nearVal, Vres farVal);
  97.     void  setNearPlane(Vres val);
  98.     void  setFarPlane(Vres val);
  99.     Vres  getNearPlane();
  100.     Vres  getFarPlane();
  101.     void  setViewAngle(Vres angle);
  102.     Vres  getViewAngle();
  103.  
  104.     // Channel rendering
  105.     void render();
  106.  
  107.     // User defined render fcns:
  108.     void    setPreRenderFcn( void (*fcn)(void) );
  109.     void    setPostRenderFcn( void (*fcn)(void) );
  110.     
  111.  
  112.     // Render functions
  113.     void                enableState(int state);
  114.     void                disableState(int state);
  115.     int                 getState();
  116.  
  117.     void                    setPolyRenderAs(polyAsEnum as);
  118.     polyAsEnum            getPolyRenderAs();
  119.  
  120.     void                    setPolyFill(polyFillEnum fill);
  121.     polyFillEnum       getPolyFill();
  122.  
  123.     void                     setPolyShading(polyShadingEnum shading);
  124.     polyShadingEnum     getPolyShading();
  125.  
  126.     // Fog functions
  127.     void            setFogMode(int mode);
  128.     int            getFogMode();
  129.  
  130.     void            setFogNear(float val);
  131.     float             getFogNear();
  132.  
  133.     void            setFogFar(float val);
  134.     float             getFogFar();
  135.  
  136.     void            setFogDensity(float val);
  137.     float             getFogDensity();
  138.  
  139.     void            setFogAll(F4 col, int mode, float nearVal, float farVal, float densityVal);
  140.  
  141.     void        setFogColor(F4 col);
  142.     void        getFogColor(F4 col);
  143.  
  144.     void        setBackgroundColor(F4 col);
  145.     void        getBackgroundColor(F4 col);
  146.  
  147.    // Window functions
  148.    void  *getRenderWindow();
  149. #ifdef INDIGO2
  150.    void  *getParentWindow();
  151. #endif
  152.  
  153.     // Constructors & Destructors
  154. #ifndef AMBERRT
  155. #ifdef WIN32
  156.     channelClass(void *window=NULL, int useCurrentUniverse=1);
  157. #endif
  158. #ifdef INDIGO2
  159.     channelClass(Widget window=NULL, int useCurrentUniverse=1);
  160. #endif
  161. #else
  162.     channelClass();
  163. #endif
  164.  
  165.    ~channelClass();
  166. };
  167.  
  168. #endif
  169.  
  170.