00001 # ifndef Line_h
00002 # define Line_h Line_h
00003
00004
00005 #include "Element.h"
00006
00007
00008 namespace Conjecture {
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 class Line : public Element {
00023 public:
00024
00025 Line(Element* parent, const Coord& topleft, const Coord& bottomright, u2 bottom, u2 base, u2 mid, u2 top);
00026
00027
00028 inline const u2 & topY() const { return this->_topY; }
00029 inline const u2 & midY() const { return this->_midY; }
00030 inline const u2 & baseY() const { return this->_baseY; }
00031 inline const u2 & bottomY() const { return this->_bottomY; }
00032 virtual int type() const { return Type; }
00033
00039 virtual Line* asLine() { return this; }
00040 virtual const Line* asLine() const { return this; }
00041
00049 virtual void printSummary(std::ostream& os = std::cerr, const std::string& indent = "", int index = -1) const;
00050
00060 static void test(int argc = 0, const char* argv[] = NULL);
00061
00066 virtual void writeText(std::ostream& os) const;
00067
00068 protected:
00069
00070 inline void topYIs(const u2 & topY) { this->_topY = topY; }
00071 inline void midYIs(const u2 & midY) { this->_midY = midY; }
00072 inline void baseYIs(const u2 & baseY) { this->_baseY = baseY; }
00073 inline void bottomYIs(const u2 & bottomY) { this->_bottomY = bottomY; }
00074
00075
00076
00077 private:
00078
00079 inline u2 & topYRef() { return this->_topY; }
00080 inline u2 & midYRef() { return this->_midY; }
00081 inline u2 & baseYRef() { return this->_baseY; }
00082 inline u2 & bottomYRef() { return this->_bottomY; }
00083
00084
00085
00086
00087
00094 u2 _topY;
00095
00102 u2 _midY;
00103
00110 u2 _baseY;
00111
00118 u2 _bottomY;
00119 static const ElementType Type = ELEMENT_LINE;
00120 };
00121 };
00122
00123 # endif // Line_h
00124