Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Protected Attributes | List of all members
Mesh Class Reference

Mesh class. More...

#include <Mesh.h>

Inheritance diagram for Mesh:
Inheritance graph
[legend]
Collaboration diagram for Mesh:
Collaboration graph
[legend]

Public Member Functions

 Mesh ()
 Constructors. More...
 
 Mesh (const Mesh &other)
 
virtual ~Mesh ()
 Destructor. More...
 
void clear ()
 Clear arrays. More...
 
std::vector< vec3 > & getVertices ()
 Get/Set the vertices of the mesh. More...
 
void setVertices (const std::vector< vec3 > &_vertices)
 
std::vector< ivec3 > & getTriangles ()
 Get/Set triangles of the mesh. More...
 
void setTriangles (const std::vector< ivec3 > &_triangles)
 
bool addTriangle (const ivec3 newTriangle, Material *m)
 Add a triangle to the mesh with the material m. More...
 
virtual bool getIntersection (Ray &ray, Intersection &inter)
 Get the Intersection between a ray and this shape. More...
 
- Public Member Functions inherited from Shape
 Shape ()
 Default constructor. More...
 
 Shape (const std::string _name)
 Constructor by giving a name to the Shape. More...
 
 Shape (Shape *other)
 Copy constructor. More...
 
virtual ~Shape ()
 Destructor. More...
 
 Shape (const Shape &other)
 Copy constructor. More...
 
virtual ShapeClone ()
 Clone and return a pointer to a Shape. More...
 
MaterialgetMaterial ()
 Return the pointed material. More...
 
void setMaterial (Material *m)
 Set the material. More...
 
virtual void updateBBox ()
 Update the bounding box: More...
 
BBox getBBox ()
 Return the bounding box. More...
 
void setVertices (std::vector< vec3 > *_vertices)
 Set/Get global vertices. More...
 
vector< vec3 > * getVertices ()
 
vector< unsigned int > * getLocalVertices ()
 Get local vertices. More...
 
virtual bool isVisible ()
 Return visibility. More...
 
virtual vec3 getNormal (const vec3 pos=vec3())
 Get normal. More...
 
void setPrimitiveId (int id)
 Set/Get the primitive id. More...
 
int getPrimitiveId () const
 
void setFaceId (int id)
 Set/Get the face id. More...
 
int getFaceId () const
 
void setEtageId (int id)
 Set/Get the floor id. More...
 
int getEtageId ()
 
void setBuildingId (int id)
 Set/Get the building id. More...
 
int getBuildingId ()
 
virtual bool sample (decimal density, std::vector< vec3 > &samples)
 Uncommented cause not used: More...
 
bool isSol () const
 Get/Set the flag _isSol (ground or not) More...
 
void setIsSol (const bool &isSol)
 
virtual int form ()
 Return type of the shape. More...
 
- Public Member Functions inherited from Base
 Base ()
 Default constructor. More...
 
 Base (const Base &other)
 Copy constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
std::string getName ()
 Get the name of the object. More...
 
void setName (const std::string &_name)
 Set the name of the object. More...
 

Protected Attributes

std::vector< vec3 > vertices
 Vertices of the mesh. More...
 
std::vector< ivec3 > triangles
 Triangles of the mesh. More...
 
- Protected Attributes inherited from Shape
BBox box
 Bounding box of the shape. More...
 
Materialmaterial
 Pointer to material. More...
 
std::vector< vec3 > * vertices
 GlobalVertices of the scene. More...
 
std::vector< unsigned int > localVertices
 Index of the vertices used for this shape. More...
 
int primitiveId
 Index of the primitive (given by the scene) More...
 
int faceId
 Index of the face supporting the primitive. More...
 
int buildingId
 Index of the building supporting the primitive (-1 if none) More...
 
int etageId
 Index of the floor (etage) supporting the primitive (-1 if none) More...
 
bool _isSol
 Triangle type (false = non natural, true = ground) More...
 
- Protected Attributes inherited from Base
std::string name
 Each instantiated object may be named. More...
 

Detailed Description

Mesh class.

Definition at line 24 of file Mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/2]

Mesh::Mesh ( )
inline

Constructors.

Definition at line 29 of file Mesh.h.

◆ Mesh() [2/2]

Mesh::Mesh ( const Mesh other)
inline

Definition at line 30 of file Mesh.h.

◆ ~Mesh()

virtual Mesh::~Mesh ( )
inlinevirtual

Destructor.

Definition at line 32 of file Mesh.h.

Here is the call graph for this function:

Member Function Documentation

◆ addTriangle()

bool Mesh::addTriangle ( const ivec3  newTriangle,
Material m 
)

Add a triangle to the mesh with the material m.

Definition at line 25 of file Mesh.cpp.

◆ clear()

void Mesh::clear ( )

Clear arrays.

Definition at line 19 of file Mesh.cpp.

Here is the caller graph for this function:

◆ getIntersection()

virtual bool Mesh::getIntersection ( Ray ray,
Intersection inter 
)
inlinevirtual

Get the Intersection between a ray and this shape.

Reimplemented from Shape.

Definition at line 67 of file Mesh.h.

◆ getTriangles()

std::vector<ivec3>& Mesh::getTriangles ( )
inline

Get/Set triangles of the mesh.

Definition at line 53 of file Mesh.h.

◆ getVertices()

std::vector<vec3>& Mesh::getVertices ( )
inline

Get/Set the vertices of the mesh.

Definition at line 40 of file Mesh.h.

◆ setTriangles()

void Mesh::setTriangles ( const std::vector< ivec3 > &  _triangles)
inline

Definition at line 57 of file Mesh.h.

◆ setVertices()

void Mesh::setVertices ( const std::vector< vec3 > &  _vertices)
inline

Definition at line 44 of file Mesh.h.

Member Data Documentation

◆ triangles

std::vector<ivec3> Mesh::triangles
protected

Triangles of the mesh.

Definition at line 74 of file Mesh.h.

◆ vertices

std::vector<vec3> Mesh::vertices
protected

Vertices of the mesh.

Definition at line 73 of file Mesh.h.


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