RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
IndexedPolygonNN< T > Class Template Reference

Polygon with N vertices and N normals. More...

#include <IndexedPolygon.hpp>

Inherits IndexedPolygon< uint16_t >.

Public Types

typedef rw::core::Ptr< IndexedPolygonNN< T > > Ptr
 Smart pointer to IndexedPolygonNN.
 
- Public Types inherited from IndexedPolygon< uint16_t >
typedef rw::core::Ptr< IndexedPolygon< uint16_t > > Ptr
 Smart pointer to IndexedPolygonN.
 
typedef uint16_t value_type
 value type of the index pointer
 

Public Member Functions

 IndexedPolygonNN (size_t n)
 Construct IndexPolygonNN with space for n vertices and normals.
 
 IndexedPolygonNN (const std::vector< T > &vertices, const std::vector< T > &normals)
 Constructs IndexedPolygonN-n with the vertices and normals specified. More...
 
virtual ~IndexedPolygonNN ()
 destructor
 
T & getVertexIdx (size_t i)
 returns the index of vertex i of the triangle
 
const T & getVertexIdx (size_t i) const
 returns the index of vertex i of the triangle
 
T & getNormalIdx (size_t i)
 returns the index of vertex i of the triangle
 
const T & getNormalIdx (size_t i) const
 returns the index of vertex i of the triangle
 
void addVertex (const T &p, const T &n)
 Adds a vertex to the polygon. More...
 
void removeVertexIdx (size_t i)
 Removes vertex from the polygon. More...
 
- Public Member Functions inherited from IndexedPolygon< uint16_t >
virtual ~IndexedPolygon ()
 destructor
 
uint16_t & operator[] (size_t i)
 get vertex at index i
 
const uint16_t & operator[] (size_t i) const
 get vertex at index i
 
virtual size_t size () const=0
 Number of vertices of this polygon. More...
 

Detailed Description

template<class T = uint16_t>
class rw::geometry::IndexedPolygonNN< T >

Polygon with N vertices and N normals.

Constructor & Destructor Documentation

◆ IndexedPolygonNN()

IndexedPolygonNN ( const std::vector< T > &  vertices,
const std::vector< T > &  normals 
)
inline

Constructs IndexedPolygonN-n with the vertices and normals specified.

In case the number of vertices and normals does not match the method either asserts or throws an exception.

Parameters
vertices[in] The vertices to be part of the polygon
normals[in] The normals associated to the vertices

Member Function Documentation

◆ addVertex()

void addVertex ( const T &  p,
const T &  n 
)
inline

Adds a vertex to the polygon.

The point will be added to the end of the list of points

Parameters
p[in] The point to add
n[in] Normal associated to the point

◆ removeVertexIdx()

void removeVertexIdx ( size_t  i)
inline

Removes vertex from the polygon.

Parameters
i[in] Index of the point to remove

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