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

#include <opennurbs_point.h>

Public Member Functions

 ON_4dPoint ()=default
 x,y,z,w not initialized More...
 
 ON_4dPoint (const double *)
 from double[4] array More...
 
 ON_4dPoint (const float *)
 from float[4] array More...
 
 ON_4dPoint (const ON_2dPoint &)
 These constructors are not explicit because no information is lost. More...
 
 ON_4dPoint (const ON_2dVector &)
 from 2d vector (x,y,0,0) More...
 
 ON_4dPoint (const ON_2fPoint &)
 These constructors are not explicit because no information is lost. More...
 
 ON_4dPoint (const ON_2fVector &)
 from 2f vector (z,y,0,0) More...
 
 ON_4dPoint (const ON_3dPoint &)
 from 3d point (x,y,z,1) More...
 
 ON_4dPoint (const ON_3dVector &)
 from 3d vector (x,y,z,0) More...
 
 ON_4dPoint (const ON_3fPoint &)
 from 3f point (x,y,z,1) More...
 
 ON_4dPoint (const ON_3fVector &)
 from 3f vector (x,y,z,0) More...
 
 ON_4dPoint (const ON_4dPoint &)=default
 
 ON_4dPoint (const ON_4fPoint &)
 from 4f point More...
 
 ON_4dPoint (double x, double y, double z, double w)
 
 ~ON_4dPoint ()=default
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
double EuclideanX () const
 
double EuclideanY () const
 
double EuclideanZ () const
 
bool IsNan () const
 
bool IsUnset () const
 
bool IsUnsetOrNan () const
 
bool IsValid () const
 
double MaximumCoordinate () const
 absolute value of maximum coordinate More...
 
int MaximumCoordinateIndex () const
 
double MinimumCoordinate () const
 absolute value of minimum coordinate More...
 
int MinimumCoordinateIndex () const
 
bool Normalize ()
 set so x^2 + y^2 + z^2 + w^2 = 1 More...
 
 operator const double * () const
 
 operator double * ()
 (double*) conversion operators More...
 
bool operator!= (const ON_4dPoint &rhs) const
 
ON_4dPoint operator* (const ON_Xform &) const
 
ON_4dPoint operator* (double) const
 
ON_4dPointoperator*= (double)
 
ON_4dPoint operator+ (const ON_4dPoint &) const
 sum w = sqrt(|w1*w2|) More...
 
ON_4dPointoperator+= (const ON_4dPoint &)
 sum w = sqrt(|w1*w2|) More...
 
ON_4dPoint operator- (const ON_4dPoint &) const
 difference w = sqrt(|w1*w2|) More...
 
ON_4dPointoperator-= (const ON_4dPoint &)
 difference w = sqrt(|w1*w2|) More...
 
ON_4dPoint operator/ (double) const
 
ON_4dPointoperator/= (double)
 
ON_4dPointoperator= (const class ON_2fPoint &)
 
ON_4dPointoperator= (const class ON_2fVector &)
 
ON_4dPointoperator= (const class ON_3fPoint &)
 
ON_4dPointoperator= (const class ON_3fVector &)
 
ON_4dPointoperator= (const class ON_4fPoint &)
 
ON_4dPointoperator= (const double *)
 point = double[4] support More...
 
ON_4dPointoperator= (const float *)
 point = float[4] support More...
 
ON_4dPointoperator= (const ON_2dPoint &)
 use implicit operator=(const ON_4dPoint&) More...
 
ON_4dPointoperator= (const ON_2dVector &)
 
ON_4dPointoperator= (const ON_3dPoint &)
 
ON_4dPointoperator= (const ON_3dVector &)
 
ON_4dPointoperator= (const ON_4dPoint &)=default
 
bool operator== (const ON_4dPoint &rhs) const
 
double & operator[] (int)
 index operators mimic double[4] behavior More...
 
double operator[] (int) const
 
double & operator[] (unsigned int)
 
double operator[] (unsigned int) const
 
void Set (double x, double y, double z, double w)
 set 4d point value More...
 
void Transform (const ON_Xform &)
 

Static Public Member Functions

static int DictionaryCompare (const ON_4dPoint &lhs, const ON_4dPoint &rhs)
 
static double InnerProduct (const ON_4dPoint &lhs, const ON_4dPoint &rhs)
 
static int ProjectiveCompare (const ON_4dPoint &lhs, const ON_4dPoint &rhs)
 

Public Attributes

double w
 
double x
 
double y
 
double z
 

Static Public Attributes

static const ON_4dPoint Nan
 (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN) More...
 
static const ON_4dPoint Zero
 (0,0,0,0) More...
 

Detailed Description

ON_4dPoint (homogeneous coordinates)

Constructor & Destructor Documentation

◆ ON_4dPoint() [1/14]

ON_4dPoint::ON_4dPoint ( )
default

x,y,z,w not initialized

◆ ~ON_4dPoint()

ON_4dPoint::~ON_4dPoint ( )
default

◆ ON_4dPoint() [2/14]

ON_4dPoint::ON_4dPoint ( const ON_4dPoint )
default

◆ ON_4dPoint() [3/14]

ON_4dPoint::ON_4dPoint ( double  x,
double  y,
double  z,
double  w 
)
explicit

◆ ON_4dPoint() [4/14]

ON_4dPoint::ON_4dPoint ( const ON_2dPoint )

These constructors are not explicit because no information is lost.

from 2d point (z,y,0,1)

◆ ON_4dPoint() [5/14]

ON_4dPoint::ON_4dPoint ( const ON_3dPoint )

from 3d point (x,y,z,1)

◆ ON_4dPoint() [6/14]

ON_4dPoint::ON_4dPoint ( const ON_2dVector )

from 2d vector (x,y,0,0)

◆ ON_4dPoint() [7/14]

ON_4dPoint::ON_4dPoint ( const ON_3dVector )

from 3d vector (x,y,z,0)

◆ ON_4dPoint() [8/14]

ON_4dPoint::ON_4dPoint ( const double *  )
explicit

from double[4] array

◆ ON_4dPoint() [9/14]

ON_4dPoint::ON_4dPoint ( const ON_2fPoint )

These constructors are not explicit because no information is lost.

from 2f point (z,y,0,1)

◆ ON_4dPoint() [10/14]

ON_4dPoint::ON_4dPoint ( const ON_3fPoint )

from 3f point (x,y,z,1)

◆ ON_4dPoint() [11/14]

ON_4dPoint::ON_4dPoint ( const ON_4fPoint )

from 4f point

◆ ON_4dPoint() [12/14]

ON_4dPoint::ON_4dPoint ( const ON_2fVector )

from 2f vector (z,y,0,0)

◆ ON_4dPoint() [13/14]

ON_4dPoint::ON_4dPoint ( const ON_3fVector )

from 3f vector (x,y,z,0)

◆ ON_4dPoint() [14/14]

ON_4dPoint::ON_4dPoint ( const float *  )
explicit

from float[4] array

Member Function Documentation

◆ DataCRC()

ON__UINT32 ON_4dPoint::DataCRC ( ON__UINT32  current_remainder) const

◆ DictionaryCompare()

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

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

◆ EuclideanX()

double ON_4dPoint::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()

double ON_4dPoint::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()

double ON_4dPoint::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.

◆ InnerProduct()

static double ON_4dPoint::InnerProduct ( const ON_4dPoint lhs,
const ON_4dPoint rhs 
)
static

Description: This function is provided because in rare cases it makes sense. If you are not certain why you want this value, think carefully or work with vectors and points in Euclidean coordinates. Returns: lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z + lhs.w*rhs.w; Remark: It is intentional that there is no operator* override for ON_4dPoint. This intentional omission helps people pause and think before calling ON_4dPoint::InnerProduct().

◆ IsNan()

bool ON_4dPoint::IsNan ( ) const

Returns: True if any coordinate is a nan.

◆ IsUnset()

bool ON_4dPoint::IsUnset ( ) const

Returns: True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE

◆ IsUnsetOrNan()

bool ON_4dPoint::IsUnsetOrNan ( ) const

Returns: True if any coordinate is ON_UNSET_VALUE, ON_UNSET_POSITIVE_VALUE, or a nan

◆ IsValid()

bool ON_4dPoint::IsValid ( ) const

Returns: False if any coordinate is infinite, a nan, or ON_UNSET_VALUE.

◆ MaximumCoordinate()

double ON_4dPoint::MaximumCoordinate ( ) const

absolute value of maximum coordinate

◆ MaximumCoordinateIndex()

int ON_4dPoint::MaximumCoordinateIndex ( ) const

◆ MinimumCoordinate()

double ON_4dPoint::MinimumCoordinate ( ) const

absolute value of minimum coordinate

◆ MinimumCoordinateIndex()

int ON_4dPoint::MinimumCoordinateIndex ( ) const

◆ Normalize()

bool ON_4dPoint::Normalize ( )

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

◆ operator const double *()

ON_4dPoint::operator const double * ( ) const

◆ operator double *()

ON_4dPoint::operator double * ( )

(double*) conversion operators

◆ operator!=()

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

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

◆ operator*() [1/2]

ON_4dPoint ON_4dPoint::operator* ( const ON_Xform ) const

◆ operator*() [2/2]

ON_4dPoint ON_4dPoint::operator* ( double  ) const

◆ operator*=()

ON_4dPoint& ON_4dPoint::operator*= ( double  )

◆ operator+()

ON_4dPoint ON_4dPoint::operator+ ( const ON_4dPoint ) const

sum w = sqrt(|w1*w2|)

◆ operator+=()

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

sum w = sqrt(|w1*w2|)

◆ operator-()

ON_4dPoint ON_4dPoint::operator- ( const ON_4dPoint ) const

difference w = sqrt(|w1*w2|)

◆ operator-=()

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

difference w = sqrt(|w1*w2|)

◆ operator/()

ON_4dPoint ON_4dPoint::operator/ ( double  ) const

◆ operator/=()

ON_4dPoint& ON_4dPoint::operator/= ( double  )

◆ operator=() [1/12]

ON_4dPoint& ON_4dPoint::operator= ( const class ON_2fPoint )

◆ operator=() [2/12]

ON_4dPoint& ON_4dPoint::operator= ( const class ON_2fVector )

◆ operator=() [3/12]

ON_4dPoint& ON_4dPoint::operator= ( const class ON_3fPoint )

◆ operator=() [4/12]

ON_4dPoint& ON_4dPoint::operator= ( const class ON_3fVector )

◆ operator=() [5/12]

ON_4dPoint& ON_4dPoint::operator= ( const class ON_4fPoint )

◆ operator=() [6/12]

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

point = double[4] support

◆ operator=() [7/12]

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

point = float[4] support

◆ operator=() [8/12]

ON_4dPoint& ON_4dPoint::operator= ( const ON_2dPoint )

◆ operator=() [9/12]

ON_4dPoint& ON_4dPoint::operator= ( const ON_2dVector )

◆ operator=() [10/12]

ON_4dPoint& ON_4dPoint::operator= ( const ON_3dPoint )

◆ operator=() [11/12]

ON_4dPoint& ON_4dPoint::operator= ( const ON_3dVector )

◆ operator=() [12/12]

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

◆ operator==()

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

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

◆ operator[]() [1/4]

double& ON_4dPoint::operator[] ( int  )

index operators mimic double[4] behavior

◆ operator[]() [2/4]

double ON_4dPoint::operator[] ( int  ) const

◆ operator[]() [3/4]

double& ON_4dPoint::operator[] ( unsigned int  )

◆ operator[]() [4/4]

double ON_4dPoint::operator[] ( unsigned int  ) const

◆ ProjectiveCompare()

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

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

◆ Set()

void ON_4dPoint::Set ( double  x,
double  y,
double  z,
double  w 
)

set 4d point value

◆ Transform()

void ON_4dPoint::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_4dPoint ON_4dPoint::Nan
static

(ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)

◆ w

double ON_4dPoint::w

◆ x

double ON_4dPoint::x

◆ y

double ON_4dPoint::y

◆ z

double ON_4dPoint::z

◆ Zero

const ON_4dPoint ON_4dPoint::Zero
static

(0,0,0,0)