Public Member Functions
sal3d::Point3D Class Reference

Class that represents a point in 3D space or a 3D vector. More...

#include <Common.hpp>

List of all members.

Public Member Functions

 Point3D ()
 Constructor without initialising the coordinates.
 Point3D (const sal3d_point3d &point)
 Constructor.
 Point3D (const Point3D &point)
 Copy Constructor.
 Point3D (float x, float y, float z)
 Constructor by values.
const sal3d_point3d & c_point_3d () const
sal3d_point3d & c_point_3d ()
 Returns a copy of the internal C sal3d_point3d.
const float & x () const
float & x ()
const float & y () const
float & y ()
const float & z () const
float & z ()
float norm () const
 The norm of a vector is its length or size.
void normalize ()
 Normalizes this Point3D vector.
Point3D vector (const Point3D &destination) const
 Calculates the Point3D vector from this Point3D to the destination Point3D.
float dot (const Point3D &rhs) const
 Performs the dot product within this Point3D vector.
Point3D cross (const Point3D &rhs) const
 Performs the cross product within this Point3D vector.
Point3Doperator= (const Point3D &rhs)
 Assigns to this Point3D the values of other Point3D.
Point3D operator* (const float rhs) const
 Performs a scalar product on this Point3D vector.
Point3Doperator*= (const float rhs)
 Performs a scalar product on this Point3D vector and assigns the result to it.
const float & operator[] (int idx) const
 Gets a read-only coordinate of the Point3D.
float & operator[] (int idx)
 Gets a modifiable coordinate of the Point3D.
bool operator== (const Point3D &rhs)
 Checks the equality of this Point3D with another Point3D.

Detailed Description

Class that represents a point in 3D space or a 3D vector.


Constructor & Destructor Documentation

sal3d::Point3D::Point3D ( const sal3d_point3d &  point) [inline, explicit]

Constructor.

Parameters:
[in]pointA C representation of a Point3D
sal3d::Point3D::Point3D ( const Point3D point) [inline]

Copy Constructor.

Parameters:
[in]pointA C++ representation of a Point3D
sal3d::Point3D::Point3D ( float  x,
float  y,
float  z 
) [inline]

Constructor by values.

Parameters:
[in]xx axis coordinate
[in]yy axis coordinate
[in]zz axis coordinate

References x(), y(), and z().


Member Function Documentation

const sal3d_point3d& sal3d::Point3D::c_point_3d ( ) const [inline]
sal3d_point3d& sal3d::Point3D::c_point_3d ( ) [inline]

Returns a copy of the internal C sal3d_point3d.

Returns:
The C sal3d_point3d.
Point3D sal3d::Point3D::cross ( const Point3D rhs) const [inline]

Performs the cross product within this Point3D vector.

Parameters:
[in]rhsThe Point3D to calculate the product with
Returns:
The Point3D vector resulting of the cross product
float sal3d::Point3D::dot ( const Point3D rhs) const [inline]

Performs the dot product within this Point3D vector.

Parameters:
[in]rhsThe Point3D to calculate the product with
Returns:
The result of the dot product
float sal3d::Point3D::norm ( ) const [inline]

The norm of a vector is its length or size.

Returns:
The norm (length/size) of this Point3D vector

Referenced by normalize().

Point3D sal3d::Point3D::operator* ( const float  rhs) const [inline]

Performs a scalar product on this Point3D vector.

Parameters:
[in]rhsThe float to perform the product with
Returns:
The Point3D vector resulting of perform the scalar product on this Point3D vector
Point3D& sal3d::Point3D::operator*= ( const float  rhs) [inline]

Performs a scalar product on this Point3D vector and assigns the result to it.

Parameters:
[in]rhsThe float to perform the product with
Returns:
A reference to this Point3D vector after performing the scalar product
Point3D& sal3d::Point3D::operator= ( const Point3D rhs) [inline]

Assigns to this Point3D the values of other Point3D.

Parameters:
[in]rhsPoint3D to get the values from
Returns:
A reference to this Point3D
bool sal3d::Point3D::operator== ( const Point3D rhs) [inline]

Checks the equality of this Point3D with another Point3D.

Parameters:
[in]rhsThe Point3D to check equality
Returns:
Whether this Point3D is equal to rhs or not

References x(), y(), and z().

const float& sal3d::Point3D::operator[] ( int  idx) const [inline]

Gets a read-only coordinate of the Point3D.

Parameters:
[in]idxThe coordinate to return. The range is 0..2: 0: x, 1: y, 2: z.
Returns:
The coordinate at index idx
float& sal3d::Point3D::operator[] ( int  idx) [inline]

Gets a modifiable coordinate of the Point3D.

Parameters:
[in]idxThe coordinate to return. The range is 0..2: 0: x, 1: y, 2: z.
Returns:
The coordinate at index idx
Point3D sal3d::Point3D::vector ( const Point3D destination) const [inline]

Calculates the Point3D vector from this Point3D to the destination Point3D.

Parameters:
[in]destinationDestination of the Point3D vector to calculate
Returns:
The vector origin(this) -> destination
const float& sal3d::Point3D::x ( ) const [inline]
float& sal3d::Point3D::x ( ) [inline]
Returns:
The modifiable x axis coordinate of the Point3D
const float& sal3d::Point3D::y ( ) const [inline]
float& sal3d::Point3D::y ( ) [inline]
Returns:
The modifiable y axis coordinate of the Point3D
const float& sal3d::Point3D::z ( ) const [inline]
float& sal3d::Point3D::z ( ) [inline]
Returns:
The modifiable z axis coordinate of the Point3D

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