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

#include <opennurbs_fpoint.h>

Public Member Functions

 ON_2fPoint ()=default
 x,y not initialized More...
 
 ON_2fPoint (const double *)
 from double[2] array More...
 
 ON_2fPoint (const float *)
 from float[2] array More...
 
 ON_2fPoint (const ON_2dPoint &)
 from 2d point More...
 
 ON_2fPoint (const ON_2dVector &)
 from 2d vector More...
 
 ON_2fPoint (const ON_2fPoint &)=default
 
 ON_2fPoint (const ON_2fVector &)
 from 2f vector More...
 
 ON_2fPoint (const ON_3dPoint &)
 from 3d point More...
 
 ON_2fPoint (const ON_3dVector &)
 from 3d vector More...
 
 ON_2fPoint (const ON_3fPoint &)
 from 3f point More...
 
 ON_2fPoint (const ON_3fVector &)
 from 3f vector More...
 
 ON_2fPoint (const ON_4dPoint &)
 from 4d point More...
 
 ON_2fPoint (const ON_4fPoint &)
 from 4f point More...
 
 ON_2fPoint (float x, float y)
 
 ~ON_2fPoint ()=default
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
double DistanceTo (const ON_2fPoint &) const
 
double DistanceToSquared (const ON_2fPoint &) const
 
bool IsNotZero () const
 
bool IsUnset () const
 
bool IsValid () const
 
bool IsZero () const
 
double MaximumCoordinate () const
 absolute value of maximum coordinate More...
 
int MaximumCoordinateIndex () const
 
 operator const float * () const
 
 operator float * ()
 (float*) conversion operators More...
 
bool operator!= (const ON_2fPoint &) const
 
float operator* (const ON_2fPoint &) const
 for points acting as vectors More...
 
float operator* (const ON_2fVector &) const
 for points acting as vectors More...
 
ON_2dPoint operator* (double) const
 
ON_2fPoint operator* (float) const
 
ON_2fPoint operator* (int) const
 
ON_2fPointoperator*= (float)
 
ON_2dPoint operator+ (const ON_2dPoint &) const
 
ON_2dPoint operator+ (const ON_2dVector &) const
 
ON_2fPoint operator+ (const ON_2fPoint &) const
 
ON_2fPoint operator+ (const ON_2fVector &) const
 
ON_3dPoint operator+ (const ON_3dPoint &) const
 
ON_3dPoint operator+ (const ON_3dVector &) const
 
ON_3fPoint operator+ (const ON_3fPoint &) const
 
ON_3fPoint operator+ (const ON_3fVector &) const
 
ON_2fPointoperator+= (const ON_2fVector &)
 
ON_2dVector operator- (const ON_2dPoint &) const
 
ON_2dPoint operator- (const ON_2dVector &) const
 
ON_2fVector operator- (const ON_2fPoint &) const
 
ON_2fPoint operator- (const ON_2fVector &) const
 
ON_3dVector operator- (const ON_3dPoint &) const
 
ON_3dPoint operator- (const ON_3dVector &) const
 
ON_3fVector operator- (const ON_3fPoint &) const
 
ON_3fPoint operator- (const ON_3fVector &) const
 
ON_2fPointoperator-= (const ON_2fVector &)
 
ON_2dPoint operator/ (double) const
 
ON_2fPoint operator/ (float) const
 
ON_2fPoint operator/ (int) const
 
ON_2fPointoperator/= (float)
 
bool operator< (const ON_2fPoint &) const
 
bool operator<= (const ON_2fPoint &) const
 dictionary order comparisons More...
 
ON_2fPointoperator= (const double *)
 point = double[2] support More...
 
ON_2fPointoperator= (const float *)
 point = float[2] support More...
 
ON_2fPointoperator= (const ON_2dPoint &)
 
ON_2fPointoperator= (const ON_2dVector &)
 
ON_2fPointoperator= (const ON_2fPoint &)=default
 
ON_2fPointoperator= (const ON_2fVector &)
 
ON_2fPointoperator= (const ON_3dPoint &)
 
ON_2fPointoperator= (const ON_3dVector &)
 
ON_2fPointoperator= (const ON_3fPoint &)
 use implicit operator=(const ON_2fPoint&) More...
 
ON_2fPointoperator= (const ON_3fVector &)
 
ON_2fPointoperator= (const ON_4dPoint &)
 
ON_2fPointoperator= (const ON_4fPoint &)
 
bool operator== (const ON_2fPoint &) const
 
bool operator> (const ON_2fPoint &) const
 
bool operator>= (const ON_2fPoint &) const
 
float & operator[] (int)
 index operators mimic float[2] behavior More...
 
float operator[] (int) const
 
float & operator[] (unsigned int)
 
float operator[] (unsigned int) const
 
void Rotate (double, const ON_2fPoint &)
 
void Rotate (double, double, const ON_2fPoint &)
 
void Set (float, float)
 set 2d point value More...
 
void Transform (const ON_Xform &)
 
void Zero ()
 set all coordinates to zero; More...
 

Static Public Member Functions

static int Compare (const ON_2fPoint &lhs, const ON_2fPoint &rhs)
 
static const ON_2fPoint Midpoint (const ON_2fPoint &A, const ON_2fPoint &B)
 

Public Attributes

float x
 
float y
 

Static Public Attributes

static const ON_2fPoint NanPoint
 (ON_FLT_QNAN,ON_FLT_QNAN) More...
 
static const ON_2fPoint Origin
 (0.0f,0.0f) More...
 

Detailed Description

ON_2fPoint

Constructor & Destructor Documentation

◆ ON_2fPoint() [1/14]

ON_2fPoint::ON_2fPoint ( )
default

x,y not initialized

◆ ~ON_2fPoint()

ON_2fPoint::~ON_2fPoint ( )
default

◆ ON_2fPoint() [2/14]

ON_2fPoint::ON_2fPoint ( const ON_2fPoint )
default

◆ ON_2fPoint() [3/14]

ON_2fPoint::ON_2fPoint ( float  x,
float  y 
)
explicit

◆ ON_2fPoint() [4/14]

ON_2fPoint::ON_2fPoint ( const ON_3fPoint )
explicit

from 3f point

◆ ON_2fPoint() [5/14]

ON_2fPoint::ON_2fPoint ( const ON_4fPoint )
explicit

from 4f point

◆ ON_2fPoint() [6/14]

ON_2fPoint::ON_2fPoint ( const ON_2fVector )
explicit

from 2f vector

◆ ON_2fPoint() [7/14]

ON_2fPoint::ON_2fPoint ( const ON_3fVector )
explicit

from 3f vector

◆ ON_2fPoint() [8/14]

ON_2fPoint::ON_2fPoint ( const float *  )
explicit

from float[2] array

◆ ON_2fPoint() [9/14]

ON_2fPoint::ON_2fPoint ( const ON_2dPoint )
explicit

from 2d point

◆ ON_2fPoint() [10/14]

ON_2fPoint::ON_2fPoint ( const ON_3dPoint )
explicit

from 3d point

◆ ON_2fPoint() [11/14]

ON_2fPoint::ON_2fPoint ( const ON_4dPoint )
explicit

from 4d point

◆ ON_2fPoint() [12/14]

ON_2fPoint::ON_2fPoint ( const ON_2dVector )
explicit

from 2d vector

◆ ON_2fPoint() [13/14]

ON_2fPoint::ON_2fPoint ( const ON_3dVector )
explicit

from 3d vector

◆ ON_2fPoint() [14/14]

ON_2fPoint::ON_2fPoint ( const double *  )
explicit

from double[2] array

Member Function Documentation

◆ Compare()

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

Description: A well ordered dictionary compare function that is nan aware and can be used for robust sorting.

◆ DataCRC()

ON__UINT32 ON_2fPoint::DataCRC ( ON__UINT32  current_remainder) const

◆ DistanceTo()

double ON_2fPoint::DistanceTo ( const ON_2fPoint ) const

◆ DistanceToSquared()

double ON_2fPoint::DistanceToSquared ( const ON_2fPoint ) const

◆ IsNotZero()

bool ON_2fPoint::IsNotZero ( ) const

Returns: true if at lease one coordinate is not zero and no coordinates are unset or nans.

◆ IsUnset()

bool ON_2fPoint::IsUnset ( ) const

Returns: True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT

◆ IsValid()

bool ON_2fPoint::IsValid ( ) const

Returns: False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite. True, otherwise.

◆ IsZero()

bool ON_2fPoint::IsZero ( ) const

Returns: true if all coordinates are not zero and no coordinates are nans. false otherwise.

◆ MaximumCoordinate()

double ON_2fPoint::MaximumCoordinate ( ) const

absolute value of maximum coordinate

◆ MaximumCoordinateIndex()

int ON_2fPoint::MaximumCoordinateIndex ( ) const

◆ Midpoint()

static const ON_2fPoint ON_2fPoint::Midpoint ( const ON_2fPoint A,
const ON_2fPoint B 
)
static

Returns: (A+B)/2 Remarks: Exact when coordinates are equal and prevents overflow.

◆ operator const float *()

ON_2fPoint::operator const float * ( ) const

◆ operator float *()

ON_2fPoint::operator float * ( )

(float*) conversion operators

◆ operator!=()

bool ON_2fPoint::operator!= ( const ON_2fPoint ) const

◆ operator*() [1/5]

float ON_2fPoint::operator* ( const ON_2fPoint ) const

for points acting as vectors

◆ operator*() [2/5]

float ON_2fPoint::operator* ( const ON_2fVector ) const

for points acting as vectors

◆ operator*() [3/5]

ON_2dPoint ON_2fPoint::operator* ( double  ) const

◆ operator*() [4/5]

ON_2fPoint ON_2fPoint::operator* ( float  ) const

◆ operator*() [5/5]

ON_2fPoint ON_2fPoint::operator* ( int  ) const

◆ operator*=()

ON_2fPoint& ON_2fPoint::operator*= ( float  )

◆ operator+() [1/8]

ON_2dPoint ON_2fPoint::operator+ ( const ON_2dPoint ) const

◆ operator+() [2/8]

ON_2dPoint ON_2fPoint::operator+ ( const ON_2dVector ) const

◆ operator+() [3/8]

ON_2fPoint ON_2fPoint::operator+ ( const ON_2fPoint ) const

◆ operator+() [4/8]

ON_2fPoint ON_2fPoint::operator+ ( const ON_2fVector ) const

◆ operator+() [5/8]

ON_3dPoint ON_2fPoint::operator+ ( const ON_3dPoint ) const

◆ operator+() [6/8]

ON_3dPoint ON_2fPoint::operator+ ( const ON_3dVector ) const

◆ operator+() [7/8]

ON_3fPoint ON_2fPoint::operator+ ( const ON_3fPoint ) const

◆ operator+() [8/8]

ON_3fPoint ON_2fPoint::operator+ ( const ON_3fVector ) const

◆ operator+=()

ON_2fPoint& ON_2fPoint::operator+= ( const ON_2fVector )

◆ operator-() [1/8]

ON_2dVector ON_2fPoint::operator- ( const ON_2dPoint ) const

◆ operator-() [2/8]

ON_2dPoint ON_2fPoint::operator- ( const ON_2dVector ) const

◆ operator-() [3/8]

ON_2fVector ON_2fPoint::operator- ( const ON_2fPoint ) const

◆ operator-() [4/8]

ON_2fPoint ON_2fPoint::operator- ( const ON_2fVector ) const

◆ operator-() [5/8]

ON_3dVector ON_2fPoint::operator- ( const ON_3dPoint ) const

◆ operator-() [6/8]

ON_3dPoint ON_2fPoint::operator- ( const ON_3dVector ) const

◆ operator-() [7/8]

ON_3fVector ON_2fPoint::operator- ( const ON_3fPoint ) const

◆ operator-() [8/8]

ON_3fPoint ON_2fPoint::operator- ( const ON_3fVector ) const

◆ operator-=()

ON_2fPoint& ON_2fPoint::operator-= ( const ON_2fVector )

◆ operator/() [1/3]

ON_2dPoint ON_2fPoint::operator/ ( double  ) const

◆ operator/() [2/3]

ON_2fPoint ON_2fPoint::operator/ ( float  ) const

◆ operator/() [3/3]

ON_2fPoint ON_2fPoint::operator/ ( int  ) const

◆ operator/=()

ON_2fPoint& ON_2fPoint::operator/= ( float  )

◆ operator<()

bool ON_2fPoint::operator< ( const ON_2fPoint ) const

◆ operator<=()

bool ON_2fPoint::operator<= ( const ON_2fPoint ) const

dictionary order comparisons

◆ operator=() [1/12]

ON_2fPoint& ON_2fPoint::operator= ( const double *  )

point = double[2] support

◆ operator=() [2/12]

ON_2fPoint& ON_2fPoint::operator= ( const float *  )

point = float[2] support

◆ operator=() [3/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_2dPoint )

◆ operator=() [4/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_2dVector )

◆ operator=() [5/12]

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

◆ operator=() [6/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_2fVector )

◆ operator=() [7/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_3dPoint )

◆ operator=() [8/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_3dVector )

◆ operator=() [9/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_3fPoint )

◆ operator=() [10/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_3fVector )

◆ operator=() [11/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_4dPoint )

◆ operator=() [12/12]

ON_2fPoint& ON_2fPoint::operator= ( const ON_4fPoint )

◆ operator==()

bool ON_2fPoint::operator== ( const ON_2fPoint ) const

◆ operator>()

bool ON_2fPoint::operator> ( const ON_2fPoint ) const

◆ operator>=()

bool ON_2fPoint::operator>= ( const ON_2fPoint ) const

◆ operator[]() [1/4]

float& ON_2fPoint::operator[] ( int  )

index operators mimic float[2] behavior

◆ operator[]() [2/4]

float ON_2fPoint::operator[] ( int  ) const

◆ operator[]() [3/4]

float& ON_2fPoint::operator[] ( unsigned int  )

◆ operator[]() [4/4]

float ON_2fPoint::operator[] ( unsigned int  ) const

◆ Rotate() [1/2]

void ON_2fPoint::Rotate ( double  ,
const ON_2fPoint  
)

◆ Rotate() [2/2]

void ON_2fPoint::Rotate ( double  ,
double  ,
const ON_2fPoint  
)

◆ Set()

void ON_2fPoint::Set ( float  ,
float   
)

set 2d point value

◆ Transform()

void ON_2fPoint::Transform ( const ON_Xform )

These transform the point in place. The transformation matrix acts on the left of the point; i.e., result = transformation*point

◆ Zero()

void ON_2fPoint::Zero ( )

set all coordinates to zero;

Deprecated:
Use p = ON_2fPoint::Origin;

Member Data Documentation

◆ NanPoint

const ON_2fPoint ON_2fPoint::NanPoint
static

(ON_FLT_QNAN,ON_FLT_QNAN)

◆ Origin

const ON_2fPoint ON_2fPoint::Origin
static

(0.0f,0.0f)

◆ x

float ON_2fPoint::x

◆ y

float ON_2fPoint::y