31 if (fabs(_v1.x - _v2.x) > 0.001)
35 if (fabs(_v1.y - _v2.y) > 0.001)
39 if (fabs(_v1.z - _v2.z) > 0.001)
57 name =
"unknown scene";
106 std::vector<Shape*>
getShapes(
int shape_type);
148 const bool& isSol =
false);
168 std::map<vec3, unsigned int, compVec>
Base class for accelerators.
Definition of a bounding box which is aligned along the axis (BBox AABB).
BBox Union(const BBox &b, const vec3 &p)
Union of a point and a BBox. A new BBox is created.
Base class of Event, Material, PostFilter, Ray, Repere, Scene, Shape, Simulation, Source.
std::string name
Each instantiated object may be named.
This class mainly define a mesh (list of Shape) used by the Simulation object.
Scene(const Scene &other)
Copy constructor.
void import_from_ply(std::string fileName)
Import a Scene from a PLY format file named fileName.
void clean()
Clear all arrays.
std::vector< Shape * > shapes
Array of pointers to the shapes.
std::vector< Shape * > * getShapes()
Return all the shapes.
bool getIndex(vec3 &search, unsigned int &result)
Get the index of a vertex in the vertices array.
void export_to_ply(std::string fileName)
Export the Scene to a PLY format file named fileName.
unsigned int compteurFace
Faces counter.
Accelerator * accelerator
Pointer to the accelerator.
void addShape(Shape *shape)
Add a shape to the list.
const std::vector< Shape * > * getShapes() const
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.
BBox globalBox
Bounding box of the Scene.
unsigned int compteurPrimitive
Primitives counter.
void addBuilding(vec3 origine, vec3 dimension, Material *m)
Add a building to the scene.
bool addVertex(const vec3 &newVertex, unsigned int &index)
Add a vertex to the vertices array.
virtual ~Scene()
Destructor.
Accelerator * getAccelerator() const
Get the accelerator.
BBox getGlobalBox()
Return global bounding box.
const std::vector< vec3 > * getVertices() const
bool getVertex(unsigned int &search, vec3 &result)
Get a vertex from the vertices array with its index.
std::vector< vec3 > vertices
All the vertices used by the different shapes.
std::vector< vec3 > * getVertices()
Return all the vertices.
std::map< vec3, unsigned int, compVec > registeredVertices
Association between a vertex and his index in vertices.
bool finish(int accelerator_id=1, leafTreatment::treatment _intersectionChoice=leafTreatment::FIRST)
Build the selected accelerator on the scene.
base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)
void setPrimitiveId(int id)
Set/Get the primitive id.
BBox getBBox()
Return the bounding box.
base_vec3< decimal > vec3
bool operator()(const vec3 &_v1, const vec3 &_v2) const