Back to index

nux  3.0.0
Public Member Functions | Private Attributes
nux::Line3D< T > Class Template Reference

#include <Line3D.h>

Collaboration diagram for nux::Line3D< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Line3D ()
 ~Line3D ()
 Line3D (const Line3D &line)
 Line3D (T lx_start, T ly_start, T lz_start, T lx_end, T ly_end, T lz_end)
 Line3D (const Vector3 &pt, Vector3 v)
const Line3D< T > & operator= (const Line3D< T > &)
bool operator== (const Line3D< T > &line) const
float Length () const
const Vec3< T > GetDirectionVector () const
const Vec3< T > GetStartPoint () const
const Vec3< T > GetEndPoint () const

Private Attributes

x_start
y_start
z_start
x_end
y_end
z_end

Detailed Description

template<typename T>
class nux::Line3D< T >

Definition at line 32 of file Line3D.h.


Constructor & Destructor Documentation

template<typename T >
nux::Line3D< T >::Line3D ( )

Definition at line 57 of file Line3D.h.

  {
    x_start = y_start = z_start = x_end = y_end = z_end = 0;
  }
template<typename T >
nux::Line3D< T >::~Line3D ( )

Definition at line 63 of file Line3D.h.

  {

  }
template<typename T >
nux::Line3D< T >::Line3D ( const Line3D< T > &  line)

Definition at line 69 of file Line3D.h.

  {
    x_start = line.x_start;
    x_end   = line.x_end;
    y_start = line.y_start;
    y_end   = line.y_end;
    z_start = line.z_start;
    z_end   = line.z_end;
  }
template<typename T >
nux::Line3D< T >::Line3D ( lx_start,
ly_start,
lz_start,
lx_end,
ly_end,
lz_end 
)

Definition at line 80 of file Line3D.h.

  {
    x_start = lx_start;
    x_end   = lx_end;
    y_start = ly_start;
    y_end   = ly_end;
    z_start = lz_start;
    z_end   = lz_end;
  }
template<typename T >
nux::Line3D< T >::Line3D ( const Vector3 pt,
Vector3  v 
)

Definition at line 92 of file Line3D.h.

  {
    x_start = pt.x;
    y_start = pt.y;
    z_start = pt.z;

    x_end   = x_start + v.x;
    y_end   = y_start + v.y;
    z_end   = y_start + v.z;
  }

Member Function Documentation

template<typename T >
const Vec3< T > nux::Line3D< T >::GetDirectionVector ( ) const

Definition at line 145 of file Line3D.h.

  {
    return Vec3<T> (x_start - x_end, y_start - y_end, z_start - z_end);
  }
template<typename T >
const Vec3< T > nux::Line3D< T >::GetEndPoint ( ) const

Definition at line 158 of file Line3D.h.

  {
    Vec3<T> p (x_end, y_end, z_end);
    return p;
  }
template<typename T >
const Vec3< T > nux::Line3D< T >::GetStartPoint ( ) const

Definition at line 151 of file Line3D.h.

  {
    Vec3<T> p (x_start, y_start, z_start);
    return p;
  }
template<typename T >
float nux::Line3D< T >::Length ( ) const

Definition at line 134 of file Line3D.h.

  {
    float l;
    l = (float) std::sqrt ( (x_end - x_start) * (x_end - x_start) +
                            (y_end - y_start) * (y_end - y_start) +
                            (z_end - z_start) * (z_end - z_start) );

    return l;
  }
template<typename T >
const Line3D< T > & nux::Line3D< T >::operator= ( const Line3D< T > &  Line)

Definition at line 104 of file Line3D.h.

  {
    x_start = Line.x_start;
    y_start = Line.y_start;
    z_start = Line.z_start;
    x_end = Line.x_end;
    y_end = Line.y_end;
    z_end = Line.z_end;

  }
template<typename T >
bool nux::Line3D< T >::operator== ( const Line3D< T > &  line) const

Definition at line 116 of file Line3D.h.

  {
    if ( (x_start  == line.x_start) &&
         (y_start == line.y_start) &&
         (z_start == line.z_start) &&
         (x_end   == line.x_end)   &&
         (y_end   == line.y_end)   &&
         (z_end   == line.z_end) )
    {
      return true;
    }
    else
    {
      return false;
    }
  }

Member Data Documentation

template<typename T>
T nux::Line3D< T >::x_end [private]

Definition at line 52 of file Line3D.h.

template<typename T>
T nux::Line3D< T >::x_start [private]

Definition at line 51 of file Line3D.h.

template<typename T>
T nux::Line3D< T >::y_end [private]

Definition at line 52 of file Line3D.h.

template<typename T>
T nux::Line3D< T >::y_start [private]

Definition at line 51 of file Line3D.h.

template<typename T>
T nux::Line3D< T >::z_end [private]

Definition at line 52 of file Line3D.h.

template<typename T>
T nux::Line3D< T >::z_start [private]

Definition at line 51 of file Line3D.h.


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