Loading...
Searching...
No Matches
BALL::TSurface< T > Class Template Reference

`#include <BALL/MATHS/surface.h>`

## Classes

class | Triangle

## Public Types

Type definitions
typedef TVector3< T > | Vertex
| A vertex.
typedef TVector3< T > | Normal
| A normal.

## Public Member Functions

Constructors and Destructors
| TSurface ()
| TSurface (const TSurface &surface)
virtual | ~TSurface ()
Assignment
void | set (const TSurface &surface)
TSurface & | operator= (const TSurface &surface)
void | get (TSurface &surface) const
void | clear ()
void | readMSMSFile (const String &vert_filename, const String &face_filename)
Accessors
float | getArea () const
Size | getNumberOfTriangles () const
| Return the number of triangles.
Size | getNumberOfVertices () const
| Return the number of vertices.
Size | getNumberOfNormals () const
| Return the number of normals.
Triangle & | getTriangle (Position index)
| Return a triangle with a given index.
const Triangle & | getTriangle (Position index) const
| Return a triangle with a given index.
void | clearTriangles ()
| Clear all triangles.
void | resizeTriangles (Size size)
| Resize the triangle array.
void | pushBackTriangle (const Triangle &triangle)
| Add a triangle.
Vertex & | getVertex (Position index)
| Return the position of a vertex.
const Vertex & | getVertex (Position index) const
| Return the position of a vertex.
void | clearVertices ()
| Clear all vertices.
void | resizeVertices (Size size)
| Resize the vertex array.
void | pushBackVertex (const Vertex &vertex)
| Add a vertex.
Normal & | getNormal (Position index)
| Return the position of a normal.
const Normal & | getNormal (Position index) const
| Return the position of a normal.
void | clearNormals ()
| Clear all normals.
void | resizeNormals (Size size)
| Resize the normal array.
void | pushBackNormal (const Normal &n)
| Add a normal.
Predicates
bool | operator== (const TSurface &surface) const
bool | operator!= (const TSurface &surface) const

## Public Attributes

Attributes
vector< Vertex > | vertex
| the vertices
vector< Normal > | normal
| the normals for each vertex
vector< Triangle > | triangle
| the triangles

## Detailed Description

template<typename T>
class BALL::TSurface< T >

Generic Three-dimensional Surface class. This class describes a three-dimensional triangulated surface. Each triangle is represented by three indices to vertices (as described by the TSurface::Triangle ). Each of the vertices has a position and possibly a normal vector associated.

Definition at line 27 of file surface.h.

## Member Typedef Documentation

## Normal

template<typename T>

typedef TVector3<T> BALL::TSurface< T >::Normal

A normal.

Definition at line 62 of file surface.h.

## Vertex

template<typename T>

typedef TVector3<T> BALL::TSurface< T >::Vertex

A vertex.

Definition at line 59 of file surface.h.

## Constructor & Destructor Documentation

## TSurface() [1/2]

template<typename T>

BALL::TSurface< T >::TSurface | ( |  | ) |

This is required for windows dlls

Definition at line 202 of file surface.h.

## TSurface() [2/2]

template<typename T>

BALL::TSurface< T >::TSurface | ( | const TSurface< T > & | surface | ) |

Definition at line 207 of file surface.h.

## ~TSurface()

template<typename T>

BALL::TSurface< T >::~TSurface | ( |  | ) |

virtual

Definition at line 215 of file surface.h.

## Member Function Documentation

## clear()

template<typename T>

void BALL::TSurface< T >::clear | ( |  | ) |

Definition at line 220 of file surface.h.

## clearNormals()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::clearNormals | ( |  | ) |

Clear all normals.

Definition at line 460 of file surface.h.

## clearTriangles()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::clearTriangles | ( |  | ) |

Clear all triangles.

Definition at line 388 of file surface.h.

## clearVertices()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::clearVertices | ( |  | ) |

Clear all vertices.

Definition at line 424 of file surface.h.

## get()

template<typename T>

void BALL::TSurface< T >::get | ( | TSurface< T > & | surface | ) | const

Definition at line 245 of file surface.h.

## getArea()

template<typename T>

float BALL::TSurface< T >::getArea | ( |  | ) | const

Compute the surface area. The area is computed as the sum of the areas of all triangles.

Definition at line 328 of file surface.h.

## getNormal() [1/2]

template<typename T>

BALL_INLINE TSurface< T >::Normal & BALL::TSurface< T >::getNormal | ( | Position | index | ) |

Return the position of a normal.

Definition at line 446 of file surface.h.

## getNormal() [2/2]

template<typename T>

BALL_INLINE const TSurface< T >::Normal & BALL::TSurface< T >::getNormal | ( | Position | index | ) | const

Return the position of a normal.

Definition at line 453 of file surface.h.

## getNumberOfNormals()

template<typename T>

BALL_INLINE Size BALL::TSurface< T >::getNumberOfNormals | ( |  | ) | const

Return the number of normals.

Definition at line 367 of file surface.h.

## getNumberOfTriangles()

template<typename T>

BALL_INLINE Size BALL::TSurface< T >::getNumberOfTriangles | ( |  | ) | const

Return the number of triangles.

Definition at line 353 of file surface.h.

## getNumberOfVertices()

template<typename T>

BALL_INLINE Size BALL::TSurface< T >::getNumberOfVertices | ( |  | ) | const

Return the number of vertices.

Definition at line 360 of file surface.h.

## getTriangle() [1/2]

template<typename T>

BALL_INLINE TSurface< T >::Triangle & BALL::TSurface< T >::getTriangle | ( | Position | index | ) |

Return a triangle with a given index.

Definition at line 374 of file surface.h.

## getTriangle() [2/2]

template<typename T>

BALL_INLINE const TSurface< T >::Triangle & BALL::TSurface< T >::getTriangle | ( | Position | index | ) | const

Return a triangle with a given index.

Definition at line 381 of file surface.h.

## getVertex() [1/2]

template<typename T>

BALL_INLINE TSurface< T >::Vertex & BALL::TSurface< T >::getVertex | ( | Position | index | ) |

Return the position of a vertex.

Definition at line 410 of file surface.h.

## getVertex() [2/2]

template<typename T>

BALL_INLINE const TSurface< T >::Vertex & BALL::TSurface< T >::getVertex | ( | Position | index | ) | const

Return the position of a vertex.

Definition at line 417 of file surface.h.

## operator!=()

template<typename T>

bool BALL::TSurface< T >::operator!= | ( | const TSurface< T > & | surface | ) | const

Definition at line 480 of file surface.h.

## operator=()

template<typename T>

TSurface< T > & BALL::TSurface< T >::operator= | ( | const TSurface< T > & | surface | ) |

Definition at line 236 of file surface.h.

## operator==()

template<typename T>

bool BALL::TSurface< T >::operator== | ( | const TSurface< T > & | surface | ) | const

Definition at line 344 of file surface.h.

## pushBackNormal()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::pushBackNormal | ( | const Normal & | n | ) |

Add a normal.

Definition at line 474 of file surface.h.

## pushBackTriangle()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::pushBackTriangle | ( | const Triangle & | triangle | ) |

Add a triangle.

Definition at line 402 of file surface.h.

## pushBackVertex()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::pushBackVertex | ( | const Vertex & | vertex | ) |

Add a vertex.

Definition at line 439 of file surface.h.

## readMSMSFile()

template<typename T>

void BALL::TSurface< T >::readMSMSFile | ( | const String & | vert_filename,
|  | const String & | face_filename )

Read from MSMS file. Read the contents of the vertex and faces file created by Michael Sanners software MSMS.

Exceptions

  Exception::FileNotFound | if the file could not be opened

Definition at line 253 of file surface.h.

## resizeNormals()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::resizeNormals | ( | Size | size | ) |

Resize the normal array.

Definition at line 467 of file surface.h.

## resizeTriangles()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::resizeTriangles | ( | Size | size | ) |

Resize the triangle array.

Definition at line 395 of file surface.h.

## resizeVertices()

template<typename T>

BALL_INLINE void BALL::TSurface< T >::resizeVertices | ( | Size | size | ) |

Resize the vertex array.

Definition at line 431 of file surface.h.

## set()

template<typename T>

void BALL::TSurface< T >::set | ( | const TSurface< T > & | surface | ) |

Definition at line 228 of file surface.h.

## Member Data Documentation

## normal

template<typename T>

vector<Normal> BALL::TSurface< T >::normal

the normals for each vertex

Definition at line 188 of file surface.h.

## triangle

template<typename T>

vector<Triangle> BALL::TSurface< T >::triangle

the triangles

Definition at line 191 of file surface.h.

## vertex

template<typename T>

vector<Vertex> BALL::TSurface< T >::vertex

the vertices

Definition at line 185 of file surface.h.