9 #include <maths/Rotation.h>
13 #include <ogr_geometry.h>
23 friend class boost::serialization::access;
30 template<
class Archive>
31 void serialize(Archive &ar,
const unsigned int version){
86 std::shared_ptr<AABB>
bound =
nullptr;
123 std::shared_ptr<LadLut>
ladlut =
nullptr;
161 OGRSpatialReference *mCrs =
nullptr;
162 OGREnvelope *mEnv =
nullptr;
283 {this->mPrimitives = primitives;}
302 inline std::string
const &
getId()
const {
return mId;}
308 inline void setId(
const std::string &
id) {this->mId = id;}
Class representing an Axis Aligned Bounding Box (AABB)
Definition: AABB.h:10
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:24
Definition: Rotation.h:80
Class representing a scene part.
Definition: ScenePart.h:20
void setId(const std::string &id)
Set the ID of the scene part.
Definition: ScenePart.h:308
ScenePart & operator=(const ScenePart &rhs)
Copy assigment operator.
Definition: ScenePart.cpp:49
std::vector< Primitive * > mPrimitives
Vector of pointers to primitives used by this scene part.
Definition: ScenePart.h:78
void smoothVertexNormals()
Smooth normals for each vertex computing the mean for each triangle using it.
Definition: ScenePart.cpp:106
bool randomShift
Specify if apply random shift to the scene part (true) or not (false, by default)
Definition: ScenePart.h:118
void setPrimitives(std::vector< Primitive * > const &primitives)
Set the primitives of the scene part.
Definition: ScenePart.h:282
void setCentroid(arma::colvec centroid)
Set the centroid of the scene part.
Definition: ScenePart.h:295
virtual ObjectType getType() const
Obtain the object type of the scene part.
Definition: ScenePart.h:314
PrimitiveType
Specify the type of primitive used to build the scene part By default, the ScenePart is not build fro...
Definition: ScenePart.h:63
arma::colvec centroid
The centroid of the scene part.
Definition: ScenePart.h:82
std::vector< size_t > subpartLimit
Vector specifying the limit of a subpart as the index of first element of next subpart.
Definition: ScenePart.h:104
glm::dvec3 mOrigin
Specify the origin for the scene part.
Definition: ScenePart.h:128
double onRayIntersectionArgument
Specify the extra value to be used for ray intersection handling computation, when needed (depends on...
Definition: ScenePart.h:113
bool splitSubparts()
Split each subpart into a different scene part, with the first one corresponding to this scene part.
Definition: ScenePart.cpp:141
Rotation mRotation
Specify the rotation for the scene part.
Definition: ScenePart.h:132
void computeCentroid(bool const computeBound=false)
Compute the default centroid for the scene part as the midrange point and its boundaries too.
Definition: ScenePart.cpp:199
std::string onRayIntersectionMode
Specify the handling mode for ray intersections.
Definition: ScenePart.h:108
std::string const & getId() const
Obtain the ID of the scene part.
Definition: ScenePart.h:302
std::shared_ptr< LadLut > ladlut
Look-up table for leaf angle distribution.
Definition: ScenePart.h:123
ObjectType
Specify the type of scene part / object. By default, the ScenePart is a static object.
Definition: ScenePart.h:53
std::vector< Vertex * > getAllVertices() const
Obtain all vertices in the scene part.
Definition: ScenePart.cpp:96
arma::colvec getCentroid() const
Obtain the centroid of the scene part.
Definition: ScenePart.h:289
double mScale
Specify the scale for the scene part.
Definition: ScenePart.h:136
void serialize(Archive &ar, const unsigned int version)
Serialize a ScenePart to a stream of bytes.
Definition: ScenePart.h:31
PrimitiveType primitiveType
The type of primitive used to build the scene part.
Definition: ScenePart.h:74
void addObj(WavefrontObj *obj)
Add the primitives of a WavefrontObj to the ScenePart.
Definition: ScenePart.cpp:79
ScenePart()
Default constructor for a scene part.
Definition: ScenePart.h:175
int forceOnGround
Force the scene part to be on ground if , do nothing if .
Definition: ScenePart.h:158
std::shared_ptr< AABB > bound
The axis aligned bounding box defining scene part boundaries.
Definition: ScenePart.h:86
std::vector< Primitive * > const & getPrimitives() const
Obtain the primitives of the scene part.
Definition: ScenePart.h:275
std::string mId
Identifier for the scene part.
Definition: ScenePart.h:91
Class representing a .obj loaded file.
Definition: WavefrontObj.h:15