Walls And Holes  1
Map2Mesh Class Reference

An object that keeps track of map-to-mesh conversion. More...

#include <map2mesh.h>

Inheritance diagram for Map2Mesh:
Collaboration diagram for Map2Mesh:

Classes

struct  Properties
 

Public Slots

void tileChanged (int x, int y)
 Modifies the mesh near the tile that changed. More...
 
void remakeAll ()
 Completely remakes all tile meshes. More...
 

Public Member Functions

 Map2Mesh (TileMap *tileMap, QObject *parent=nullptr)
 Creates the conversion object. More...
 
SharedSimpleTexturedScene getScene () const
 Returns the Scene that this Map2Mesh instance works with. More...
 

Protected Types

using TileObjectGrid = Array2D< QVector< QSharedPointer< SimpleTexturedObject > >>
 

Protected Member Functions

void updateScene ()
 Updates the scene for all tiles that need updates. More...
 

Protected Attributes

TileMapmTileMap
 The TileMap that is the input to this Map2Mesh object. More...
 
SharedSimpleTexturedScene mScene
 The Scene which contains the output of the Map2Mesh object. More...
 
TileObjectGrid mTileObjects
 Mesh data for every tile. More...
 
bool mSceneUpdateScheduled
 Whether an updateScene() call has been scheduled. Used in tileChanged(). More...
 
QSet< QPoint > mTilesToUpdate
 Coordinates of tiles that need updating. More...
 
QMutex mSceneUpdateMutex
 Mutex for scene-update related operations. More...
 

Detailed Description

An object that keeps track of map-to-mesh conversion.

Member Typedef Documentation

◆ TileObjectGrid

using Map2Mesh::TileObjectGrid = Array2D<QVector<QSharedPointer<SimpleTexturedObject> >>
protected

A grid containing lists of objects. A tile's "mesh" may consist of several objects for texturing purposes.

Constructor & Destructor Documentation

◆ Map2Mesh()

Map2Mesh::Map2Mesh ( TileMap tileMap,
QObject *  parent = nullptr 
)

Creates the conversion object.

Parameters
tilemap- The tilemap on which the conversion will happen.
Here is the call graph for this function:

Member Function Documentation

◆ getScene()

SharedSimpleTexturedScene Map2Mesh::getScene ( ) const

Returns the Scene that this Map2Mesh instance works with.

Here is the caller graph for this function:

◆ remakeAll

void Map2Mesh::remakeAll ( )
slot

Completely remakes all tile meshes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileChanged

void Map2Mesh::tileChanged ( int  x,
int  y 
)
slot

Modifies the mesh near the tile that changed.

Parameters
x
y
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateScene()

void Map2Mesh::updateScene ( )
protected

Updates the scene for all tiles that need updates.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mScene

SharedSimpleTexturedScene Map2Mesh::mScene
protected

The Scene which contains the output of the Map2Mesh object.

◆ mSceneUpdateMutex

QMutex Map2Mesh::mSceneUpdateMutex
protected

Mutex for scene-update related operations.

◆ mSceneUpdateScheduled

bool Map2Mesh::mSceneUpdateScheduled
protected

Whether an updateScene() call has been scheduled. Used in tileChanged().

◆ mTileMap

TileMap* Map2Mesh::mTileMap
protected

The TileMap that is the input to this Map2Mesh object.

◆ mTileObjects

TileObjectGrid Map2Mesh::mTileObjects
protected

Mesh data for every tile.

◆ mTilesToUpdate

QSet<QPoint> Map2Mesh::mTilesToUpdate
protected

Coordinates of tiles that need updating.


The documentation for this class was generated from the following files: