Rhino C++ API  8.6
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_4iRect Class Reference

#include <opennurbs_ipoint.h>

Public Member Functions

 ON_4iRect ()=default
 
 ON_4iRect (const ON_2iPoint &point, const ON_2iSize &size)
 
 ON_4iRect (const ON_2iPoint topLeft, const ON_2iPoint &bottomRight)
 
 ON_4iRect (const ON_4iRect &)=default
 
 ON_4iRect (int left, int top, int right, int bottom)
 
 ~ON_4iRect ()=default
 
const ON_2iPoint BottomRight (void) const
 
const ON_2iPoint CenterPoint (void) const
 
void DeflateRect (int, int)
 
int Height (void) const
 
void InflateRect (int, int)
 
void InflateRect (int, int, int, int)
 
bool IntersectRect (const ON_4iRect &r1, const ON_4iRect &r2)
 
bool IntersectRect (const ON_4iRect *r1, const ON_4iRect *r2)
 
bool IsRectEmpty (void) const
 
bool IsRectNull (void) const
 
bool IsSet () const
 
bool IsZero () const
 
void NormalizeRect ()
 
void OffsetRect (const ON_2iVector &)
 
void OffsetRect (int, int)
 
ON_4iRectoperator= (const ON_4iRect &)=default
 
bool PtInRect (const ON_2iPoint &pt) const
 
void SetRect (int l, int t, int r, int b)
 
void SetRectEmpty (void)
 
void SetZero ()
 
const ON_2iSize Size (void) const
 
bool SubtractRect (const ON_4iRect *rect1, const ON_4iRect *rect2)
 
const ON_2iPoint TopLeft (void) const
 
int Width (void) const
 

Public Attributes

ON__INT32 bottom
 
ON__INT32 left
 
ON__INT32 right
 
ON__INT32 top
 

Static Public Attributes

static const ON_4iRect Unset
 (ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX) More...
 
static const ON_4iRect Zero
 (0,0,0,0) More...
 

Detailed Description

Class ON_4iRect For those situations where a Windows SDK RECT or MFC CRect value needs to be used in code that does not link with MFC. If you want a traditional bounding box, use ON_2dBoundingBox.

Constructor & Destructor Documentation

◆ ON_4iRect() [1/5]

ON_4iRect::ON_4iRect ( )
default

Default construction intentionally leaves x and y uninitialized. Use something like ON_4iRect pt(1,2,3,4); or ON_4iRect pt = ON_4iRect::Zero; when you need an initialized ON_4iRect.

◆ ~ON_4iRect()

ON_4iRect::~ON_4iRect ( )
default

◆ ON_4iRect() [2/5]

ON_4iRect::ON_4iRect ( const ON_4iRect )
default

◆ ON_4iRect() [3/5]

ON_4iRect::ON_4iRect ( int  left,
int  top,
int  right,
int  bottom 
)

◆ ON_4iRect() [4/5]

ON_4iRect::ON_4iRect ( const ON_2iPoint  topLeft,
const ON_2iPoint bottomRight 
)

◆ ON_4iRect() [5/5]

ON_4iRect::ON_4iRect ( const ON_2iPoint point,
const ON_2iSize size 
)

Member Function Documentation

◆ BottomRight()

const ON_2iPoint ON_4iRect::BottomRight ( void  ) const

◆ CenterPoint()

const ON_2iPoint ON_4iRect::CenterPoint ( void  ) const

◆ DeflateRect()

void ON_4iRect::DeflateRect ( int  ,
int   
)

◆ Height()

int ON_4iRect::Height ( void  ) const

◆ InflateRect() [1/2]

void ON_4iRect::InflateRect ( int  ,
int   
)

◆ InflateRect() [2/2]

void ON_4iRect::InflateRect ( int  ,
int  ,
int  ,
int   
)

◆ IntersectRect() [1/2]

bool ON_4iRect::IntersectRect ( const ON_4iRect r1,
const ON_4iRect r2 
)

◆ IntersectRect() [2/2]

bool ON_4iRect::IntersectRect ( const ON_4iRect r1,
const ON_4iRect r2 
)

◆ IsRectEmpty()

bool ON_4iRect::IsRectEmpty ( void  ) const

◆ IsRectNull()

bool ON_4iRect::IsRectNull ( void  ) const

◆ IsSet()

bool ON_4iRect::IsSet ( ) const

Returns: true if none of left, top, right, or bottom is set to ON_UNSET_INT_INDEX

◆ IsZero()

bool ON_4iRect::IsZero ( ) const

Returns: true if all of left, top, right, and bottom are set to 0.

◆ NormalizeRect()

void ON_4iRect::NormalizeRect ( )

◆ OffsetRect() [1/2]

void ON_4iRect::OffsetRect ( const ON_2iVector )

◆ OffsetRect() [2/2]

void ON_4iRect::OffsetRect ( int  ,
int   
)

◆ operator=()

ON_4iRect& ON_4iRect::operator= ( const ON_4iRect )
default

◆ PtInRect()

bool ON_4iRect::PtInRect ( const ON_2iPoint pt) const

◆ SetRect()

void ON_4iRect::SetRect ( int  l,
int  t,
int  r,
int  b 
)

◆ SetRectEmpty()

void ON_4iRect::SetRectEmpty ( void  )
inline

◆ SetZero()

void ON_4iRect::SetZero ( )

◆ Size()

const ON_2iSize ON_4iRect::Size ( void  ) const

◆ SubtractRect()

bool ON_4iRect::SubtractRect ( const ON_4iRect rect1,
const ON_4iRect rect2 
)

◆ TopLeft()

const ON_2iPoint ON_4iRect::TopLeft ( void  ) const

◆ Width()

int ON_4iRect::Width ( void  ) const

Member Data Documentation

◆ bottom

ON__INT32 ON_4iRect::bottom

◆ left

ON__INT32 ON_4iRect::left

NOTE WELL: Windows 2d integer device coordinates have a strong y-down bias and it is common for top < bottom. General 2d bounding boxes have a strong lower < upper / min < max bias. Take care when converting between ON_2iBoundingBox and ON_4iRect. It is intentional that no automatic conversion between bounding box and ON_4iRect is supplied because each case must be carefully considered.

◆ right

ON__INT32 ON_4iRect::right

◆ top

ON__INT32 ON_4iRect::top

◆ Unset

const ON_4iRect ON_4iRect::Unset
static

(ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX)

◆ Zero

const ON_4iRect ON_4iRect::Zero
static

(0,0,0,0)