Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::Vector4 Class Reference

#include <Vector4.h>

Public Member Functions

float & operator[] (int i)
 
const float & operator[] (int i) const
 
const float * array () const
 
 Vector4 ()
 
 Vector4 (const float v[4])
 
 Vector4 (const double v[4])
 
 Vector4 (float a, float b, float c=0, float d=1)
 
void set (float a, float b, float c=0, float d=1)
 
 Vector4 (const Vector3 &v, float d=1)
 
void set (const Vector3 &v, float d=1)
 
Vector3 divide_w () const
 
Vector3 truncate_w () const
 
Vector4 operator* (float d) const
 
Vector4operator*= (float d)
 
Vector4 operator/ (float d) const
 
Vector4operator/= (float d)
 
Vector4 operator* (const Vector4 &v) const
 
Vector4operator*= (const Vector4 &v)
 
Vector4 operator/ (const Vector4 &v) const
 
Vector4operator/= (const Vector4 &v)
 
Vector4 operator+ (const Vector4 &v) const
 
Vector4operator+= (const Vector4 &v)
 
Vector4 operator- () const
 
Vector4 operator- (const Vector4 &v) const
 
Vector4operator-= (const Vector4 &v)
 
bool operator== (const Vector4 &v) const
 
bool operator!= (const Vector4 &v) const
 
bool operator== (float d) const
 
bool operator!= (float d) const
 
bool operator< (const Vector4 &v) const
 Fairly arbitrary operator so you can store these in ordered arrays.
 
void append (Hash &) const
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Friends

std::ostream & operator<< (std::ostream &o, const Vector4 &)
 

Detailed Description

4-component vector. This is used to represent a point in 3D homogenous (perspective) space, and is also useful to represent an rgb color with alpha.

This object is NOT compatible with the SbVec4 template in the Inventor library. Several of the operators ignore the w and treat this as a Vector3. This was done as it made use of this in the 3D system much easier.

Constructor & Destructor Documentation

◆ Vector4() [1/5]

DD::Image::Vector4::Vector4 ( )
inline

Default Constructor.

◆ Vector4() [2/5]

DD::Image::Vector4::Vector4 ( const float  v[4])
inline

Constructor from an array of numbers.

◆ Vector4() [3/5]

DD::Image::Vector4::Vector4 ( const double  v[4])
inline

Constructor from an array of numbers.

◆ Vector4() [4/5]

DD::Image::Vector4::Vector4 ( float  a,
float  b,
float  c = 0,
float  d = 1 
)
inline

Constructor that sets all 4 numbers

◆ Vector4() [5/5]

DD::Image::Vector4::Vector4 ( const Vector3 v,
float  d = 1 
)
inline

Conversion from a Vector3

Member Function Documentation

◆ operator[]() [1/2]

float & DD::Image::Vector4::operator[] ( int  i)
inline

vector[0] is x, vector[1] is y, vector[2] is z, vector[3] is w.

◆ operator[]() [2/2]

const float & DD::Image::Vector4::operator[] ( int  i) const
inline

vector[0] is x, vector[1] is y, vector[2] is z, vector[3] is w.

◆ array()

const float * DD::Image::Vector4::array ( ) const
inline

◆ set() [1/2]

void DD::Image::Vector4::set ( float  a,
float  b,
float  c = 0,
float  d = 1 
)
inline

◆ set() [2/2]

void DD::Image::Vector4::set ( const Vector3 v,
float  d = 1 
)
inline

Conversion from a Vector3

◆ divide_w()

Vector3 DD::Image::Vector4::divide_w ( ) const
inline

Divides xyz by w and returns that

Referenced by DD::Image::CameraOp::draw_handle().

◆ truncate_w()

Vector3 DD::Image::Vector4::truncate_w ( ) const
inline

Just ignores the w. This is correct for a distance where w==0.

◆ operator*() [1/2]

Vector4 DD::Image::Vector4::operator* ( float  d) const
inline

Multiplies all 4 numbers. This will multiply a distance. However if w is non-zero, the resulting 3D point will not move, because x/w will not change.

◆ operator/() [1/2]

Vector4 DD::Image::Vector4::operator/ ( float  d) const
inline

Divides all 4 numbers.

◆ operator*() [2/2]

Vector4 DD::Image::Vector4::operator* ( const Vector4 v) const
inline

Component-wise multiplication, useful for colors.

◆ operator/() [2/2]

Vector4 DD::Image::Vector4::operator/ ( const Vector4 v) const
inline

Component-wise division, useful for colors.

◆ operator+()

Vector4 DD::Image::Vector4::operator+ ( const Vector4 v) const
inline

Component-wise addition.

◆ operator-()

Vector4 DD::Image::Vector4::operator- ( ) const
inline

Component-wise subtraction.

◆ append()

void Vector4::append ( Hash hash) const

Add this to the Hash object.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  o,
const Vector4  
)
friend

Writes it in nuke/tcl notation, with nested curly braces



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com