8 #ifndef META_OCEAN_TRACKING_MAPTEXTURING_TEXTURE_GENERATOR_H
9 #define META_OCEAN_TRACKING_MAPTEXTURING_TEXTURE_GENERATOR_H
42 namespace MapTexturing
87 typedef std::unordered_map<Index32, Mesh>
MeshMap;
117 typedef std::unordered_map<HashableTriangle, TriangleObject, HashableTriangle>
TriangleMap;
193 bool exportMeshs(
const std::string& filename,
const bool exportTexturedTrianglesOnly);
199 inline bool isValid()
const;
243 static constexpr
Index32 invalidTriangleId();
251 Index32 triangleIdCounter_ = invalidTriangleId();
263 unsigned int frameIndex_ = 0u;
274 #ifndef OCEAN_PLATFORM_BUILD_APPLE_IOS_ANY
324 bool anySceneMeshHasChanged_ =
false;
334 texturingMode_(texturingMode)
341 frameIndex_(frameIndex)
This class implements the abstract base class for all AnyCamera objects.
Definition: AnyCamera.h:130
std::shared_ptr< SceneElement > SharedSceneElement
Definition of a shared pointer holding a scene element.
Definition: SceneTracker6DOF.h:896
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a renderer for a depth buffer.
Definition: DepthBufferRenderer.h:33
This class implements a renderer for the entire mesh.
Definition: MeshRenderer.h:41
This class implements a renderer for retired triangle allowing to determine whether they can be delet...
Definition: RetiredTrianglesRenderer.h:37
This class implements a texture atlas for triangles with regular shape.
Definition: TextureAtlas.h:31
This class stores the relevant information of a mesh textures with the same texture.
Definition: TextureGenerator.h:71
Vectors2 textureCoordinates_
The texture coordinates, one for each vertex.
Definition: TextureGenerator.h:81
Vectors3 vertices_
The vertices of the mesh.
Definition: TextureGenerator.h:75
Rendering::TriangleFaces triangleFaces_
The triangle faces of the mesh.
Definition: TextureGenerator.h:78
This class stores the relevant information for a triangle.
Definition: TextureGenerator.h:95
TriangleObject(const Index32 id, const Index32 frameIndex)
Creates a new triangle object.
Definition: TextureGenerator.h:339
This class implements a texture generator for scene elements.
Definition: TextureGenerator.h:51
TrianglesIdRenderer activeTrianglesIdRenderer_
The renderer able to render triangles with individual color ids of all active triangles (not includin...
Definition: TextureGenerator.h:269
Lock lock_
The generator's lock.
Definition: TextureGenerator.h:330
TextureAtlas textureAtlas_
The profile of the texture atlas to be used for all textures.
Definition: TextureGenerator.h:300
TexturingMode
Definition of individual texturing modes.
Definition: TextureGenerator.h:58
@ TM_KEEP_RETIRED
Keeping retired triangles.
Definition: TextureGenerator.h:62
TexturedTrianglesRenderer texturedTrianglesRenderer_
The renderer able to render textured triangles to the texture atlas.
Definition: TextureGenerator.h:277
SceneMeshVertexCounterMap latestSceneMeshVertexCounterMap_
The latest vertex counts of all scene meshes.
Definition: TextureGenerator.h:327
Rendering::FramebufferRef dummyFramebuffer_
The dummy framebuffer for platforms not having their own main framebuffer.
Definition: TextureGenerator.h:266
Frame reusableDepthFrame_
Reusable frame for the z-buffer.
Definition: TextureGenerator.h:306
Indices32 retiredTriangleIds_
The ids of all retired triangles since the last update call.
Definition: TextureGenerator.h:312
std::vector< HashableTriangle > Triangles
Definition of a vector holding hash-able triangle objects.
Definition: TextureGenerator.h:122
std::unordered_map< HashableTriangle, TriangleObject, HashableTriangle > TriangleMap
Definition of an unordered map mapping hash-able triangles to a TriangleObject objects.
Definition: TextureGenerator.h:117
TriangleMap triangleMap_
The map mapping hash-able triangles to triangle objects.
Definition: TextureGenerator.h:254
bool extractMeshesWithAtlasTextureCoordinates(MeshMap &meshMap, const bool exportTexturedTrianglesOnly)
Extracts all meshes of this texture generator with texture coordinates associated with the texture at...
Indices32 freeTriangleIds_
The ids of triangles which can be reused as they have been deleted before.
Definition: TextureGenerator.h:260
std::unordered_map< Index32, Mesh > MeshMap
Definition of an unordered map mapping Mesh ids to mesh objects.
Definition: TextureGenerator.h:87
TrianglesIdRenderer anyTrianglesIdRenderer_
The renderer able to render triangles with individual color ids of all existing triangles (active and...
Definition: TextureGenerator.h:272
bool render(const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_camera, const Rendering::EngineRef &engine, const bool renderTexturedTrianglesOnly, Frame &frame)
Renders the current textured mesh for a given camera pose.
bool exportMeshs(const std::string &filename, const bool exportTexturedTrianglesOnly)
Exports all currently textured meshes and creates an X3D scene file.
RetiredTrianglesRenderer retiredTrianglesRenderer_
The renderer able to render all retired triangles.
Definition: TextureGenerator.h:285
TexturedTrianglesRendererBackup texturedTrianglesRendererBackup_
The renderer able to render textured triangles to the texture atlas.
Definition: TextureGenerator.h:282
std::unordered_map< Index32, size_t > SceneMeshVertexCounterMap
Definition of a map mapping unique scene mesh ids to vertex counts.
Definition: TextureGenerator.h:127
bool processFrame(Frame &&rgbFrame, const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_camera, const Rendering::EngineRef &engine)
Processes a new frame and updates or sets the texture of the texture atlases whenever necessary.
VisibleTrianglesRenderer visibleTrianglesRenderer_
The renderer able to determine which triangles are visible.
Definition: TextureGenerator.h:291
std::unordered_map< Index32, Rendering::TextureFramebufferRef > TextureFramebufferMap
Definition of an unordered map mapping mesh ids to texture framebuffers.
Definition: TextureGenerator.h:132
Frame reusableIdFrame_
Reusable frame for triangle ids.
Definition: TextureGenerator.h:303
TrianglesManagerRenderer trianglesManagerRenderer_
The renderer able to manage the states of all textures.
Definition: TextureGenerator.h:294
Rendering::VertexSetRef renderingVertexSet_
The vertex set holding the vertices to be rendered.
Definition: TextureGenerator.h:318
MeshRenderer meshRenderer_
The renderer for the entire mesh.
Definition: TextureGenerator.h:297
bool processFrameRedrawRetired(Frame &&rgbFrame, const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_camera, const Rendering::EngineRef &engine)
Processes a new frame and updates or sets the texture of the texture atlases whenever necessary with ...
Indices32 deletedTriangleIds_
The reusable vector holding ids of deleted triangle.
Definition: TextureGenerator.h:315
bool processFrameKeepRetired(Frame &&rgbFrame, const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_camera, const Rendering::EngineRef &engine)
Processes a new frame and updates or sets the texture of the texture atlases whenever necessary with ...
bool exportMesh(const Index32 meshId, Mesh &mesh, Frame &meshTexture)
Returns a current mesh.
TextureGenerator(const TexturingMode texturingMode=TM_REDRAW_RETIRED)
Creates a new texture generator.
Definition: TextureGenerator.h:333
bool updateMesh(const Devices::SceneTracker6DOF::SharedSceneElement &sceneElement, const bool skipIfVertexNumberHasNotChanged)
Updates the generator's meshes with new meshes given as scene elements.
Rendering::TrianglesRef renderingTriangles_
The triangle object which will be used to render the triangles.
Definition: TextureGenerator.h:321
DepthBufferRenderer depthBufferRenderer_
The renderer able to down-sample and to filter a depth buffer.
Definition: TextureGenerator.h:288
Indices32 newTriangleIds_
The ids of all new triangles since the last update call.
Definition: TextureGenerator.h:309
bool extractMeshesWithAtlasTextureCoordinates(const Index32 meshId, Mesh &mesh)
Extracts a mesh of this texture generator with texture coordinates associated with the texture atlas.
Indices32 meshIds() const
Returns the ids of the generated textured meshes.
bool isValid() const
Returns whether this generator holds at least one triangle.
Definition: TextureGenerator.h:346
static constexpr Index32 invalidTriangleId()
Returns an invalid triangle id.
Definition: TextureGenerator.h:351
This class implements a renderer rendering textured triangles into a texture atlas using a backup app...
Definition: TexturedTrianglesRendererBackup.h:41
This class implements a renderer rendering textured triangles into a texture atlas using a geometry s...
Definition: TexturedTrianglesRenderer.h:41
This class implements a renderer for triangles with individual color ids.
Definition: TrianglesIdRenderer.h:38
This class implements a manager for active, textured, retired, and deleted triangles.
Definition: TrianglesManagerRenderer.h:41
This class implements a renderer for all visible triangles.
Definition: VisibleTrianglesRenderer.h:38
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
uint32_t Index32
Definition of a 32 bit index value.
Definition: Base.h:84
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition: Vector2.h:64
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
std::vector< TriangleFace > TriangleFaces
Definition of a vector holding triangle faces.
Definition: TriangleFace.h:23
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15