#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) throw (Exception::FileNotFound) |
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 | |
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.
| typedef TVector3<T> BALL::TSurface< T >::Normal |
A normal.
| typedef TVector3<T> BALL::TSurface< T >::Vertex |
A vertex.
| BALL::TSurface< T >::TSurface | ( | ) | [inline] |
This is required for windows dlls
| BALL::TSurface< T >::TSurface | ( | const TSurface< T > & | surface | ) | [inline] |
| BALL::TSurface< T >::~TSurface | ( | ) | [inline, virtual] |
| void BALL::TSurface< T >::clear | ( | ) | [inline] |
Reimplemented in BALL::TContourSurface< T >, and BALL::VIEW::Mesh.
References BALL::TSurface< T >::normal, BALL::TSurface< T >::triangle, and BALL::TSurface< T >::vertex.
| BALL_INLINE void BALL::TSurface< T >::clearNormals | ( | ) | [inline] |
Clear all normals.
References BALL::TSurface< T >::normal.
| BALL_INLINE void BALL::TSurface< T >::clearTriangles | ( | ) | [inline] |
Clear all triangles.
References BALL::TSurface< T >::triangle.
| BALL_INLINE void BALL::TSurface< T >::clearVertices | ( | ) | [inline] |
Clear all vertices.
References BALL::TSurface< T >::vertex.
| void BALL::TSurface< T >::get | ( | TSurface< T > & | surface | ) | const [inline] |
| float BALL::TSurface< T >::getArea | ( | ) | const [inline] |
Compute the surface area. The area is computed as the sum of the areas of all triangles.
References BALL::TSurface< T >::triangle, and BALL::TSurface< T >::vertex.
| BALL_INLINE const TSurface< T >::Normal & BALL::TSurface< T >::getNormal | ( | Position | index | ) | const [inline] |
Return the position of a normal.
References BALL::TSurface< T >::normal.
| BALL_INLINE TSurface< T >::Normal & BALL::TSurface< T >::getNormal | ( | Position | index | ) | [inline] |
Return the position of a normal.
References BALL::TSurface< T >::normal.
| BALL_INLINE Size BALL::TSurface< T >::getNumberOfNormals | ( | ) | const [inline] |
Return the number of normals.
References BALL::TSurface< T >::normal.
| BALL_INLINE Size BALL::TSurface< T >::getNumberOfTriangles | ( | ) | const [inline] |
Return the number of triangles.
References BALL::TSurface< T >::triangle.
| BALL_INLINE Size BALL::TSurface< T >::getNumberOfVertices | ( | ) | const [inline] |
Return the number of vertices.
References BALL::TSurface< T >::vertex.
| BALL_INLINE const TSurface< T >::Triangle & BALL::TSurface< T >::getTriangle | ( | Position | index | ) | const [inline] |
Return a triangle with a given index.
References BALL::TSurface< T >::triangle.
| BALL_INLINE TSurface< T >::Triangle & BALL::TSurface< T >::getTriangle | ( | Position | index | ) | [inline] |
Return a triangle with a given index.
References BALL::TSurface< T >::triangle.
| BALL_INLINE const TSurface< T >::Vertex & BALL::TSurface< T >::getVertex | ( | Position | index | ) | const [inline] |
Return the position of a vertex.
References BALL::TSurface< T >::vertex.
| BALL_INLINE TSurface< T >::Vertex & BALL::TSurface< T >::getVertex | ( | Position | index | ) | [inline] |
Return the position of a vertex.
References BALL::TSurface< T >::vertex.
| bool BALL::TSurface< T >::operator!= | ( | const TSurface< T > & | surface | ) | const [inline] |
| TSurface< T > & BALL::TSurface< T >::operator= | ( | const TSurface< T > & | surface | ) | [inline] |
| bool BALL::TSurface< T >::operator== | ( | const TSurface< T > & | surface | ) | const [inline] |
| void BALL::TSurface< T >::pushBackNormal | ( | const Normal & | n | ) |
Add a normal.
| BALL_INLINE void BALL::TSurface< T >::pushBackTriangle | ( | const Triangle & | triangle | ) | [inline] |
Add a triangle.
References BALL::TSurface< T >::triangle.
| void BALL::TSurface< T >::pushBackVertex | ( | const Vertex & | vertex | ) |
Add a vertex.
| void BALL::TSurface< T >::readMSMSFile | ( | const String & | vert_filename, | |
| const String & | face_filename | |||
| ) | throw (Exception::FileNotFound) [inline] |
Read from MSMS file. Read the contents of the vertex and faces file created by Michael Sanners software MSMS.
References BALL::String::countFields(), BALL::String::getline(), BALL::String::split(), BALL::TSurface< T >::Triangle::v1, BALL::TSurface< T >::Triangle::v2, and BALL::TSurface< T >::Triangle::v3.
| BALL_INLINE void BALL::TSurface< T >::resizeNormals | ( | Size | size | ) | [inline] |
Resize the normal array.
References BALL::TSurface< T >::normal.
| BALL_INLINE void BALL::TSurface< T >::resizeTriangles | ( | Size | size | ) | [inline] |
Resize the triangle array.
References BALL::TSurface< T >::triangle.
| BALL_INLINE void BALL::TSurface< T >::resizeVertices | ( | Size | size | ) | [inline] |
Resize the vertex array.
References BALL::TSurface< T >::vertex.
| void BALL::TSurface< T >::set | ( | const TSurface< T > & | surface | ) | [inline] |
| vector<Normal> BALL::TSurface< T >::normal |
the normals for each vertex
Referenced by BALL::TSurface< T >::clear(), BALL::TSurface< T >::clearNormals(), BALL::TSurface< T >::get(), BALL::TSurface< T >::getNormal(), BALL::TSurface< T >::getNumberOfNormals(), BALL::TSurface< T >::operator=(), BALL::TSurface< T >::operator==(), BALL::TSurface< T >::resizeNormals(), and BALL::TSurface< T >::set().
| vector<Triangle> BALL::TSurface< T >::triangle |
the triangles
Referenced by BALL::TSurface< T >::clear(), BALL::TSurface< T >::clearTriangles(), BALL::TSurface< T >::get(), BALL::TSurface< T >::getArea(), BALL::TSurface< T >::getNumberOfTriangles(), BALL::TSurface< T >::getTriangle(), BALL::TSurface< T >::operator=(), BALL::TSurface< T >::operator==(), BALL::TSurface< T >::pushBackTriangle(), BALL::TSurface< T >::resizeTriangles(), and BALL::TSurface< T >::set().
| vector<Vertex> BALL::TSurface< T >::vertex |
the vertices
Referenced by BALL::TSurface< T >::clear(), BALL::TSurface< T >::clearVertices(), BALL::TSurface< T >::get(), BALL::TSurface< T >::getArea(), BALL::TSurface< T >::getNumberOfVertices(), BALL::TSurface< T >::getVertex(), BALL::TSurface< T >::operator=(), BALL::TSurface< T >::operator==(), BALL::TSurface< T >::resizeVertices(), and BALL::TSurface< T >::set().