home *** CD-ROM | disk | FTP | other *** search
- //**********************************************************************
- // DIVE Laboratories, Inc.
- // Copyright(c) 1995
- // All rights reserved.
- // FILE: VERTEX.HPP
- //
- // DESCRIPTION
- // This file provides the function prototypes for the
- // vertexClass
- //
- // Author: M. Doucet
- //
- // Modification History:
- // 4/4/95 Created//
- //**********************************************************************
- #ifndef VERTEX_HPP
- #define VERTEX_HPP
-
- #include "position.hpp"
- #include "vector.hpp"
-
- #ifndef AMBERRT
- #include "material.hpp"
- #endif
-
- class triangleClass;
- class quadClass;
- class polygonClass;
-
- class vertexClass {
-
- private:
-
- // Private Data
- int nPolys, // Number of polygons that use this vertex
- Id; // Vertex Amber ID
- vectorClass tempNormal; // Temporary normal used for computation
- int normalComputed; // Flag indicating if normal is computed
-
- public:
-
- // Public Data (public access for speed)
- positionClass pt; // Position
- vectorClass normal; // Normal
-
- F4 color;
- int geoVertexIndex;
- int normalOverride, // Indicates that the user has supplied a normal
- rgbOverride, // Indicates that the user has supplied an rgb color
- tcOverride; // Indicates that the user has supplied a texture coordinate
- flagType isBackSide; //AMB90009
- #ifndef AMBERRT
- materialClass *mat;
- F2 texCoord;
- void setTcOverride(int flag);
- int getTcOverride();
- #endif
-
- vertexClass *backside;
-
- // Color
- void setColor(F4 col);
- void setRgbOverride(int flag);
- int getRgbOverride();
-
- // Functions used to add polygon normals
- void addNormalFrom(triangleClass *n);
- void addNormalFrom(polygonClass *n);
-
- // Normal Compute & Reset
- void resetNormal();
- void computeNormal();
- void setNormalOverride(int flag);
- int getNormalOverride();
-
- // Normal Retrieval
- vectorClass *getNormal();
- void getNormal(V3 vals);
-
- // Normal compute check
- int isNormalComputed();
-
- // Polygon usage
- int isVertexUsed();
-
- // Position Retrieval
- void getPosition(V3 pos);
-
- // Position Assignement
- void setPosition(V3 pos);
- void setPosition(Vres posY, Vres posX, Vres posZ);
- void setPosition(positionClass pos);
-
- // ID Retrieval
- int getId();
-
- vertexClass *createBackside();
-
- #ifndef AMBERRT
- // Texture Coordinate Assignement
- //void setTextureCoord(D2 pos);
-
- // Texture Coordinate Retrieval
- //void getTextureCoord(D2 pos);
- #endif
-
- // Constructors
- vertexClass(V3 posIn);
- vertexClass(Vres xPos=0.0, Vres yPos=0.0, Vres zPos=0.0);
-
- // Destructor
- ~vertexClass();
- };
-
- #endif
-