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

base class for shapes (Cylindre, Mesh, Sphere, Triangle,...) More...

#include <Shape.h>

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

Public Member Functions

 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 bool getIntersection (Ray &ray, Intersection &inter)
 Get the Intersection between a ray and this shape. 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

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

base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)

Definition at line 57 of file Shape.h.

Constructor & Destructor Documentation

◆ Shape() [1/4]

Shape::Shape ( )
inline

Default constructor.

Definition at line 62 of file Shape.h.

◆ Shape() [2/4]

Shape::Shape ( const std::string  _name)
inline

Constructor by giving a name to the Shape.

Definition at line 64 of file Shape.h.

◆ Shape() [3/4]

Shape::Shape ( Shape other)
inline

Copy constructor.

Definition at line 66 of file Shape.h.

◆ ~Shape()

virtual Shape::~Shape ( )
inlinevirtual

Destructor.

Definition at line 76 of file Shape.h.

◆ Shape() [4/4]

Shape::Shape ( const Shape other)
inline

Copy constructor.

Definition at line 78 of file Shape.h.

Member Function Documentation

◆ Clone()

virtual Shape* Shape::Clone ( )
inlinevirtual

Clone and return a pointer to a Shape.

Reimplemented in Sphere.

Definition at line 88 of file Shape.h.

◆ form()

virtual int Shape::form ( )
inlinevirtual

Return type of the shape.

Reimplemented in Sphere, Triangle, and Cylindre.

Definition at line 138 of file Shape.h.

◆ getBBox()

BBox Shape::getBBox ( )
inline

Return the bounding box.

Definition at line 102 of file Shape.h.

Here is the caller graph for this function:

◆ getBuildingId()

int Shape::getBuildingId ( )
inline

Definition at line 129 of file Shape.h.

◆ getEtageId()

int Shape::getEtageId ( )
inline

Definition at line 126 of file Shape.h.

◆ getFaceId()

int Shape::getFaceId ( ) const
inline

Definition at line 123 of file Shape.h.

◆ getIntersection()

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

Get the Intersection between a ray and this shape.

Reimplemented in Sphere, Mesh, Triangle, and Cylindre.

Definition at line 98 of file Shape.h.

Here is the caller graph for this function:

◆ getLocalVertices()

vector<unsigned int>* Shape::getLocalVertices ( )
inline

Get local vertices.

Definition at line 109 of file Shape.h.

Here is the caller graph for this function:

◆ getMaterial()

Material* Shape::getMaterial ( )
inline

Return the pointed material.

Definition at line 94 of file Shape.h.

Here is the caller graph for this function:

◆ getNormal()

virtual vec3 Shape::getNormal ( const vec3  pos = vec3())
inlinevirtual

Get normal.

Reimplemented in Triangle.

Definition at line 115 of file Shape.h.

Here is the caller graph for this function:

◆ getPrimitiveId()

int Shape::getPrimitiveId ( ) const
inline

Definition at line 119 of file Shape.h.

Here is the caller graph for this function:

◆ getVertices()

vector<vec3>* Shape::getVertices ( )
inline

Definition at line 106 of file Shape.h.

Here is the caller graph for this function:

◆ isSol()

bool Shape::isSol ( ) const
inline

Get/Set the flag _isSol (ground or not)

Definition at line 134 of file Shape.h.

Here is the caller graph for this function:

◆ isVisible()

virtual bool Shape::isVisible ( )
inlinevirtual

Return visibility.

Reimplemented in Cylindre.

Definition at line 112 of file Shape.h.

◆ sample()

virtual bool Shape::sample ( decimal  density,
std::vector< vec3 > &  samples 
)
inlinevirtual

Uncommented cause not used:

Reimplemented in Triangle, and Cylindre.

Definition at line 131 of file Shape.h.

◆ setBuildingId()

void Shape::setBuildingId ( int  id)
inline

Set/Get the building id.

Definition at line 128 of file Shape.h.

◆ setEtageId()

void Shape::setEtageId ( int  id)
inline

Set/Get the floor id.

Definition at line 125 of file Shape.h.

◆ setFaceId()

void Shape::setFaceId ( int  id)
inline

Set/Get the face id.

Definition at line 122 of file Shape.h.

◆ setIsSol()

void Shape::setIsSol ( const bool &  isSol)
inline

Definition at line 135 of file Shape.h.

Here is the caller graph for this function:

◆ setMaterial()

void Shape::setMaterial ( Material m)
inline

Set the material.

Definition at line 96 of file Shape.h.

◆ setPrimitiveId()

void Shape::setPrimitiveId ( int  id)
inline

Set/Get the primitive id.

Definition at line 118 of file Shape.h.

Here is the caller graph for this function:

◆ setVertices()

void Shape::setVertices ( std::vector< vec3 > *  _vertices)
inline

Set/Get global vertices.

Definition at line 105 of file Shape.h.

◆ updateBBox()

virtual void Shape::updateBBox ( )
inlinevirtual

Update the bounding box:

Reimplemented in Triangle.

Definition at line 100 of file Shape.h.

Member Data Documentation

◆ _isSol

bool Shape::_isSol
protected

Triangle type (false = non natural, true = ground)

Definition at line 149 of file Shape.h.

◆ box

BBox Shape::box
protected

Bounding box of the shape.

Definition at line 141 of file Shape.h.

◆ buildingId

int Shape::buildingId
protected

Index of the building supporting the primitive (-1 if none)

Definition at line 147 of file Shape.h.

◆ etageId

int Shape::etageId
protected

Index of the floor (etage) supporting the primitive (-1 if none)

Definition at line 148 of file Shape.h.

◆ faceId

int Shape::faceId
protected

Index of the face supporting the primitive.

Definition at line 146 of file Shape.h.

◆ localVertices

std::vector<unsigned int> Shape::localVertices
protected

Index of the vertices used for this shape.

Definition at line 144 of file Shape.h.

◆ material

Material* Shape::material
protected

Pointer to material.

Definition at line 142 of file Shape.h.

◆ primitiveId

int Shape::primitiveId
protected

Index of the primitive (given by the scene)

Definition at line 145 of file Shape.h.

◆ vertices

std::vector<vec3>* Shape::vertices
protected

GlobalVertices of the scene.

Definition at line 143 of file Shape.h.


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