#ifndef TMeshEdge_hxx_seen #define TMeshEdge_hxx_seen #include namespace COMET { class IMesh; class IMeshPoint; class IMeshEdge; }; class COMET::IMeshEdge { friend class IMesh; friend class IMeshPoint; public: /// Create a new edge in the mesh. IMeshEdge(IMeshPoint* a, IMeshPoint* b); virtual ~IMeshEdge(); /// Get the first mesh point in the edge. This mesh point will be at a /// lesser X, or if the X is equal, a lesser Y coordinate. IMeshPoint* GetHead() const {return fHead;} /// Get the second point of the edge. IMeshPoint* GetTail() const {return fTail;} /// Get the other end of the edge. This will return NULL if /// argument is not one of the points in the edge. IMeshPoint* GetOther(const IMeshPoint* a) const; /// Return the length of the edge in the abstract coordinate system. double GetLength(void) const; /// Return the length of the edge in the abstract coordinate system with /// scale factors applied. These are multiplicative scale factors, and /// the length is calculated /// l=sqrt((xScale*(x1-x2))^2+(yScale*(y1-y2))^2). double GetLength(double xScale, double yScale) const; bool operator == (const IMeshEdge& rhs) const; bool operator < (const IMeshEdge& rhs) const; private: /// The first mesh point in the edge. This mesh point will be at a lesser /// X, or if the X is equal, a lesser Y coordinate. IMeshPoint* fHead; /// The second mesh point in the edge. IMeshPoint* fTail; }; namespace COMET { struct TMeshEdgePointerLessThan { bool operator () (const COMET::IMeshEdge* a, const COMET::IMeshEdge* b) const { return *a < *b; } }; typedef std::set TMeshEdgeSet; }; std::ostream& operator << (std::ostream& s, COMET::IMeshEdge& p); #endif