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

#include <opennurbs_fpoint.h>

Inheritance diagram for ON_4fPoint:
CColorVec

Public Member Functions

 ON_4fPoint ()=default
 x,y,z,w not initialized More...
 
 ON_4fPoint (const double *)
 from double[4] array More...
 
 ON_4fPoint (const float *)
 Require explicit construction when dev must insure array has length >= 4. More...
 
 ON_4fPoint (const ON_2dPoint &)
 Require explicit construction when losing precision. More...
 
 ON_4fPoint (const ON_2dVector &)
 from 2d vector More...
 
 ON_4fPoint (const ON_2fPoint &)
 from 2f point More...
 
 ON_4fPoint (const ON_2fVector &)
 from 2f vector More...
 
 ON_4fPoint (const ON_3dPoint &)
 from 3d point More...
 
 ON_4fPoint (const ON_3dVector &)
 from 3d vector More...
 
 ON_4fPoint (const ON_3fPoint &)
 from 3f point More...
 
 ON_4fPoint (const ON_3fVector &)
 from 3f vector More...
 
 ON_4fPoint (const ON_4dPoint &)
 from 4d point More...
 
 ON_4fPoint (const ON_4fPoint &)=default
 
 ON_4fPoint (float x, float y, float z, float w)
 
 ~ON_4fPoint ()=default
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
float EuclideanX () const
 
float EuclideanY () const
 
float EuclideanZ () const
 
bool IsUnset () const
 
bool IsValid () const
 
double MaximumCoordinate () const
 absolute value of maximum coordinate More...
 
int MaximumCoordinateIndex () const
 
bool Normalize ()
 set so x^2 + y^2 + z^2 + w^2 = 1 More...
 
 operator const float * () const
 
 operator float * ()
 (float*) conversion operators More...
 
bool operator!= (const ON_4fPoint &rhs) const
 
ON_4fPoint operator* (float) const
 
ON_4fPointoperator*= (float)
 
ON_4fPoint operator+ (const ON_4fPoint &) const
 sum w = sqrt(w1*w2) More...
 
ON_4fPointoperator+= (const ON_4fPoint &)
 
ON_4fPoint operator- (const ON_4fPoint &) const
 difference w = sqrt(w1*w2) More...
 
ON_4fPointoperator-= (const ON_4fPoint &)
 
ON_4fPoint operator/ (float) const
 
ON_4fPointoperator/= (float)
 
ON_4fPointoperator= (const double *)
 point = double[4] support More...
 
ON_4fPointoperator= (const float *)
 point = float[4] support More...
 
ON_4fPointoperator= (const ON_2dPoint &)
 
ON_4fPointoperator= (const ON_2dVector &)
 
ON_4fPointoperator= (const ON_2fPoint &)
 use implicit operator=(const ON_4fPoint&) More...
 
ON_4fPointoperator= (const ON_2fVector &)
 
ON_4fPointoperator= (const ON_3dPoint &)
 
ON_4fPointoperator= (const ON_3dVector &)
 
ON_4fPointoperator= (const ON_3fPoint &)
 
ON_4fPointoperator= (const ON_3fVector &)
 
ON_4fPointoperator= (const ON_4dPoint &)
 
ON_4fPointoperator= (const ON_4fPoint &)=default
 
bool operator== (const ON_4fPoint &rhs) const
 
float & operator[] (int)
 index operators mimic float[4] behavior More...
 
float operator[] (int) const
 
float & operator[] (unsigned int)
 
float operator[] (unsigned int) const
 
void Set (float, float, float, float)
 set 4d point value More...
 
void Transform (const ON_Xform &)
 

Static Public Member Functions

static int DictionaryCompare (const ON_4fPoint &lhs, const ON_4fPoint &rhs)
 
static int ProjectiveCompare (const ON_4fPoint &lhs, const ON_4fPoint &rhs)
 

Public Attributes

float w
 
float x
 
float y
 
float z
 

Static Public Attributes

static const ON_4fPoint Nan
 (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN) More...
 
static const ON_4fPoint Zero
 (0,0,0,0) More...
 

Detailed Description

ON_4fPoint (homogeneous coordinates)

Constructor & Destructor Documentation

◆ ON_4fPoint() [1/14]

ON_4fPoint::ON_4fPoint ( )
default

x,y,z,w not initialized

◆ ~ON_4fPoint()

ON_4fPoint::~ON_4fPoint ( )
default

◆ ON_4fPoint() [2/14]

ON_4fPoint::ON_4fPoint ( const ON_4fPoint )
default

◆ ON_4fPoint() [3/14]

ON_4fPoint::ON_4fPoint ( float  x,
float  y,
float  z,
float  w 
)
explicit

◆ ON_4fPoint() [4/14]

ON_4fPoint::ON_4fPoint ( const ON_2fPoint )

from 2f point

◆ ON_4fPoint() [5/14]

ON_4fPoint::ON_4fPoint ( const ON_3fPoint )

from 3f point

◆ ON_4fPoint() [6/14]

ON_4fPoint::ON_4fPoint ( const ON_2fVector )

from 2f vector

◆ ON_4fPoint() [7/14]

ON_4fPoint::ON_4fPoint ( const ON_3fVector )

from 3f vector

◆ ON_4fPoint() [8/14]

ON_4fPoint::ON_4fPoint ( const float *  )
explicit

Require explicit construction when dev must insure array has length >= 4.

from float[4] array

◆ ON_4fPoint() [9/14]

ON_4fPoint::ON_4fPoint ( const ON_2dPoint )
explicit

Require explicit construction when losing precision.

from 2d point

◆ ON_4fPoint() [10/14]

ON_4fPoint::ON_4fPoint ( const ON_3dPoint )
explicit

from 3d point

◆ ON_4fPoint() [11/14]

ON_4fPoint::ON_4fPoint ( const ON_4dPoint )
explicit

from 4d point

◆ ON_4fPoint() [12/14]

ON_4fPoint::ON_4fPoint ( const ON_2dVector )
explicit

from 2d vector

◆ ON_4fPoint() [13/14]

ON_4fPoint::ON_4fPoint ( const ON_3dVector )
explicit

from 3d vector

◆ ON_4fPoint() [14/14]

ON_4fPoint::ON_4fPoint ( const double *  )
explicit

from double[4] array

Member Function Documentation

◆ DataCRC()

ON__UINT32 ON_4fPoint::DataCRC ( ON__UINT32  current_remainder) const

◆ DictionaryCompare()

static int ON_4fPoint::DictionaryCompare ( const ON_4fPoint lhs,
const ON_4fPoint rhs 
)
static

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

◆ EuclideanX()

float ON_4fPoint::EuclideanX ( ) const

Returns: ON_UNSET_VALUE, if x or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE and neither x nor w is a nan. x/w, otherwise Remarks: If w is 0.0 or nan, the result will be a nan.

◆ EuclideanY()

float ON_4fPoint::EuclideanY ( ) const

Returns: ON_UNSET_VALUE, if y or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE and neither y nor w is a nan. y/w, otherwise Remarks: If w is 0.0 or nan, the result will be a nan.

◆ EuclideanZ()

float ON_4fPoint::EuclideanZ ( ) const

Returns: ON_UNSET_VALUE, if z or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE and neither z nor w is a nan. z/w, otherwise Remarks: If w is 0.0 or nan, the result will be a nan.

◆ IsUnset()

bool ON_4fPoint::IsUnset ( ) const

Returns: True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT

◆ IsValid()

bool ON_4fPoint::IsValid ( ) const

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

◆ MaximumCoordinate()

double ON_4fPoint::MaximumCoordinate ( ) const

absolute value of maximum coordinate

◆ MaximumCoordinateIndex()

int ON_4fPoint::MaximumCoordinateIndex ( ) const

◆ Normalize()

bool ON_4fPoint::Normalize ( )

set so x^2 + y^2 + z^2 + w^2 = 1

◆ operator const float *()

ON_4fPoint::operator const float * ( ) const

◆ operator float *()

ON_4fPoint::operator float * ( )

(float*) conversion operators

◆ operator!=()

bool ON_4fPoint::operator!= ( const ON_4fPoint rhs) const

Returns: True if lhs.* != rhs.* for some coordinate and no values are nans.

◆ operator*()

ON_4fPoint ON_4fPoint::operator* ( float  ) const

◆ operator*=()

ON_4fPoint& ON_4fPoint::operator*= ( float  )

◆ operator+()

ON_4fPoint ON_4fPoint::operator+ ( const ON_4fPoint ) const

sum w = sqrt(w1*w2)

◆ operator+=()

ON_4fPoint& ON_4fPoint::operator+= ( const ON_4fPoint )

◆ operator-()

ON_4fPoint ON_4fPoint::operator- ( const ON_4fPoint ) const

difference w = sqrt(w1*w2)

◆ operator-=()

ON_4fPoint& ON_4fPoint::operator-= ( const ON_4fPoint )

◆ operator/()

ON_4fPoint ON_4fPoint::operator/ ( float  ) const

◆ operator/=()

ON_4fPoint& ON_4fPoint::operator/= ( float  )

◆ operator=() [1/12]

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

point = double[4] support

◆ operator=() [2/12]

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

point = float[4] support

◆ operator=() [3/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_2dPoint )

◆ operator=() [4/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_2dVector )

◆ operator=() [5/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_2fPoint )

◆ operator=() [6/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_2fVector )

◆ operator=() [7/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_3dPoint )

◆ operator=() [8/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_3dVector )

◆ operator=() [9/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_3fPoint )

◆ operator=() [10/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_3fVector )

◆ operator=() [11/12]

ON_4fPoint& ON_4fPoint::operator= ( const ON_4dPoint )

◆ operator=() [12/12]

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

◆ operator==()

bool ON_4fPoint::operator== ( const ON_4fPoint rhs) const

Returns: True if (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w).

◆ operator[]() [1/4]

float& ON_4fPoint::operator[] ( int  )

index operators mimic float[4] behavior

◆ operator[]() [2/4]

float ON_4fPoint::operator[] ( int  ) const

◆ operator[]() [3/4]

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

◆ operator[]() [4/4]

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

◆ ProjectiveCompare()

static int ON_4fPoint::ProjectiveCompare ( const ON_4fPoint lhs,
const ON_4fPoint rhs 
)
static

Description: A well ordered projective compare function that is nan aware and can be used for robust sorting. Remarks: float c = non-nan value. ON_4fPoint h0 = ...; ON_4fPoint h1(c*h0.x,c*h0.x,c*h0.x,c*h0.x); 0 == ON_4fPoint::ProjectiveCompare(h0,ha);

◆ Set()

void ON_4fPoint::Set ( float  ,
float  ,
float  ,
float   
)

set 4d point value

◆ Transform()

void ON_4fPoint::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

Member Data Documentation

◆ Nan

const ON_4fPoint ON_4fPoint::Nan
static

(ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)

◆ w

float ON_4fPoint::w

◆ x

float ON_4fPoint::x

◆ y

float ON_4fPoint::y

◆ z

float ON_4fPoint::z

◆ Zero

const ON_4fPoint ON_4fPoint::Zero
static

(0,0,0,0)