// cEdge.h
// 2/27/04
// The edge class stores pointers to the faces
// and vertices associated with it.

#ifndef cedge_h
#define cedge_h

#include "OGLPlatformSpecific.h"
#include "ForwardDeclarations.h"
#include "cTriangle.h"
#include "cVertex.h"

class cEdge
{
public:
    cTriangle *f0_, *f1_; // faces adjacent to the edge
    cVertex *v0_, *v1_; // vertices at end points of edge
    float standardizedX_; // the x component of the standardized edge

    cEdge(); // sets face and vertex pointers to null
    
    cEdge(cVertex* v0, cVertex* v1);
    
    // copy constructor, should only be used in the creation of the triangle
    // mesh, before standardization, because it will not copy standardization info.
    cEdge(const cEdge& toCopy); 
    
    // calculates standardized version of the edge
    void standardizeEdge(); 	
    
    // return an edge with the x coordinate of the standardized edge.
    float* cEdge::getStandardEdgeTransform();	
	
    // modified the referenced variable normal and returns the number
    // of normals it averaged
    void getSumForwardFacingNormal(cVector& incident, cVector& normal);
    
    // if both of the face adjacent to this edge are null, set f0.
    // if the first is set and the second is null, set f1.
    // if both are set, this shouldnt have been called
    void setAvailableFace(cTriangle* face);


    bool hasBeenAddedToCollisionList_;	// used by build collision lists so edges are never added more than once

private:
    float edgeTransform_[16];	
};

#endif // end define cedge_h