MKI_RECT (Basic Classes) Changed in Version 2019.1

www.CAD6.com

This class contains the description of a 2D rectangle.

 

C++ Syntax

class MKI_RECT

{

  public:

 

  double x1,

         y1,

         x2,

         y2;

 

  MKI_RECT( void );

 

  MKI_RECT(

 const MKI_RECT* f_pThis )

 

  MKI_RECT(

 const MKI_INTRECT& f_rRect )

 

  MKI_RECT(

 const double f_dX1,

 const double f_dY1,

 const double f_dX2,

 const double f_dY2 )

 

  MKI_RECT(

 const MKI_POINT& f_rPoint1,

 const MKI_POINT& f_rPoint2 )

 

  MKI_RECT(

 const MKI_QUAD& f_rQuad );

 

  operator MKI_POINT*();

 

  void

  SetZero( void );

 

  bool

  IsZero( void ) const;

 

  bool

  IsNonZero( void ) const;

 

  void

  SetMaximum( void );

 

  void

  SetInvalid( void );

 

  bool

  IsValid( void ) const;

 

  bool

  IsInvalid( void ) const;

 

  void

  Set(

 const double f_dX1,

 const double f_dY1,

 const double f_dX2,

 const double f_dY2 );

 

  void

  Set(

 const MKI_POINT& f_rPoint1,

 const MKI_POINT& f_rPoint2 );

 

  void

  Set(

 const MKI_POINT& f_rPoint );

 

  void

  SetMinMax(

 const MKI_RECT& f_rRect );

 

  void

  SetMinMax(

 const double f_dX1,

 const double f_dY1,

 const double f_dX2,

 const double f_dY2 );

 

  void

  SetMinMax(

 const MKI_POINT& f_rPoint1,

 const MKI_POINT& f_rPoint2 );

 

  void

  SetMinMax(

 const MKI_POINT* f_pPoint,

 __int32 f_nCount );

 

  void

  SetCombine(

 const MKI_RECT& f_rRect1,

 const MKI_RECT& f_rRect2 );

 

  void

  SetIntersect(

 const MKI_RECT& f_rRect1,

 const MKI_RECT& f_rRect2 );

 

  bool

  IsDisjoint(

 const MKI_RECT& f_rRect ) const;

 

  bool

  IsOutside(

 const MKI_RECT& f_rRect ) const;

 

  void

  Combine(

 const MKI_RECT& f_rRect );

 

  void

  Intersect(

 const MKI_RECT& f_rRect );

 

  void

  Include(

 const MKI_POINT& f_rPoint );

 

  void

  Include(

 double d_fX, double f_dY );

 

  bool

  Contains(

 const MKI_POINT& f_rPoint ) const;

 

  void

  Expand(

 const double f_dAmount );

 

  void

  Expand(

 const double f_dAmountX,

 const double f_dAmountY );

 

  void

  Move(

 const MKI_VECTOR& f_rVector );

 

  void

  Move(

 const MKI_MATRIX& f_rMatrix );

 

  void

  Multiply(

 const MKI_MATRIX& f_rMatrix );

 

  void

  SetMultiply(

 const MKI_MATRIX& f_rMatrix,

 const MKI_RECT& f_rRect );

 

  double

  GetMinX( void ) const;

 

  double

  GetMinY( void ) const;

 

  double

  GetMaxX( void ) const;

 

  double

  GetMaxY( void ) const;

 

  double

  GetAbsSizeX( void ) const;

 

  double

  GetAbsSizeY( void ) const;

 

  void

  GetAbsSize(

 MKI_VECTOR& f_rSize ) const;

 

  double

  GetCenterX( void ) const;

 

  double

  GetCenterY( void ) const;

 

  void

  GetCenter(

 MKI_POINT& f_rCenter ) const;

 

  void

  GetCenter(

 MKI_VECTOR& f_rCenter ) const;

 

  double

  GetArea( void ) const;

};

 

Element Description

x1

y1

[double] X- and Y-Coordinate of the first corner-point of the rectangle. The coordinates are in [mm] relative to the page center.

x2

y2

[double] X- and Y-Coordinate of the second corner-point of the rectangle. The coordinates are in [mm] relative to the page center.

 

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_RECT is used to store the dimensions of a rectangular frame. Such frames are usually used to store the surrounding frames of blocks or characters.

 

CAD6interface 2026.1 - Copyright 2026 Malz++Kassner® GmbH