Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::Geometry::IndexedGeometry< T > Class Template Reference

A single layer MultiIndexedGeometry. More...

#include <Core/Geometry/IndexedGeometry.hpp>

+ Inheritance diagram for Ra::Core::Geometry::IndexedGeometry< T >:
+ Collaboration diagram for Ra::Core::Geometry::IndexedGeometry< T >:

Public Types

using IndexType = T
 
using IndexContainerType = VectorArray<IndexType>
 
- Public Types inherited from Ra::Core::Geometry::MultiIndexedGeometry
using LayerSemanticCollection = Utils::ObjectWithSemantic::SemanticNameCollection
 
using LayerSemantic = Utils::ObjectWithSemantic::SemanticName
 
using LayerKeyType = std::pair<LayerSemanticCollection, std::string>
 
using PointAttribHandle = AttribArrayGeometry::PointAttribHandle
 
using NormalAttribHandle = AttribArrayGeometry::NormalAttribHandle
 
using FloatAttribHandle = AttribArrayGeometry::FloatAttribHandle
 
using Vec2AttribHandle = AttribArrayGeometry::Vec2AttribHandle
 
using Vec3AttribHandle = AttribArrayGeometry::Vec3AttribHandle
 
using Vec4AttribHandle = AttribArrayGeometry::Vec4AttribHandle
 
- Public Types inherited from Ra::Core::Geometry::AttribArrayGeometry
using Point = Vector3
 
using Normal = Vector3
 
using PointAttribHandle = Utils::AttribHandle<Point>
 
using NormalAttribHandle = Utils::AttribHandle<Normal>
 
using FloatAttribHandle = Utils::AttribHandle<Scalar>
 
using Vec2AttribHandle = Utils::AttribHandle<Vector2>
 
using Vec3AttribHandle = Utils::AttribHandle<Vector3>
 
using Vec4AttribHandle = Utils::AttribHandle<Vector4>
 

Public Member Functions

const IndexContainerTypegetIndices () const
 
IndexContainerTypegetIndicesWithLock ()
 
void indicesUnlock ()
 unlock previously read write acces, notify observers of the update.
 
void setIndices (IndexContainerType &&indices)
 
void setIndices (const IndexContainerType &indices)
 
const LayerKeyTypegetLayerKey () const
 
- Public Member Functions inherited from Ra::Core::Geometry::MultiIndexedGeometry
 MultiIndexedGeometry (const MultiIndexedGeometry &other)
 
 MultiIndexedGeometry (MultiIndexedGeometry &&other)
 
 MultiIndexedGeometry (const AttribArrayGeometry &other)
 
 MultiIndexedGeometry (AttribArrayGeometry &&other)
 
MultiIndexedGeometryoperator= (const MultiIndexedGeometry &other)
 
MultiIndexedGeometryoperator= (MultiIndexedGeometry &&other)
 
void clear () override
 Erases all data, making the AttribArrayGeometry empty.
 
void copy (const MultiIndexedGeometry &other)
 Copy geometry and indices from others.
 
void checkConsistency () const
 Check that the MultiIndexedGeometry is well built, asserting when it is not.
 
bool append (const MultiIndexedGeometry &other)
 
bool containsLayer (const LayerKeyType &layerKey) const
 Check if at least one layer with such properties exists.
 
bool containsLayer (const LayerSemanticCollection &semantics, const std::string &layerName) const
 Check if at least one layer with such properties exists.
 
bool containsLayer (const LayerSemanticCollection &semantics) const
 Check if at least one layer with such properties exists.
 
bool containsLayer (const LayerSemantic &semanticName) const
 Check if at least one layer with such properties exists.
 
size_t countLayers (const LayerKeyType &layerKey) const
 Count the number of layer matching the input parameters.
 
size_t countLayers (const LayerSemanticCollection &semantics, const std::string &layerName) const
 Count the number of layer matching the input parameters.
 
size_t countLayers (const LayerSemanticCollection &semantics) const
 Count the number of layer matching the input parameters.
 
size_t countLayers (const LayerSemantic &semanticName) const
 Count the number of layer matching the input parameters.
 
const GeometryIndexLayerBasegetLayer (const LayerKeyType &layerKey) const
 Read-only access to a layer.
 
const GeometryIndexLayerBasegetLayer (const LayerSemanticCollection &semantics, const std::string &layerName) const
 Read-only access to a layer.
 
std::pair< LayerKeyType, const GeometryIndexLayerBase & > getFirstLayerOccurrence (const LayerSemanticCollection &semantics) const
 Read-only access to a layer.
 
std::pair< LayerKeyType, const GeometryIndexLayerBase & > getFirstLayerOccurrence (const LayerSemantic &semanticName) const
 Read-only access to a layer.
 
GeometryIndexLayerBasegetLayerWithLock (const LayerKeyType &layerKey)
 Write access to a layer.
 
GeometryIndexLayerBasegetLayerWithLock (const LayerSemanticCollection &semantics, const std::string &layerName)
 Write access to a layer.
 
std::pair< LayerKeyType, GeometryIndexLayerBase & > getFirstLayerOccurrenceWithLock (const LayerSemanticCollection &semantics)
 Write access to a layer.
 
std::pair< LayerKeyType, GeometryIndexLayerBase & > getFirstLayerOccurrenceWithLock (const LayerSemantic &semanticName)
 Write access to a layer.
 
void unlockLayer (const LayerKeyType &layerKey)
 Unlock layer with write acces, notify observers of the update.
 
void unlockLayer (const LayerSemanticCollection &semantics, const std::string &layerName)
 Unlock layer with write acces, notify observers of the update.
 
std::pair< bool, GeometryIndexLayerBase & > addLayer (std::unique_ptr< GeometryIndexLayerBase > &&layer, const bool withLock=false, const std::string &layerName="")
 Add layer.
 
auto layerKeys () const
 Range on layer keys (read-only)
 
- Public Member Functions inherited from Ra::Core::Geometry::AttribArrayGeometry
 AttribArrayGeometry ()
 Create an empty geometry.
 
 AttribArrayGeometry (const AttribArrayGeometry &other)
 
 AttribArrayGeometry (AttribArrayGeometry &&other)
 
AttribArrayGeometryoperator= (const AttribArrayGeometry &other)
 
AttribArrayGeometryoperator= (AttribArrayGeometry &&other)
 
bool append (const AttribArrayGeometry &other)
 
void setVertices (PointAttribHandle::Container &&vertices)
 Set vertices.
 
void setVertices (const PointAttribHandle::Container &vertices)
 Set vertices.
 
const PointAttribHandle::Container & vertices () const
 Access the vertices positions.
 
void setNormals (PointAttribHandle::Container &&normals)
 Set normals.
 
void setNormals (const PointAttribHandle::Container &normals)
 Set normals.
 
const NormalAttribHandle::Container & normals () const
 Access the vertices normals.
 
template<typename T >
Utils::AttribHandle< T > getAttribHandle (const std::string &name) const
 
template<typename T >
bool isValid (const Utils::AttribHandle< T > &h) const
 Return true if h refers to an existing attribute in *this.
 
bool hasAttrib (const std::string &name) const
 
template<typename T >
void removeAttrib (Utils::AttribHandle< T > &h)
 
void clearAttributes ()
 Erases all attributes, leaving the AttribArrayGeometry with geometry only.
 
virtual void copyBaseGeometry (const AttribArrayGeometry &other)
 
template<typename... Handles>
bool copyAttributes (const AttribArrayGeometry &input, Handles... attribs)
 
bool copyAllAttributes (const AttribArrayGeometry &input)
 
Aabb computeAabb () const override
 Compute bounding box.
 
void colorize (const Utils::Color &c)
 
Utils::AttribManagervertexAttribs ()
 
const Utils::AttribManagervertexAttribs () const
 
PointAttribHandle::Container & verticesWithLock ()
 
void verticesUnlock ()
 Release lock on vertices positions.
 
NormalAttribHandle::Container & normalsWithLock ()
 
void normalsUnlock ()
 Release lock on vertices normals.
 
template<typename T >
Utils::Attrib< T > & getAttrib (const Utils::AttribHandle< T > &h)
 
template<typename T >
const Utils::Attrib< T > & getAttrib (const Utils::AttribHandle< T > &h) const
 
template<typename T >
Utils::Attrib< T > & getAttrib (const std::string &name)
 
template<typename T >
const Utils::Attrib< T > & getAttrib (const std::string &name) const
 
template<typename T >
Utils::Attrib< T > * getAttribPtr (const Utils::AttribHandle< T > &h)
 
template<typename T >
const Utils::Attrib< T > * getAttribPtr (const Utils::AttribHandle< T > &h) const
 
Utils::AttribBasegetAttribBase (const std::string &name)
 
const Utils::AttribBasegetAttribBase (const std::string &name) const
 
template<typename T >
Utils::AttribHandle< T > addAttrib (const std::string &name)
 
template<typename T >
Utils::AttribHandle< T > addAttrib (const std::string &name, const typename Core::VectorArray< T > &data)
 
template<typename T >
Utils::AttribHandle< T > addAttrib (const std::string &name, const typename Utils::Attrib< T >::Container &&data)
 
- Public Member Functions inherited from Ra::Core::Geometry::AbstractGeometry
 AbstractGeometry (const AbstractGeometry &other)
 
AbstractGeometryoperator= (const AbstractGeometry &other)
 
Ra::Core::Utils::ObservableVoid & getAabbObservable ()
 

Additional Inherited Members

- Protected Member Functions inherited from Ra::Core::Geometry::MultiIndexedGeometry
void unlockFirstLayerOccurrence (const LayerSemanticCollection &semantics)
 Unlock layer with write acces, notify observers of the update.
 
void unlockFirstLayerOccurrence (const LayerSemantic &semanticName)
 Unlock layer with write acces, notify observers of the update.
 
- Protected Member Functions inherited from Ra::Core::Geometry::AbstractGeometry
bool isAabbValid () const
 
Core::Aabb getAabb () const
 
void invalidateAabb () const
 
void setAabb (const Core::Aabb &aabb) const
 

Detailed Description

template<typename T>
class Ra::Core::Geometry::IndexedGeometry< T >

A single layer MultiIndexedGeometry.

This class actually provide compatibility with old geometry with a main layer. Main layer contains indices of a specific type (point, line, triangle, poly). Derived classes explicit the kind of indices of the main layer. Since IndexedGeometry is a MultiIndexedGeometry, one can add index layer on the fly.

Warning
will be depracated when MultiIndexedGeometry will be supported directly on the engine side.

Definition at line 514 of file IndexedGeometry.hpp.

Member Typedef Documentation

◆ IndexContainerType

template<typename T >
using Ra::Core::Geometry::IndexedGeometry< T >::IndexContainerType = VectorArray<IndexType>

Definition at line 518 of file IndexedGeometry.hpp.

◆ IndexType

template<typename T >
using Ra::Core::Geometry::IndexedGeometry< T >::IndexType = T

Definition at line 517 of file IndexedGeometry.hpp.

Constructor & Destructor Documentation

◆ IndexedGeometry()

template<typename T >
Ra::Core::Geometry::IndexedGeometry< T >::IndexedGeometry ( )
inline

Definition at line 736 of file IndexedGeometry.hpp.

Member Function Documentation

◆ getIndices()

template<typename T >
const IndexedGeometry< T >::IndexContainerType & Ra::Core::Geometry::IndexedGeometry< T >::getIndices ( ) const
inline

Definition at line 745 of file IndexedGeometry.hpp.

◆ getIndicesWithLock()

template<typename T >
IndexedGeometry< T >::IndexContainerType & Ra::Core::Geometry::IndexedGeometry< T >::getIndicesWithLock ( )
inline

read write access to indices. Cause indices to be "lock" for the caller need to be unlock by the caller before any one can ask for write access.

Definition at line 750 of file IndexedGeometry.hpp.

◆ getLayerKey()

template<typename T >
const IndexedGeometry< T >::LayerKeyType & Ra::Core::Geometry::IndexedGeometry< T >::getLayerKey ( ) const
inline

Definition at line 776 of file IndexedGeometry.hpp.

◆ indicesUnlock()

template<typename T >
void Ra::Core::Geometry::IndexedGeometry< T >::indicesUnlock ( )
inline

unlock previously read write acces, notify observers of the update.

Definition at line 756 of file IndexedGeometry.hpp.

◆ setIndices() [1/2]

template<typename T >
void Ra::Core::Geometry::IndexedGeometry< T >::setIndices ( const IndexContainerType & indices)
inline

Definition at line 769 of file IndexedGeometry.hpp.

◆ setIndices() [2/2]

template<typename T >
void Ra::Core::Geometry::IndexedGeometry< T >::setIndices ( IndexContainerType && indices)
inline

set indices. Indices must be unlock, i.e. no one should have write access to it. Notify observers of the update.

Definition at line 761 of file IndexedGeometry.hpp.

+ Here is the call graph for this function:

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