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

  1. //**********************************************************************
  2. //  DIVE Laboratories, Inc.
  3. //  Copyright(c) 1995
  4. //  All rights reserved.
  5. //  FILE:   VERTEX.HPP
  6. //
  7. //  DESCRIPTION
  8. //  This file provides the function prototypes for the 
  9. //  vertexClass
  10. //
  11. //  Author: M. Doucet
  12. //
  13. //  Modification History:
  14. //  4/4/95    Created//
  15. //**********************************************************************
  16. #ifndef VERTEX_HPP
  17. #define VERTEX_HPP
  18.  
  19. #include "position.hpp"
  20. #include "vector.hpp"
  21.  
  22. #ifndef AMBERRT
  23. #include "material.hpp"
  24. #endif
  25.  
  26. class triangleClass;
  27. class quadClass;
  28. class polygonClass;
  29.  
  30. class vertexClass {
  31.  
  32. private: 
  33.  
  34.     // Private Data    
  35.     int         nPolys,                 // Number of polygons that use this vertex
  36.                 Id;                    // Vertex Amber ID
  37.     vectorClass tempNormal;            // Temporary normal used for computation
  38.     int         normalComputed;    // Flag indicating if normal is computed
  39.  
  40. public:  
  41.  
  42.     // Public Data (public access for speed)
  43.    positionClass  pt;                // Position
  44.     vectorClass normal;                //    Normal
  45.  
  46.     F4       color;
  47.     int     geoVertexIndex;
  48.     int      normalOverride,   // Indicates that the user has supplied a normal
  49.               rgbOverride,      // Indicates that the user has supplied an rgb color
  50.               tcOverride;       // Indicates that the user has supplied a texture coordinate
  51.     flagType  isBackSide;   //AMB90009
  52. #ifndef AMBERRT
  53.     materialClass *mat;
  54.     F2             texCoord;
  55.     void setTcOverride(int flag);
  56.     int  getTcOverride();
  57. #endif
  58.  
  59.     vertexClass *backside;
  60.  
  61.     // Color
  62.     void setColor(F4 col);
  63.     void setRgbOverride(int flag);
  64.     int  getRgbOverride();
  65.  
  66.     // Functions used to add polygon normals
  67.     void addNormalFrom(triangleClass *n);
  68.     void addNormalFrom(polygonClass *n);
  69.  
  70.     // Normal Compute & Reset
  71.     void resetNormal();
  72.     void computeNormal();
  73.     void setNormalOverride(int flag);
  74.     int  getNormalOverride();
  75.  
  76.     // Normal Retrieval
  77.     vectorClass *getNormal();
  78.     void              getNormal(V3 vals);
  79.  
  80.     // Normal compute check
  81.     int isNormalComputed();
  82.  
  83.     // Polygon usage
  84.     int isVertexUsed();
  85.  
  86.     // Position Retrieval
  87.     void getPosition(V3 pos);
  88.  
  89.     // Position Assignement
  90.     void setPosition(V3 pos);
  91.     void setPosition(Vres posY, Vres posX, Vres posZ);
  92.     void setPosition(positionClass pos);
  93.  
  94.     // ID Retrieval
  95.     int getId();
  96.  
  97.     vertexClass *createBackside();
  98.  
  99. #ifndef AMBERRT
  100.     // Texture Coordinate Assignement
  101.     //void setTextureCoord(D2 pos);
  102.  
  103.     // Texture Coordinate Retrieval
  104.     //void getTextureCoord(D2 pos);
  105. #endif
  106.  
  107.     // Constructors
  108.     vertexClass(V3 posIn);
  109.     vertexClass(Vres xPos=0.0, Vres yPos=0.0, Vres zPos=0.0);
  110.  
  111.     // Destructor
  112.     ~vertexClass();
  113. };
  114.  
  115. #endif
  116.