|
AGXDynamics
2.31.1.0
|
#include <TerrainDataAtlas.h>
Inheritance diagram for agxTerrain::TerrainDataAtlas:Classes | |
| struct | MassTypeHash |
Public Types | |
| enum | MassType { SOLID, PARTICLE, FLUID } |
Public Member Functions | |
| TerrainDataAtlas (agx::Real voxelSize) | |
| Basic Constructor. More... | |
| float | addMass (const Grid::GridCoord &coord, MassType massType, float value) |
| Adds occupancy mass of specific mass type in a voxel with specified 3D-coordinate in voxel index space. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| void | clearMassGrid (MassType massType) |
| void | clearVelocityGrid () |
| float | getCompactedSolidMass (const Grid::GridCoord &coord) const |
| Get the occupancy mass in a voxel modified by the compaction grid with specified 3D-coordinate in voxel index space. More... | |
| float | getCompaction (const Grid::GridCoord &coord) const |
| Gets the compression data from a voxel in the grid. More... | |
| Grid * | getCompactionGridData () const |
| Grid * | getGridMassData (MassType massType) const |
| agx::Vec3iVector | getIndicesWithMass (MassType massType) const |
| Returns the active indices in voxel index space which contains occupancy mass of a specific mass type. More... | |
| float | getMass (const Grid::GridCoord &coord, MassType massType) const |
| Get the occupancy mass of specific mass type in a voxel with specified 3D-coordinate in voxel index space. More... | |
| agx::Real | getMassInTerrain (MassType massType) const |
| float | getMaximumAllowedSolidMassInVoxel (const Grid::GridCoord &coord) const |
| Returns the maximum allowed solid mass in the voxel. More... | |
| int | getReferenceCount () const |
| size_t | getTotalActiveVoxels () const |
| size_t | getTotalGridMemoryUsage () const |
| agx::Real | getTotalMassInTerrain () const |
| float | getTotalMassInVoxel (const Grid::GridCoord &coord) const |
| agx::Vec3f | getVelocity (const Grid::GridCoord &coord) const |
| VoxelToVelocityTable & | getVelocityTable () |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isActiveVoxel (const Grid::GridCoord &coord, MassType massType) const |
| Checks if a voxel is active in data grid of a specific mass type. More... | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| void | setCompaction (const Grid::GridCoord &coord, float value) |
| Sets compression data in a voxel in the grid. More... | |
| void | setData (const Grid &grid, MassType massType) |
| void | setMass (const Grid::GridCoord &coord, MassType massType, float value) |
| Sets the occupancy mass of specific mass type in a voxel with specified 3D-coordinate in voxel index space. More... | |
| void | setVelocity (const Grid::GridCoord &coord, const agx::Vec3f &value) |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~TerrainDataAtlas () |
| Reference counted object - protected destructor. More... | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| GridRef | m_compactionGrid |
| GridRef | m_fluidMassGrid |
| agx::HashTable< MassType, Grid *, MassTypeHash > | m_massGridTable |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| GridRef | m_particleMassGrid |
| AtomicValue | m_refCount |
| GridRef | m_solidMassGrid |
| VoxelToVelocityTable | m_voxelToVelocityTable |
Definition at line 32 of file TerrainDataAtlas.h.
| Enumerator | |
|---|---|
| SOLID | |
| PARTICLE | |
| FLUID | |
Definition at line 37 of file TerrainDataAtlas.h.
| agxTerrain::TerrainDataAtlas::TerrainDataAtlas | ( | agx::Real | voxelSize | ) |
Basic Constructor.
| voxelSize | - The uniform voxel dimension used in the internal transformation of the terrain data grids. |
|
protectedvirtual |
Reference counted object - protected destructor.
| float agxTerrain::TerrainDataAtlas::addMass | ( | const Grid::GridCoord & | coord, |
| MassType | massType, | ||
| float | value | ||
| ) |
Adds occupancy mass of specific mass type in a voxel with specified 3D-coordinate in voxel index space.
Setting a mass to the voxel with activate it in the specified mass grid.
| coord | - The 3D coordiante of the voxel in the voxel index space. |
| massType | - The type of mass data that should be inserted into the voxel. |
| value | - The occupancy value of the specific type that should be added to the voxel. |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
| void agxTerrain::TerrainDataAtlas::clearVelocityGrid | ( | ) |
|
protectedinherited |
| float agxTerrain::TerrainDataAtlas::getCompactedSolidMass | ( | const Grid::GridCoord & | coord | ) | const |
Get the occupancy mass in a voxel modified by the compaction grid with specified 3D-coordinate in voxel index space.
The returned mass is modified by the following formula: return = occupancyMass / compaction. This is mainly used when trying to sum compacted soild mass with particle and fluid mass in the same voxel. Particle and fluid occupancy is always defined in nominal compression.
| coord | - The 3D index coordinate in voxel space. |
| float agxTerrain::TerrainDataAtlas::getCompaction | ( | const Grid::GridCoord & | coord | ) | const |
Gets the compression data from a voxel in the grid.
The compression determines how much solid occupancy can exist in a voxel. by the following relation: MAX_SOILD_VOLUME = compression * NOMINAL_MAX_VOLUME
| coord | - The 3D voxel coordinate of the voxel in the voxel index space. |
| Grid* agxTerrain::TerrainDataAtlas::getCompactionGridData | ( | ) | const |
|
staticprotectedinherited |
| agx::Vec3iVector agxTerrain::TerrainDataAtlas::getIndicesWithMass | ( | MassType | massType | ) | const |
Returns the active indices in voxel index space which contains occupancy mass of a specific mass type.
| massType | - the specific mass type |
| float agxTerrain::TerrainDataAtlas::getMass | ( | const Grid::GridCoord & | coord, |
| MassType | massType | ||
| ) | const |
Get the occupancy mass of specific mass type in a voxel with specified 3D-coordinate in voxel index space.
| coord | - The 3D index coordinate in voxel space. |
| massType | - The type of mass data that should be extracted from the voxel. |
| float agxTerrain::TerrainDataAtlas::getMaximumAllowedSolidMassInVoxel | ( | const Grid::GridCoord & | coord | ) | const |
Returns the maximum allowed solid mass in the voxel.
This is a function of the current compression in the voxel.
| coord | - The 3D voxel coordinate of the voxel in the voxel index space. |
|
inherited |
| size_t agxTerrain::TerrainDataAtlas::getTotalActiveVoxels | ( | ) | const |
| size_t agxTerrain::TerrainDataAtlas::getTotalGridMemoryUsage | ( | ) | const |
| agx::Real agxTerrain::TerrainDataAtlas::getTotalMassInTerrain | ( | ) | const |
| float agxTerrain::TerrainDataAtlas::getTotalMassInVoxel | ( | const Grid::GridCoord & | coord | ) | const |
| agx::Vec3f agxTerrain::TerrainDataAtlas::getVelocity | ( | const Grid::GridCoord & | coord | ) | const |
| VoxelToVelocityTable& agxTerrain::TerrainDataAtlas::getVelocityTable | ( | ) |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
| bool agxTerrain::TerrainDataAtlas::isActiveVoxel | ( | const Grid::GridCoord & | coord, |
| MassType | massType | ||
| ) | const |
Checks if a voxel is active in data grid of a specific mass type.
| coord | - The 3D coordiante of the voxel in the voxel index space. |
| massType | - The specified mass type. |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
| void agxTerrain::TerrainDataAtlas::setCompaction | ( | const Grid::GridCoord & | coord, |
| float | value | ||
| ) |
Sets compression data in a voxel in the grid.
The compression determines how much solid occupancy can exist in a voxel. by the following relation: MAX_SOILD_VOLUME = compression * NOMINAL_MAX_VOLUME
| coord | - The 3D voxel coordinate of the voxel in voxel index space. |
| value | - The compression value to set to the voxel. |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
| void agxTerrain::TerrainDataAtlas::setMass | ( | const Grid::GridCoord & | coord, |
| MassType | massType, | ||
| float | value | ||
| ) |
Sets the occupancy mass of specific mass type in a voxel with specified 3D-coordinate in voxel index space.
Setting a mass to the voxel with activate it in the specified mass grid.
| coord | - The 3D coordinate of the voxel in the voxel index space. |
| massType | - The type of mass data that should be inserted into the voxel. |
| value | - the occupancy value, which can range from [0.0 - 1.0] of the specified mass type that should inserted. |
| void agxTerrain::TerrainDataAtlas::setVelocity | ( | const Grid::GridCoord & | coord, |
| const agx::Vec3f & | value | ||
| ) |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
protected |
Definition at line 169 of file TerrainDataAtlas.h.
|
protected |
Definition at line 167 of file TerrainDataAtlas.h.
|
protected |
Definition at line 173 of file TerrainDataAtlas.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
protected |
Definition at line 168 of file TerrainDataAtlas.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
Definition at line 166 of file TerrainDataAtlas.h.
|
protected |
Definition at line 171 of file TerrainDataAtlas.h.