public bool _drawCreate(Point2I nPoint, string nId, Graphics nGraphics) { Rect2I labelRect2I_ = this._getRect2I(); if (!labelRect2I_._contain(nPoint)) { return false; } if (mRectShapes.Count <= 0) { if (this._rectIdSel(nId)) { base._rectDrawCreate(nGraphics, labelRect2I_); return true; } return false; } Rect2I rect2i_ = new Rect2I(labelRect2I_); rect2i_._setHeight(mLabelHeight); if (rect2i_._contain(nPoint)) { if (this._rectIdSel(nId)) { base._rectDrawCreate(nGraphics, labelRect2I_); return true; } return false; } rect2i_._offset(0, mLabelHeight); rect2i_._setHeight(mRectHeight); foreach (RectShape i in mRectShapes) { if (rect2i_._contain(nPoint)) { if (i._rectIdSel(nId)) { i._rectDrawCreate(nGraphics, rect2i_); return true; } return false; } rect2i_._offset(0, mRectHeight); } return false; }
public bool _intersectWith(Rect2I nRect) { Point2I lt0_ = this._getPoint(); Point2I lb0_ = this._getLBPoint(); Point2I rt0_ = this._getRTPoint(); Point2I rb0_ = this._getRBPoint(); if (nRect._contain(lt0_)) { return true; } if (nRect._contain(lb0_)) { return true; } if (nRect._contain(rt0_)) { return true; } if (nRect._contain(rb0_)) { return true; } Point2I lt1_ = nRect._getPoint(); Point2I lb1_ = nRect._getLBPoint(); Point2I rt1_ = nRect._getRTPoint(); Point2I rb1_ = nRect._getRBPoint(); if (this._contain(lt1_)) { return true; } if (this._contain(lb1_)) { return true; } if (this._contain(rt1_)) { return true; } if (this._contain(rb1_)) { return true; } int x00_ = this._getX(); int y00_ = this._getY(); int x01_ = this._getRTX(); int y01_ = this._getLBY(); int x10_ = nRect._getX(); int y10_ = nRect._getY(); int x11_ = nRect._getRTX(); int y11_ = nRect._getLBY(); if (x00_ < x10_ && x01_ > x11_ && y00_ > y10_ && y01_ < y11_) { return true; } if (x00_ > x10_ && x01_ < x11_ && y00_ < y10_ && y01_ > y11_) { return true; } return false; }
public bool _isSelect(int nX, int nY, int nDistance = 3) { Rect2I rect_ = new Rect2I(mBeg, mEnd); rect_._offset(-nDistance, -nDistance); rect_._sizeOffset(nDistance * 2, nDistance * 2); if (!rect_._contain(nX, nY)) { return false; } double distance_ = this._distance(nX, nY); if (distance_ < nDistance) { return true; } return false; }