8 #ifndef META_OCEAN_SCENEDESCRIPTION_SDL_OBJ_OBJ_SCENE_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDL_OBJ_OBJ_SCENE_H
23 namespace SceneDescription
52 TYPE_VNT = TYPE_VN | TYPE_VT
134 typedef std::pair<FaceType, MaterialIndex>
FacePair;
176 inline const FacesMap& facesMap()
const;
250 unsigned int selectedMaterialIndex_ = invalidMaterialIndex_;
254 vertexIndices_(vertexIndices),
255 normalIndices_(normalIndices),
256 textureIndices_(textureIndices)
265 return FaceType((
unsigned int)(!normalIndices_.empty()) | ((
unsigned int)(!textureIndices_.empty()) << 1));
270 return vertexIndices_;
275 return normalIndices_;
280 return textureIndices_;
This class holds vertex, normal and texture indices for a triangle.
Definition: OBJScene.h:59
Rendering::VertexIndices vertexIndices_
Vertex indices.
Definition: OBJScene.h:97
Rendering::VertexIndices textureIndices_
Texture coordinate indices.
Definition: OBJScene.h:103
const Rendering::VertexIndices & textureIndices() const
Returns the texture coordinate indices of the face.
Definition: OBJScene.h:278
Rendering::VertexIndices normalIndices_
Noraml indices.
Definition: OBJScene.h:100
const Rendering::VertexIndices & vertexIndices() const
Returns the vertex indices of the face.
Definition: OBJScene.h:268
const Rendering::VertexIndices & normalIndices() const
Returns the normal indices of the face.
Definition: OBJScene.h:273
FaceType type() const
Returns the face type of this object.
Definition: OBJScene.h:263
Face(const Rendering::VertexIndices &vertexIndices, const Rendering::VertexIndices &normalIndices, const Rendering::VertexIndices &textureIndices)
Creates a new face object.
Definition: OBJScene.h:253
This class holds the entire scene contained in one obj file.
Definition: OBJScene.h:37
Rendering::TextureCoordinates textureCoordinates_
Vector holding all texture coordinate of the obj scene.
Definition: OBJScene.h:238
void setCurrentMaterial(const std::string &material)
Sets the current selected material.
void addVertex(const Rendering::Vertex &vertex)
Adds a new vertex to the scene.
Definition: OBJScene.h:303
MaterialIndexMap materialIndexMap_
Map mapping material names to material indices.
Definition: OBJScene.h:247
OBJScene(const std::string &filename)
Creates a new OBJ scene object.
std::unordered_map< std::string, unsigned int > MaterialIndexMap
Definition of a map mapping material names to material indices.
Definition: OBJScene.h:124
FaceType
Definition of different face types.
Definition: OBJScene.h:44
Rendering::SceneRef internalApply(const Rendering::EngineRef &engine) override
Applies the entire scene to the rendering engine.
void addNormal(const Rendering::Normal &normal)
Adds a new normal to the scene.
Definition: OBJScene.h:308
void setMaterials(Materials &&materials)
Sets the materials of the obj scene.
std::map< FacePair, Faces > FacesMap
Definition of a map mapping face pairs to faces.
Definition: OBJScene.h:139
Rendering::Vertices vertices_
Vector holding all vertices of the obj scene.
Definition: OBJScene.h:232
const Rendering::Normals & normals() const
Returns the normals of the entire obj scene.
Definition: OBJScene.h:288
void addTextureCoordinate(const Rendering::TextureCoordinate &textureCoordinate)
Adds a new texture coordinate to the scene.
Definition: OBJScene.h:313
const Rendering::Vertices & vertices() const
Returns the vertices of the entire obj scene.
Definition: OBJScene.h:283
void addFace(const Face &face)
Adds a new face to the scene.
Rendering::Normals normals_
Vector holding all normals of the obj scene.
Definition: OBJScene.h:235
std::pair< FaceType, MaterialIndex > FacePair
Definition of a pair of face type and material index.
Definition: OBJScene.h:134
const Rendering::TextureCoordinates & textureCoordinates() const
Returns the texture coordinates of the entire obj scene.
Definition: OBJScene.h:293
unsigned int MaterialIndex
Definition of a material index.
Definition: OBJScene.h:114
std::vector< Material > Materials
Definition of a vector holding materials.
Definition: OBJScene.h:109
Rendering::NodeRef createTriangles(const Rendering::EngineRef &engine)
Creates a new triangle mesh object.
Materials materials_
All material objects of this scene.
Definition: OBJScene.h:244
std::vector< Face > Faces
Definition of a vector holding faces.
Definition: OBJScene.h:129
~OBJScene() override
Destructs an OBJ scene object.
FacesMap facesMap_
Map holding all faces of the obj scene.
Definition: OBJScene.h:241
const FacesMap & facesMap() const
Returns all faces of the entire obj scene.
Definition: OBJScene.h:298
This class implements the base class for all sdl scene object providing access to all elements of a s...
Definition: SDLScene.h:39
std::vector< Vertex > Vertices
Definition of a vector holding vertices.
Definition: rendering/Rendering.h:119
std::vector< TextureCoordinate > TextureCoordinates
Definition of a vector holding texture coordinates.
Definition: rendering/Rendering.h:113
std::vector< Normal > Normals
Definition of a vector holding normals.
Definition: rendering/Rendering.h:107
std::vector< VertexIndex > VertexIndices
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:101
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15