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

#include <opennurbs_ipoint.h>

Public Member Functions

 ON_2iVector ()=default
 
 ON_2iVector (const ON_2iVector &)=default
 
 ON_2iVector (int x, int y)
 
 ~ON_2iVector ()=default
 
bool IsNotZero () const
 
bool IsSet () const
 
bool IsZero () const
 
ON_2iVectoroperator*= (int)
 
ON_2iVectoroperator+= (const class ON_2iVector &)
 
ON_2iVector operator- () const
 
ON_2iVectoroperator-= (const class ON_2iVector &)
 
ON_2iVectoroperator= (const ON_2iVector &)=default
 

Static Public Member Functions

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

Public Attributes

ON__INT32 x
 
ON__INT32 y
 

Static Public Attributes

static const ON_2iVector UnitX
 (1,0) More...
 
static const ON_2iVector UnitY
 (0,1) More...
 
static const ON_2iVector Unset
 (ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX) More...
 
static const ON_2iVector Zero
 (0,0) More...
 

Detailed Description

A 2 dimensional vector 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_2iVector() [1/3]

ON_2iVector::ON_2iVector ( )
default

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

◆ ~ON_2iVector()

ON_2iVector::~ON_2iVector ( )
default

◆ ON_2iVector() [2/3]

ON_2iVector::ON_2iVector ( const ON_2iVector )
default

◆ ON_2iVector() [3/3]

ON_2iVector::ON_2iVector ( int  x,
int  y 
)

Member Function Documentation

◆ Compare()

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

Dictionary order compare.

◆ From2dex()

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

◆ FromPoint()

static const ON_2iVector ON_2iVector::FromPoint ( const class ON_2iPoint p)
static

For those times when a direction was incorrectly represented by a point. It is intentional that there is not an ON_2iVector constructor from an ON_2iPoint.

◆ IsNotZero()

bool ON_2iVector::IsNotZero ( ) const

Returns: IsSet() && (0 != x || 0 != y)

◆ IsSet()

bool ON_2iVector::IsSet ( ) const

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

◆ IsZero()

bool ON_2iVector::IsZero ( ) const

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

◆ operator*=()

ON_2iVector& ON_2iVector::operator*= ( int  )

◆ operator+=()

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

◆ operator-()

ON_2iVector ON_2iVector::operator- ( ) const

◆ operator-=()

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

◆ operator=()

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

Member Data Documentation

◆ UnitX

const ON_2iVector ON_2iVector::UnitX
static

(1,0)

◆ UnitY

const ON_2iVector ON_2iVector::UnitY
static

(0,1)

◆ Unset

const ON_2iVector ON_2iVector::Unset
static

(ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX)

◆ x

ON__INT32 ON_2iVector::x

◆ y

ON__INT32 ON_2iVector::y

◆ Zero

const ON_2iVector ON_2iVector::Zero
static

(0,0)