22 #include "Geometry/mathlib.h"
63 name =
"unknown shape";
111 cerr <<
"ERROR : Intersection with a non-type shape." << std::endl;
struct _Intersection Intersection
FORM
Primitives supported by the ray tracing method.
Definition of a bounding box which is aligned along the axis (BBox AABB).
Base class of Event, Material, PostFilter, Ray, Repere, Scene, Shape, Simulation, Source.
std::string name
Each instantiated object may be named.
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)
Shape(const std::string _name)
Constructor by giving a name to the Shape.
BBox box
Bounding box of the shape.
vector< vec3 > * getVertices()
int getPrimitiveId() const
virtual int form()
Return type of the shape.
int etageId
Index of the floor (etage) supporting the primitive (-1 if none)
std::vector< vec3 > * vertices
GlobalVertices of the scene.
virtual Shape * Clone()
Clone and return a pointer to a Shape.
Material * material
Pointer to material.
int faceId
Index of the face supporting the primitive.
void setFaceId(int id)
Set/Get the face id.
Material * getMaterial()
Return the pointed material.
void setIsSol(const bool &isSol)
vector< unsigned int > * getLocalVertices()
Get local vertices.
bool isSol() const
Get/Set the flag _isSol (ground or not)
void setPrimitiveId(int id)
Set/Get the primitive id.
void setVertices(std::vector< vec3 > *_vertices)
Set/Get global vertices.
virtual bool getIntersection(Ray &ray, Intersection &inter)
Get the Intersection between a ray and this shape.
void setBuildingId(int id)
Set/Get the building id.
Shape()
Default constructor.
virtual void updateBBox()
Update the bounding box:
virtual bool isVisible()
Return visibility.
int buildingId
Index of the building supporting the primitive (-1 if none)
int primitiveId
Index of the primitive (given by the scene)
virtual vec3 getNormal(const vec3 pos=vec3())
Get normal.
void setEtageId(int id)
Set/Get the floor id.
virtual ~Shape()
Destructor.
BBox getBBox()
Return the bounding box.
void setMaterial(Material *m)
Set the material.
bool _isSol
Triangle type (false = non natural, true = ground)
std::vector< unsigned int > localVertices
Index of the vertices used for this shape.
virtual bool sample(decimal density, std::vector< vec3 > &samples)
Uncommented cause not used:
Shape(Shape *other)
Copy constructor.
Shape(const Shape &other)
Copy constructor.
base_vec3< decimal > vec3