void touch() const;
/// access to cached x coordinate of last drawing
- int xo() const { return xo_; }
+ int xo() const;
/// access to cached y coordinate of last drawing
- int yo() const { return yo_; }
+ int yo() const;
/// access to cached x coordinate of mid point of last drawing
- int xm() const { return xo_ + dim_.wid / 2; }
+ int xm() const { return xo() + dim_.wid / 2; }
/// access to cached y coordinate of mid point of last drawing
- int ym() const { return yo_ + (dim_.des - dim_.asc) / 2; }
- ///
- bool contains(int x, int y) const;
+ int ym() const { return yo() + (dim_.des - dim_.asc) / 2; }
/// write access to coordinate;
void setXY(int x, int y) const;
/// returns x coordinate of given position in the array
Dimension const & dim() const { return dim_; }
/// dimensions of cell
void setDim(Dimension const & d) const { dim_ = d; }
- /// bounding box of this cell
- void boundingBox(int & xlow, int & xhigh, int & ylow, int & yhigh);
- /// gives center coordinates
- void center(int & x, int & y) const;
- /// adjust (x,y) to point on boundary on a straight line from the center
- void towards(int & x, int & y) const;
private:
/// is this an exact match at this position?
/// cached dimensions of cell
mutable Dimension dim_;
- /// cached x coordinate of last drawing
- mutable int xo_;
- /// cached y coordinate of last drawing
- mutable int yo_;
- /// cached cleaness of cell
- mutable bool clean_;
- /// cached draw status of cell
- mutable bool drawn_;
};
///