Code_TYMPAN
4.2.0
Industrial site acoustic simulation
|
This class mainly define a mesh (list of Shape) used by the Simulation object. More...
#include <Scene.h>
Public Member Functions | |
Scene () | |
Constructor. More... | |
Scene (const Scene &other) | |
Copy constructor. More... | |
virtual | ~Scene () |
Destructor. More... | |
void | clean () |
Clear all arrays. More... | |
void | addShape (Shape *shape) |
Add a shape to the list. More... | |
BBox | getGlobalBox () |
Return global bounding box. More... | |
Accelerator * | getAccelerator () const |
Get the accelerator. More... | |
std::vector< Shape * > * | getShapes () |
Return all the shapes. More... | |
const std::vector< Shape * > * | getShapes () const |
std::vector< vec3 > * | getVertices () |
Return all the vertices. More... | |
const std::vector< vec3 > * | getVertices () const |
std::vector< Shape * > | getShapes (int shape_type) |
Return all the shapes of a specific type. More... | |
bool | finish (int accelerator_id=1, leafTreatment::treatment _intersectionChoice=leafTreatment::FIRST) |
Build the selected accelerator on the scene. More... | |
bool | getIndex (vec3 &search, unsigned int &result) |
Get the index of a vertex in the vertices array. More... | |
bool | getVertex (unsigned int &search, vec3 &result) |
Get a vertex from the vertices array with its index. More... | |
bool | addVertex (const vec3 &newVertex, unsigned int &index) |
Add a vertex to the vertices array. More... | |
Shape * | addTriangle (unsigned int i1, unsigned int i2, unsigned int i3, Material *m, const bool &isSol=false) |
Add a triangle to the scene built with the vertices array. More... | |
void | addBuilding (vec3 origine, vec3 dimension, Material *m) |
Add a building to the scene. More... | |
void | export_to_ply (std::string fileName) |
Export the Scene to a PLY format file named fileName. More... | |
void | import_from_ply (std::string fileName) |
Import a Scene from a PLY format file named fileName. 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< Shape * > | shapes |
Array of pointers to the shapes. More... | |
BBox | globalBox |
Bounding box of the Scene. More... | |
Accelerator * | accelerator |
Pointer to the accelerator. More... | |
std::vector< vec3 > | vertices |
All the vertices used by the different shapes. More... | |
std::map< vec3, unsigned int, compVec > | registeredVertices |
Association between a vertex and his index in vertices. More... | |
unsigned int | compteurPrimitive |
Primitives counter. More... | |
unsigned int | compteurFace |
Faces counter. More... | |
Protected Attributes inherited from Base | |
std::string | name |
Each instantiated object may be named. More... | |
This class mainly define a mesh (list of Shape) used by the Simulation object.
void Scene::addBuilding | ( | vec3 | origine, |
vec3 | dimension, | ||
Material * | m | ||
) |
|
inline |
Shape * Scene::addTriangle | ( | unsigned int | i1, |
unsigned int | i2, | ||
unsigned int | i3, | ||
Material * | m, | ||
const bool & | isSol = false |
||
) |
Add a triangle to the scene built with the vertices array.
i1 | Index of first vertex in vertices |
i2 | Index of second vertex in vertices |
i3 | Index of third vertex in vertices |
m | Material |
isSol | True is ground triangle |
Definition at line 121 of file Scene.cpp.
bool Scene::addVertex | ( | const vec3 & | newVertex, |
unsigned int & | index | ||
) |
void Scene::clean | ( | ) |
void Scene::export_to_ply | ( | std::string | fileName | ) |
bool Scene::finish | ( | int | accelerator_id = 1 , |
leafTreatment::treatment | _intersectionChoice = leafTreatment::FIRST |
||
) |
Build the selected accelerator on the scene.
accelerator_id | Accelerator id |
_intersectionChoice | Intersection choice |
Definition at line 46 of file Scene.cpp.
|
inline |
|
inline |
bool Scene::getIndex | ( | vec3 & | search, |
unsigned int & | result | ||
) |
|
inline |
std::vector< Shape * > Scene::getShapes | ( | int | shape_type | ) |
bool Scene::getVertex | ( | unsigned int & | search, |
vec3 & | result | ||
) |
|
inline |
void Scene::import_from_ply | ( | std::string | fileName | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |