RobWorkProject
Public Types | Public Member Functions | Friends | List of all members
Triangle< T > Class Template Reference

plain triangle class. The second template argument specify the number of normals associated with the triangle. The triangle vertices should be arranged counter clock wise. More...

#include <Triangle.hpp>

Public Types

typedef T value_type
 value type of vertices
 

Public Member Functions

 Triangle (const rw::math::Vector3D< T > &p1, const rw::math::Vector3D< T > &p2, const rw::math::Vector3D< T > &p3)
 constructor More...
 
 Triangle (const Triangle< T > &f)
 copy constructor More...
 
virtual ~Triangle ()
 destructor
 
rw::math::Vector3D< T > & getVertex (size_t i)
 get vertex at index i
 
const rw::math::Vector3D< T > & getVertex (size_t i) const
 get vertex at index i
 
const rw::math::Vector3D< T > & operator[] (size_t i) const
 get vertex at index i
 
rw::math::Vector3D< T > & operator[] (size_t i)
 get vertex at index i
 
rw::math::Vector3D< T > calcFaceNormal () const
 calculates the face normal of this triangle. It is assumed that the triangle vertices are arranged counter clock wise.
 
bool isInside (const rw::math::Vector3D< T > &x)
 tests wheather the point x is inside the triangle
 
double calcArea () const
 calculate the area of the triangle More...
 
void applyTransform (const rw::math::Transform3D< T > &t3d)
 apply a transformation to this triangle More...
 
Triangle< T > transform (const rw::math::Transform3D< T > &t3d) const
 Returns Triangle transformed by t3d.
 
const Triangle< T > & getTriangle () const
 
Triangle< T > & getTriangle ()
 

Friends

std::ostream & operator<< (std::ostream &os, const Triangle< T > &t)
 Outputs transform to stream. More...
 

Detailed Description

template<class T = double>
class rw::geometry::Triangle< T >

plain triangle class. The second template argument specify the number of normals associated with the triangle. The triangle vertices should be arranged counter clock wise.

Constructor & Destructor Documentation

◆ Triangle() [1/2]

Triangle ( const rw::math::Vector3D< T > &  p1,
const rw::math::Vector3D< T > &  p2,
const rw::math::Vector3D< T > &  p3 
)
inline

constructor

Parameters
p1[in] vertice 1
p2[in] vertice 2
p3[in] vertice 3

◆ Triangle() [2/2]

Triangle ( const Triangle< T > &  f)
inline

copy constructor

Parameters
f[in] - The face that is to be copied.

Member Function Documentation

◆ applyTransform()

void applyTransform ( const rw::math::Transform3D< T > &  t3d)
inline

apply a transformation to this triangle

Parameters
t3d[in] transform that is to be applied

◆ calcArea()

double calcArea ( ) const
inline

calculate the area of the triangle

Returns
area in m^2

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Triangle< T > &  t 
)
friend

Outputs transform to stream.

Parameters
os[in/out] an output stream
t[in] the transform that is to be sent to the output stream
Returns
os

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