BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
BALL::VIEW::Mesh Class Reference

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

Inheritance diagram for BALL::VIEW::Mesh:
BALL::VIEW::GeometricObject BALL::TSurface< float > BALL::VIEW::MultiColorExtension

Public Member Functions

Constructors
 Mesh ()
 
 Mesh (const Mesh &mesh)
 
Destructors
virtual ~Mesh ()
 
virtual void clear ()
 
Assignment methods
void set (const Mesh &mesh)
 
const Meshoperator= (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)
 
GeometricObjectoperator= (const GeometricObject &object)
 
void swap (GeometricObject &object)
 
void setComposite (const Composite *composite)
 
const CompositegetComposite () const
 
void setColor (const ColorRGBA &color)
 
void setColor (const ColorUnit &red, const ColorUnit &green, const ColorUnit &blue, const ColorUnit &alpha=(float) 1)
 
const ColorRGBAgetColor () const
 
ColorRGBAgetColor ()
 
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. More...
 
bool operator== (const GeometricObject &object) const
 Needed for MSVC. More...
 
bool operator< (const GeometricObject &object) const
 Needed for MSVC. More...
 
- Public Member Functions inherited from BALL::TSurface< float >
 TSurface ()
 
 TSurface (const TSurface &surface)
 
virtual ~TSurface ()
 
void set (const TSurface &surface)
 
TSurfaceoperator= (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. More...
 
Size getNumberOfVertices () const
 Return the number of vertices. More...
 
Size getNumberOfNormals () const
 Return the number of normals. More...
 
TrianglegetTriangle (Position index)
 Return a triangle with a given index. More...
 
const TrianglegetTriangle (Position index) const
 Return a triangle with a given index. More...
 
void clearTriangles ()
 Clear all triangles. More...
 
void resizeTriangles (Size size)
 Resize the triangle array. More...
 
void pushBackTriangle (const Triangle &triangle)
 Add a triangle. More...
 
VertexgetVertex (Position index)
 Return the position of a vertex. More...
 
const VertexgetVertex (Position index) const
 Return the position of a vertex. More...
 
void clearVertices ()
 Clear all vertices. More...
 
void resizeVertices (Size size)
 Resize the vertex array. More...
 
void pushBackVertex (const Vertex &vertex)
 Add a vertex. More...
 
NormalgetNormal (Position index)
 Return the position of a normal. More...
 
const NormalgetNormal (Position index) const
 Return the position of a normal. More...
 
void clearNormals ()
 Clear all normals. More...
 
void resizeNormals (Size size)
 Resize the normal array. More...
 
void pushBackNormal (const Normal &n)
 Add a normal. More...
 
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 MultiColorExtensionoperator= (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. More...
 

Additional Inherited Members

- Public Types inherited from BALL::TSurface< float >
typedef TVector3< floatVertex
 A vertex. More...
 
typedef TVector3< floatNormal
 A normal. More...
 
- Public Attributes inherited from BALL::TSurface< float >
vector< Vertexvertex
 the vertices More...
 
vector< Normalnormal
 the normals for each vertex More...
 
vector< Triangletriangle
 the triangles More...
 
- Public Attributes inherited from BALL::VIEW::MultiColorExtension
vector< ColorRGBAcolors
 

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

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

Default Constructor.

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

Copy constructor

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

Destructor.

Member Function Documentation

bool BALL::VIEW::Mesh::binaryRead ( const String filename)
bool BALL::VIEW::Mesh::binaryWrite ( const String filename)
virtual void BALL::VIEW::Mesh::clear ( )
virtual

Explicit default initialization. Calls GeometricObject::clear

Reimplemented from BALL::VIEW::MultiColorExtension.

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
soutput stream where to output the value of this mesh
depththe dumping depth

Reimplemented from BALL::VIEW::MultiColorExtension.

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

Reimplemented from BALL::VIEW::GeometricObject.

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

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

Reimplemented from BALL::VIEW::GeometricObject.

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

Assignment operator. Calls set.

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

Assignment.

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

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

Parameters
meshthe mesh being swapped with this mesh