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

  1. //**********************************************************************
  2. //  DIVE Laboratories, Inc.
  3. //  Copyright(c) 1995
  4. //  All rights reserved
  5. //  FILE:   MATERIAL.HPP
  6. //
  7. //  DESCRIPTION
  8. //  This file provides the function prototypes for the materialClass
  9. //
  10. //  Author: M. Doucet
  11. //
  12. //  Modification History:
  13. //  6/13/95    Created
  14. //
  15. //**********************************************************************
  16. #ifndef _MATERIAL_HPP
  17. #define _MATERIAL_HPP
  18.  
  19. #include "stack.hpp"
  20. #include "vrtypes.hpp"
  21.  
  22. class amberClass;
  23.  
  24. typedef enum {_AMBIENT, _DIFFUSE, _SPECULAR, _EMISSIVE} materialEnumType;
  25. class materialClass {
  26.  
  27.    friend class geometryPrivateClass;
  28.    friend class geometryClass;
  29.     friend class renderStateClass;
  30.    friend class channelClass;
  31.    friend class universeClass;
  32.     friend class amberClass;
  33.  
  34. private:
  35.     
  36.     F4 ambient;
  37.     F4 diffuse;
  38.     F4 specular;
  39.     F4 emissive;
  40.  
  41.     char name[255];
  42.     flagType vrmlSaved;
  43.  
  44.     void  pushMaterial();
  45.     void  popMaterial();
  46.     void  makeCurrent();
  47.  
  48.     float shininess;
  49.  
  50.     static stackClass stack;
  51.     static F4 curAmbient;
  52.     static F4 curDiffuse;
  53.     static F4 curSpecular;
  54.     static F4 curEmissive;
  55.     static float curShininess;
  56.  
  57. public:
  58.  
  59.     static int stackIsEmpty;
  60.     void  setComponentV(materialEnumType component, F4 vals);
  61.     void  getComponentV(materialEnumType component, F4 vals);
  62.     void  setComponentV(materialEnumType component, D4 vals);
  63.     void  getComponentV(materialEnumType component, D4 vals);
  64.     void  setShiny(float val);
  65.     float getShiny();
  66.     void  reset();
  67.  
  68.     void  setName(char *nm);
  69.     char *getName();
  70.  
  71.     void operator=(materialClass *mat);
  72.  
  73.     materialClass();
  74.     ~materialClass();
  75. };
  76.  
  77. #endif
  78.  
  79.