4 #include <boost/serialization/base_object.hpp>
5 #include <boost/serialization/shared_ptr.hpp>
10 #include <NoiseSource.h>
11 #include <IntersectionHandlingResult.h>
12 #include <util/HeliosException.h>
14 #include <DynObject.h>
15 #include <DynMovingObject.h>
16 #include <DynSequentiableMovingObject.h>
28 friend class boost::serialization::access;
35 template<
class Archive>
36 void serialize(Archive &ar,
const unsigned int version) {
38 ar.template register_type<DynMovingObject>();
39 ar.template register_type<DynSequentiableMovingObject>();
57 std::shared_ptr<ScenePart>
part =
nullptr;
91 const glm::dvec3& rayOrigin,
92 const glm::dvec3& rayDir,
93 const glm::dvec3& intersectionPoint
102 const glm::dvec3& rayOrigin,
const glm::dvec3& rayDir) = 0;
111 const glm::dvec3& rayOrigin,
const glm::dvec3& rayDir) = 0;
231 glm::dvec3 &rayDirection,
232 glm::dvec3
const &insideIntersectionPoint,
233 glm::dvec3
const &outsideIntersectionPoint,
248 virtual void scale(
double const factor);
253 virtual void translate(glm::dvec3
const &shift);
Class representing an Axis Aligned Bounding Box (AABB)
Definition: AABB.h:10
Base class for Helios exceptions.
Definition: HeliosException.h:12
Output class for intersection handling methods.
Definition: IntersectionHandlingResult.h:14
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:24
virtual void update()=0
Necessary primitive updates after modification.
virtual bool canComputeSigmaWithLadLut()
Check if primitive can compute sigma using LadLut or not.
Definition: Primitive.h:263
virtual glm::dvec3 getCentroid()=0
Obtain the primitive centroid.
virtual void translate(glm::dvec3 const &shift)
Translate primitive by given shift.
Definition: Primitive.cpp:59
virtual double getIncidenceAngle_rad(const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir, const glm::dvec3 &intersectionPoint)=0
Obtain the incidence angle in radians.
std::shared_ptr< ScenePart > part
Shared pointer to the scene part the primitive belongs to.
Definition: Primitive.h:57
virtual std::vector< double > getRayIntersection(const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir)=0
Obtain the intersection point between primitive and given ray.
virtual void onFinishLoading(NoiseSource< double > &uniformNoiseSource)
Method to be triggered once all Primitives have been loaded.
Definition: Primitive.h:123
virtual double getGroundZOffset()
Offset for ground point z coordinate.
Definition: Primitive.h:187
virtual AABB * getAABB()=0
Obtain the axis aligned bounding box containing the primitive.
virtual double computeSigmaWithLadLut(glm::dvec3 const &direction)
Compute sigma using LadLut.
Definition: Primitive.h:275
virtual void scale(double const factor)
Scale primitive by given factor.
Definition: Primitive.cpp:50
virtual size_t getNumFullVertices()
Obtain the number of vertices returned by the getFullVertices function.
Definition: Primitive.h:145
virtual bool canHandleIntersections()
Specify if the primitive can handle intersections or not.
Definition: Primitive.h:208
std::shared_ptr< Material > material
Shared pointer to the material defining certain properties such as reflectance, specularity,...
Definition: Primitive.h:63
virtual void rotate(Rotation &r)
Performs rotation over primitive.
Definition: Primitive.cpp:44
void serialize(Archive &ar, const unsigned int version)
Serialize a Primitive to a stream of bytes.
Definition: Primitive.h:36
virtual Vertex * getVertices()=0
Obtain basic vertices for the primitive.
friend std::ostream & operator<<(std::ostream &out, Primitive &p)
Output stream operator << overloading.
Definition: Primitive.cpp:24
virtual IntersectionHandlingResult onRayIntersection(NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity)
Handle ray intersections.
Definition: Primitive.cpp:12
virtual double getRayIntersectionDistance(const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir)=0
Obtain the intersection distance between primitive and given ray.
virtual Vertex * getFullVertices()
Obtain full vertices for the primitive.
Definition: Primitive.h:158
virtual size_t getNumVertices()
Obtain the number of vertices returned by the getVertices function.
Definition: Primitive.h:131
Definition: Rotation.h:80
Class representing a vertex.
Definition: Vertex.h:14