Loading...
Searching...
No Matches
BALL::VIEW::Mesh Class Reference
Visualisation » Geometric Objects

`#include <BALL/VIEW/PRIMITIVES/mesh.h>`

Inheritance diagram for BALL::VIEW::Mesh:

## Public Member Functions

Constructors
| Mesh ()
| Mesh (const Mesh &mesh)
Destructors
virtual | ~Mesh ()
virtual void | clear ()
Assignment methods
void | set (const Mesh &mesh)
const Mesh & | operator= (const Mesh &mesh)
void | swap (Mesh &mesh)
debuggers and diagnostics
virtual bool | isValid () const
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
bool | binaryWrite (const String &filename)
bool | binaryRead (const String &filename)
virtual void | getVertices (vector< Vector3 > &vertices) const
Public Member Functions inherited from BALL::VIEW::GeometricObject
| GeometricObject ()
| GeometricObject (const GeometricObject &object)
virtual | ~GeometricObject ()
void | set (const GeometricObject &object)
GeometricObject & | operator= (const GeometricObject &object)
void | swap (GeometricObject &object)
void | setComposite (const Composite *composite)
const Composite * | getComposite () const
void | setColor (const ColorRGBA &color)
void | setColor (const ColorUnit &red, const ColorUnit &green, const ColorUnit &blue, const ColorUnit &alpha=(float) 1)
const ColorRGBA & | getColor () const
ColorRGBA & | getColor ()
void | getColor (ColorUnit &red, ColorUnit &green, ColorUnit &blue, ColorUnit &alpha) const
void | getColors (HashSet< String > &colors)
| Insert the colors of this object into the hashset.
bool | operator== (const GeometricObject &object) const
| Needed for MSVC.
bool | operator< (const GeometricObject &object) const
| Needed for MSVC.
virtual void | getVertices (std::vector< Vector3 > &) const
Public Member Functions inherited from BALL::TSurface< float >
| TSurface ()
| TSurface (const TSurface &surface)
virtual | ~TSurface ()
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)
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.
bool | operator== (const TSurface &surface) const
bool | operator!= (const TSurface &surface) const
Public Member Functions inherited from BALL::VIEW::MultiColorExtension
| MultiColorExtension ()
| MultiColorExtension (const MultiColorExtension &color_extension)
virtual | ~MultiColorExtension ()
void | set (const MultiColorExtension &color_extension)
const MultiColorExtension & | operator= (const MultiColorExtension &color_extension)
void | swap (MultiColorExtension &color_extension)
void | setColors (const vector< ColorRGBA > &colors)
vector< ColorRGBA > & | getColors ()
const vector< ColorRGBA > & | getColors () const
void | setAlphas (Size alpha)
| Set the alpha values for all colors.

## Additional Inherited Members

Public Types inherited from BALL::TSurface< float >
typedef TVector3< float > | Vertex
| A vertex.
typedef TVector3< float > | Normal
| A normal.
Public Attributes inherited from BALL::TSurface< float >
vector< Vertex > | vertex
| the vertices
vector< Normal > | normal
| the normals for each vertex
vector< Triangle > | triangle
| the triangles
vector< ColorRGBA > | colors

## Detailed Description

Mesh class.
An instance of Mesh represents an instance of the geometric representation "mesh".

  The class Mesh is derived from the classes GeometricObject and Surface. The data structures defining the mesh are implemented in the class Surface. Therefore one can use this mesh in the same fashion as Surface.

  The colors belonging to each vertex. If this list has less entries than there are vertices in this mesh, we take the first element to color the whole mesh. If it is empty, we use the color white.

Definition at line 38 of file mesh.h.

## Constructor & Destructor Documentation

## Mesh() [1/2]

BALL::VIEW::Mesh::Mesh | ( |  | ) |

Default Constructor.

## Mesh() [2/2]

BALL::VIEW::Mesh::Mesh | ( | const Mesh & | mesh | ) |

Copy constructor

## ~Mesh()

virtual BALL::VIEW::Mesh::~Mesh | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## binaryRead()

bool BALL::VIEW::Mesh::binaryRead | ( | const String & | filename | ) |

## binaryWrite()

bool BALL::VIEW::Mesh::binaryWrite | ( | const String & | filename | ) |

## clear()

virtual void BALL::VIEW::Mesh::clear | ( |  | ) |

virtual

Explicit default initialization. Calls GeometricObject::clear

Reimplemented from BALL::VIEW::GeometricObject.

## dump()

virtual void BALL::VIEW::Mesh::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

virtual

Internal value dump. Dump the current value of this mesh to the output ostream s with dumping depth depth. Calls GeometricObject::dump.

Parameters

  s | output stream where to output the value of this mesh
  depth | the dumping depth

Reimplemented from BALL::VIEW::GeometricObject.

## getVertices()

virtual void BALL::VIEW::Mesh::getVertices | ( | vector< Vector3 > & | vertices | ) | const

virtual

## isValid()

virtual bool BALL::VIEW::Mesh::isValid | ( |  | ) | const

virtual

Internal state and consistency self-validation. Calls GeometricObject::isValid.

Reimplemented from BALL::VIEW::GeometricObject.

## operator=()

const Mesh & BALL::VIEW::Mesh::operator= | ( | const Mesh & | mesh | ) |

Assignment operator. Calls set.

## set()

void BALL::VIEW::Mesh::set | ( | const Mesh & | mesh | ) |

Assignment.

## swap()

void BALL::VIEW::Mesh::swap | ( | Mesh & | mesh | ) |

Swapping of mesh's. Swap the value of this mesh with the mesh mesh.

Parameters

  mesh | the mesh being swapped with this mesh