Mitsuba Renderer  0.5.0
mitsuba::TPoint3< T > Struct Template Reference

Parameterizable three-dimensional point data structure. More...

#include <mitsuba/mitsuba.h>

## Public Types

typedef T Scalar

typedef TVector3< T > VectorType

## Public Member Functions

TPoint3 ()
Construct a new point without initializing it. More...

TPoint3 (T x, T y, T z)
Initialize the point with the specified X, Y and Z components. More...

template<typename T2 >
TPoint3 (const TPoint3< T2 > &p)
Initialize the point with the components of another point. More...

template<typename T2 >
TPoint3 (const TVector3< T2 > &v)
Initialize the point with the components of a vector data structure. More...

TPoint3 (T val)
Initialize all components of the the point with the specified value. More...

TPoint3 (Stream *stream)
Unserialize a point from a binary data stream. More...

TPoint3 operator+ (const TVector3< T > &v) const
Add a vector to a point and return the result. More...

TPoint3 operator+ (const TPoint3 &p) const
Add two points and return the result (e.g. to compute a weighted position) More...

TPoint3operator+= (const TVector3< T > &v)
Add a vector to this one (e.g. to compute a weighted position) More...

TPoint3operator+= (const TPoint3 &p)
Add a point to this one (e.g. to compute a weighted position) More...

TPoint3 operator- (const TVector3< T > &v) const
Subtract a vector from this point. More...

TVector3< T > operator- (const TPoint3 &p) const
Subtract two points from each other and return the difference as a vector. More...

TPoint3operator-= (const TVector3< T > &v)
Subtract a vector from this point. More...

TPoint3 operator* (T f) const
Scale the point's coordinates by the given scalar and return the result. More...

TPoint3operator*= (T f)
Scale the point's coordinates by the given scalar. More...

TPoint3 operator- () const
Return a version of the point, which has been flipped along the origin. More...

TPoint3 operator/ (T f) const
Divide the point's coordinates by the given scalar and return the result. More...

TPoint3operator/= (T f)
Divide the point's coordinates by the given scalar. More...

T & operator[] (int i)
Index into the point's components. More...

operator[] (int i) const
Index into the point's components (const version) More...

bool isZero () const
Return whether or not this point is identically zero. More...

bool operator== (const TPoint3 &v) const
Equality test. More...

bool operator!= (const TPoint3 &v) const
Inequality test. More...

void serialize (Stream *stream) const
Serialize this point to a binary data stream. More...

std::string toString () const
Return a readable string representation of this point. More...

x

y

z

## Static Public Attributes

static const int dim = 3
Number of dimensions. More...

## Detailed Description

### template<typename T> struct mitsuba::TPoint3< T >

Parameterizable three-dimensional point data structure.

## Member Typedef Documentation

template<typename T>
 typedef T mitsuba::TPoint3< T >::Scalar
template<typename T>
 typedef TVector3 mitsuba::TPoint3< T >::VectorType

## Constructor & Destructor Documentation

template<typename T>
 mitsuba::TPoint3< T >::TPoint3 ( )
inline

Construct a new point without initializing it.

This construtor is useful when the point will either not be used at all (it might be part of a larger data structure) or initialized at a later point in time. Always make sure that one of the two is the case! Otherwise your program will do computations involving uninitialized memory, which will probably lead to a difficult-to-find bug.

template<typename T>
 mitsuba::TPoint3< T >::TPoint3 ( T x, T y, T z )
inline

Initialize the point with the specified X, Y and Z components.

template<typename T>
template<typename T2 >
 mitsuba::TPoint3< T >::TPoint3 ( const TPoint3< T2 > & p )
inlineexplicit

Initialize the point with the components of another point.

template<typename T>
template<typename T2 >
 mitsuba::TPoint3< T >::TPoint3 ( const TVector3< T2 > & v )
inlineexplicit

Initialize the point with the components of a vector data structure.

template<typename T>
 mitsuba::TPoint3< T >::TPoint3 ( T val )
inlineexplicit

Initialize all components of the the point with the specified value.

template<typename T>
 mitsuba::TPoint3< T >::TPoint3 ( Stream * stream )
inlineexplicit

Unserialize a point from a binary data stream.

## Member Function Documentation

template<typename T>
 bool mitsuba::TPoint3< T >::isZero ( ) const
inline

Return whether or not this point is identically zero.

template<typename T>
 bool mitsuba::TPoint3< T >::operator!= ( const TPoint3< T > & v ) const
inline

Inequality test.

template<typename T>
 TPoint3 mitsuba::TPoint3< T >::operator* ( T f ) const
inline

Scale the point's coordinates by the given scalar and return the result.

template<typename T>
 TPoint3& mitsuba::TPoint3< T >::operator*= ( T f )
inline

Scale the point's coordinates by the given scalar.

template<typename T>
 TPoint3 mitsuba::TPoint3< T >::operator+ ( const TVector3< T > & v ) const
inline

Add a vector to a point and return the result.

template<typename T>
 TPoint3 mitsuba::TPoint3< T >::operator+ ( const TPoint3< T > & p ) const
inline

Add two points and return the result (e.g. to compute a weighted position)

template<typename T>
 TPoint3& mitsuba::TPoint3< T >::operator+= ( const TVector3< T > & v )
inline

Add a vector to this one (e.g. to compute a weighted position)

template<typename T>
 TPoint3& mitsuba::TPoint3< T >::operator+= ( const TPoint3< T > & p )
inline

Add a point to this one (e.g. to compute a weighted position)

template<typename T>
 TPoint3 mitsuba::TPoint3< T >::operator- ( const TVector3< T > & v ) const
inline

Subtract a vector from this point.

template<typename T>
 TVector3 mitsuba::TPoint3< T >::operator- ( const TPoint3< T > & p ) const
inline

Subtract two points from each other and return the difference as a vector.

template<typename T>
 TPoint3 mitsuba::TPoint3< T >::operator- ( ) const
inline

Return a version of the point, which has been flipped along the origin.

template<typename T>
 TPoint3& mitsuba::TPoint3< T >::operator-= ( const TVector3< T > & v )
inline

Subtract a vector from this point.

template<typename T>
 TPoint3 mitsuba::TPoint3< T >::operator/ ( T f ) const
inline

Divide the point's coordinates by the given scalar and return the result.

template<typename T>
 TPoint3& mitsuba::TPoint3< T >::operator/= ( T f )
inline

Divide the point's coordinates by the given scalar.

template<typename T>
 bool mitsuba::TPoint3< T >::operator== ( const TPoint3< T > & v ) const
inline

Equality test.

template<typename T>
 T& mitsuba::TPoint3< T >::operator[] ( int i )
inline

Index into the point's components.

template<typename T>
 T mitsuba::TPoint3< T >::operator[] ( int i ) const
inline

Index into the point's components (const version)

template<typename T>
 void mitsuba::TPoint3< T >::serialize ( Stream * stream ) const
inline

Serialize this point to a binary data stream.

template<typename T>
 std::string mitsuba::TPoint3< T >::toString ( ) const
inline

Return a readable string representation of this point.

## Member Data Documentation

template<typename T>
 const int mitsuba::TPoint3< T >::dim = 3
static

Number of dimensions.

template<typename T>
 T mitsuba::TPoint3< T >::x
template<typename T>
 T mitsuba::TPoint3< T >::y
template<typename T>
 T mitsuba::TPoint3< T >::z

The documentation for this struct was generated from the following file: