// octreeEdge.h: interface for the octreeEdge class. // ////////////////////////////////////////////////////////////////////// #ifndef __OCTREEEDGE_H__ #define __OCTREEEDGE_H__ #include "mathlib/mathlib.h" class octreeEdge { public: octreeEdge(); octreeEdge(Point& p1, Point& p2); virtual ~octreeEdge(); //evaluate the curve at t, where 0<= t <=1 float evaluateEdge(float t); float evaluateD(float t); //evaluate derivative at t //edge type enum edgeType {REGULAR=0, SHORT=1, TSHORT=2, LONG=3}; edgeType m_edgeType; //compute a,b and c from sample points on the edge void computeABCFromSamples(const float d1, const float d2, const float d3); //For an edge that is divided by two half-size egdes, //the curves of the edge with a,b and c should be shared //by the two half-size edges. when front is true, a', b' and c' //are for the front half-size edge, when false, the end half-size edge static void decompose(bool front, octreeEdge& longEdge, octreeEdge& shortEdge); static void decompose(bool front, float d1, float d2, float d3, float& aS, float& bS, float& cS); //data access functions float getA() const { return m_a;} float getB() const { return m_b;} float getC() const { return m_c;} Point getStartPoint() { return m_pointStart;} Point getEndPoint() { return m_pointEnd;} //data modifying functions void setStartPoint(Point& p){ m_pointStart = p;}; void setEndPoint(Point& p){ m_pointEnd = p;}; void setABC(const float a, const float b, const float c){ m_a =a; m_b=b; m_c=c;} int m_nDir[2]; //faces that share this edge, for example, if edge is number 0 edge, m_nDir[0] = octreeNode::F, m_nDir[1] = octreeNode::B private: float m_a, m_b, m_c; //edge represents a quadratic curve. m_a, m_b, m_c are coefficient of the quadratic curve equation Point m_pointStart,m_pointEnd; //starting point and ending point of the edge }; #endif // __OCTREEEDGE_H__