00001 # ifndef Conjecture_Line_h
00002 # define Conjecture_Line_h Conjecture_Line_h
00003
00004
00005
00006
00007
00008 #include "Element.h"
00009
00010
00011 namespace Conjecture {
00012
00032 class Line : public Element {
00033 public:
00034
00035 Line(Element* parent, const Coord& topleft, const Coord& bottomright, u2 bottom, u2 base, u2 mid, u2 top);
00036
00037
00038 inline const u2 & midY() const { return this->_midY; }
00039 inline const u2 & baseY() const { return this->_baseY; }
00040 virtual int type() const { return Type; }
00041
00042
00043 inline const u2 & upperY() const { return this->_upperY; }
00044 inline const u2 & lowerY() const { return this->_lowerY; }
00045
00046
00052 virtual Line* asLine() { return this; }
00053 virtual const Line* asLine() const { return this; }
00054
00062 virtual void printSummary(std::ostream& os = std::cerr, const std::string& indent = "", int index = -1) const;
00063
00073 static void test(int argc = 0, const char* argv[] = NULL);
00074
00079 virtual void writeText(std::ostream& os) const;
00080
00081 protected:
00082
00083 inline void midYIs(const u2 & midY) { this->_midY = midY; }
00084 inline void baseYIs(const u2 & baseY) { this->_baseY = baseY; }
00085
00086
00087 inline void upperYIs(const u2 & upperY) { this->_upperY = upperY; }
00088 inline void lowerYIs(const u2 & lowerY) { this->_lowerY = lowerY; }
00089
00090
00091
00092 private:
00093
00094 inline u2 & midYRef() { return this->_midY; }
00095 inline u2 & baseYRef() { return this->_baseY; }
00096
00097
00098 inline u2 & upperYRef() { return this->_upperY; }
00099 inline u2 & lowerYRef() { return this->_lowerY; }
00100
00101
00102
00103
00104
00105
00114 u2 _upperY;
00115
00122 u2 _midY;
00123
00130 u2 _baseY;
00131
00139 u2 _lowerY;
00140 static const ElementType Type = ELEMENT_LINE;
00141 };
00142 };
00143
00144 # endif // Conjecture_Line_h
00145