API:System.Types.TPoint

Aus RAD Studio API Documentation
Wechseln zu: Navigation, Suche

Delphi

TPoint = record

C++

struct TPoint: public POINT  {
  TPoint() _ALWAYS_INLINE
  { x = y = 0; }
  TPoint(int _x, int _y) _ALWAYS_INLINE
  { x=_x; y=_y; }
  bool operator ==(const TPoint& pt) const _ALWAYS_INLINE {
    return (x == pt.x) && (y == pt.y);
  }
  bool operator !=(const TPoint& pt) const _ALWAYS_INLINE {
    return !(pt == *this);
  }
  TPoint operator +(const TPoint& rhs) const _ALWAYS_INLINE {
    return TPoint(rhs.x + this->x, rhs.y + this->y);
  }
  TPoint operator -(const TPoint& rhs) const _ALWAYS_INLINE {
    return TPoint(this->x - rhs.x, this->y - rhs.y );
  }
  TPoint& operator +=(const TPoint& rhs) _ALWAYS_INLINE {
    this->x += rhs.x;
    this->y += rhs.y;
    return *this;
  }
  TPoint& operator -=(const TPoint& rhs) _ALWAYS_INLINE {
    this->x -= rhs.x;
    this->y -= rhs.y;
    return *this;
  }
  bool IsZero() const _ALWAYS_INLINE {
    return !x && !y;
  }
  bool IsEmpty() const _ALWAYS_INLINE {
    return IsZero();
  }
  void Offset(int DX, int DY) _ALWAYS_INLINE {
    x += DX;
    y += DY;
  }
  void SetLocation(int nX, int nY) _ALWAYS_INLINE {
    x = nX;
    y = nY;
  }
  void SetLocation(const TPoint& p) _ALWAYS_INLINE {
    x = p.x;
    y = p.y;
  }
  double Distance(const TPoint& p2) const _ALWAYS_INLINE {
    return hypot(static_cast<double>(p2.x - this->x), static_cast<double>(p2.y - this->y));
  }
  static int __fastcall _sqr(int i) _ALWAYS_INLINE { // Helper - private?
     return i*i;
  }
  bool PtInCircle(const TPoint& CircleCenter, int Radius) const _ALWAYS_INLINE {
    return (Radius > 0) && ((_sqr(CircleCenter.x-x)+_sqr(CircleCenter.y-y)) < _sqr(Radius));
  }
  float Angle(const TPoint& P) const _ALWAYS_INLINE {
    return atan2((float)y - P.y,(float)x - P.x);
  }
  __property LONG X = { read=x,   write=x  };
  __property LONG Y = { read=y,   write=y  };
};

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
record
struct
public
System.Types.pas
SystemTypes.h
System.Types System.Types

Beschreibung

Embarcadero Technologies verfügt zurzeit über keine zusätzlichen Informationen. Bitte unterstützen Sie uns bei der Dokumentation dieses Themas, indem Sie Ihre Kommentare auf der Diskussionsseite eingeben.