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

#include <opennurbs_ipoint.h>

Public Member Functions

 ON_2iPoint ()=default
 
 ON_2iPoint (const ON_2iPoint &)=default
 
 ON_2iPoint (int x, int y)
 
 ~ON_2iPoint ()=default
 
bool IsOrigin () const
 
bool IsSet () const
 
ON_2iPointoperator+= (const class ON_2iVector &)
 
ON_2iPointoperator-= (const class ON_2iVector &)
 
ON_2iPointoperator= (const ON_2iPoint &)=default
 

Static Public Member Functions

static int Compare (const ON_2iPoint &lhs, const ON_2iPoint &rhs)
 
static const ON_2iPoint From2dex (const class ON_2dex &src)
 
static const ON_2iPoint FromVector (const class ON_2iVector &v)
 

Public Attributes

ON__INT32 x
 
ON__INT32 y
 

Static Public Attributes

static const ON_2iPoint Origin
 (0,0) More...
 
static const ON_2iPoint Unset
 (ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX) More...
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org. A 2 dimensional point with integer coordinates. Clear code will distinguish between situation where (x,y) is a location (ON_2iPoint) or a direction (ON_2iVector) and use the appropriate class.

Constructor & Destructor Documentation

◆ ON_2iPoint() [1/3]

ON_2iPoint::ON_2iPoint ( )
default

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

◆ ~ON_2iPoint()

ON_2iPoint::~ON_2iPoint ( )
default

◆ ON_2iPoint() [2/3]

ON_2iPoint::ON_2iPoint ( const ON_2iPoint )
default

◆ ON_2iPoint() [3/3]

ON_2iPoint::ON_2iPoint ( int  x,
int  y 
)

Member Function Documentation

◆ Compare()

static int ON_2iPoint::Compare ( const ON_2iPoint lhs,
const ON_2iPoint rhs 
)
static

Dictionary order compare.

◆ From2dex()

static const ON_2iPoint ON_2iPoint::From2dex ( const class ON_2dex src)
static

◆ FromVector()

static const ON_2iPoint ON_2iPoint::FromVector ( const class ON_2iVector v)
static

It is intentional that points are not added to points to encourage code that is clear about what is a location and what is displacement. For those times when a location was incorrectly represented by a vector. It is intentional that ther is not an ON_2iPoint constructor from an ON_2iVector.

◆ IsOrigin()

bool ON_2iPoint::IsOrigin ( ) const

Returns: (0 == x && 0 == y)

◆ IsSet()

bool ON_2iPoint::IsSet ( ) const

Returns: (ON_UNSET_INT_INDEX == x || ON_UNSET_INT_INDEX ==y)

◆ operator+=()

ON_2iPoint& ON_2iPoint::operator+= ( const class ON_2iVector )

◆ operator-=()

ON_2iPoint& ON_2iPoint::operator-= ( const class ON_2iVector )

◆ operator=()

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

Member Data Documentation

◆ Origin

const ON_2iPoint ON_2iPoint::Origin
static

(0,0)

◆ Unset

const ON_2iPoint ON_2iPoint::Unset
static

(ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX)

◆ x

ON__INT32 ON_2iPoint::x

◆ y

ON__INT32 ON_2iPoint::y