MKI_INTRECT (Basic Classes) Changed in Version 2022.0

www.CAD6.com

This class contains the description of a 2D rectangle with integer coordinates.

 

C++ Syntax

class MKI_INTRECT : public RECT

{

  public:

 

  MKI_INTRECT( void );

 

  MKI_INTRECT(

 const __int32 f_nX1,

 const __int32 f_nY1,

 const __int32 f_nX2,

 const __int32 f_nY2 );

 

  MKI_INTRECT( const MKI_INTQUAD& f_rQuad );

 

  operator POINT*();

 

  MKI_INTRECT&

  operator =(

 const RECT& f_rRect );

 

  bool

  operator ==( const RECT& f_rRect ) const;

 

  bool

  operator !=( const RECT& f_rRect ) const;

 

  void

  SetZero( void );

 

  bool

  IsZero( void ) const;

 

  bool

  IsNonZero( void ) const;

 

  void

  SetInvalid( void );

 

  bool

  IsValid( void ) const;

 

  bool

  IsInvalid( void ) const;

 

  void

  Set(

 const __int32 f_nX1,

 const __int32 f_nY1,

 const __int32 f_nX2,

 const __int32 f_nY2 );

 

  void

  Set(

 const POINT& f_rPoint1,

 const POINT& f_rPoint2 );

 

  void

  Set(

 const POINT& f_rPoint );

 

  void

  SetMinMax(

 const RECT& f_rRect );

 

  void

  SetMinMax(

 const __int32 f_nX1,

 const __int32 f_nY1,

 const __int32 f_nX2,

 const __int32 f_nY2 );

 

  void

  SetMinMax(

 const POINT& f_rPoint1,

 const POINT& f_rPoint2 );

 

  void

  SetCombine(

 const RECT& f_rRect1,

 const RECT& f_rRect2 );

 

  void

  SetIntersect(

 const RECT& f_rRect1,

 const RECT& f_rRect2 );

 

  bool

  IsDisjoint(

 const RECT& f_rRect ) const;

 

  bool

  IsOutside(

 const RECT& f_rRect ) const;

 

  void

  Combine(

 const RECT& f_rRect );

 

  void

  Intersect(

 const RECT& f_rRect );

 

  void

  Include(

 const POINT& f_rPoint );

 

  void

  Include(

 __int32 f_nX,

 __int32 f_nY );

 

  bool

  Contains(

 const MKI_INTPOINT& f_rPoint ) const;

 

  bool

  Contains(

 const MKI_POINT& f_rPoint ) const;

 

  void

  Expand(

 const __int32 f_nAmount );

 

  void

  Expand(

 const __int32 f_nAmountX,

 const __int32 f_nAmountY );

 

  void

  Move(

 const SIZE& f_rVector );

 

  __int32

  GetMinX( void ) const;

 

  __int32

  GetMinY( void ) const;

 

  __int32

  GetMaxX( void ) const;

 

  __int32

  GetMaxY( void ) const;

 

  __int32

  GetAbsSizeX( void ) const;

 

  __int32

  GetAbsSizeY( void ) const;

 

  void

  GetAbsSize(

 SIZE& f_rSize ) const;

 

  void

  GetAbsSize(

 MKI_VECTOR& f_rSize ) const;

 

  __int32

  GetCenterX( void ) const;

 

  __int32

  GetCenterY( void ) const;

 

  void

  GetCenter(

 POINT& f_rCenter ) const;

 

  void

  GetCenter(

 MKI_POINT& f_rCenter ) const;

 

  void

  GetCenter(

 SIZE& f_rCenter ) const;

 

  void

  GetCenter(

 MKI_VECTOR& f_rCenter ) const;

 

  __int32

  GetArea( void ) const;

};

 

Element Description

x1

y1

[double] X- and Y-Coordinate of the first corner-point of the rectangle. The coordinates are in units.

x2

y2

[double] X- and Y-Coordinate of the second corner-point of the rectangle. The coordinates are in units.

 

Comment

In most cases, the values in this data type have to be sorted, i.e. x1x2 and y1y2. This speeds up further calculations with these rectangles.

 

MKD Syntax

x1,y1,x2,y2

 

The data type MKI_INTRECT is used to store the dimensions of a rectangular frame. Such frames are usually used to store the surrounding frames of something.

 

CAD6interface 2026.1 - Copyright 2026 Malz++Kassner® GmbH