Radium Engine
1.5.0
|
This class represents vertex + attributes per vertex. Toplogy is handled in MultiIndexedGeometry subclass. More...
#include <Core/Geometry/TriangleMesh.hpp>
Public Types | |
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 | |
AttribArrayGeometry () | |
Create an empty geometry. | |
AttribArrayGeometry (const AttribArrayGeometry &other) | |
AttribArrayGeometry (AttribArrayGeometry &&other) | |
AttribArrayGeometry & | operator= (const AttribArrayGeometry &other) |
AttribArrayGeometry & | operator= (AttribArrayGeometry &&other) |
bool | append (const AttribArrayGeometry &other) |
void | clear () override |
Erases all data, making the AttribArrayGeometry empty. | |
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::AttribManager & | vertexAttribs () |
const Utils::AttribManager & | vertexAttribs () const |
PointAttribHandle::Container & | verticesWithLock () |
void | verticesUnlock () |
Release lock on vertices positions. | |
NormalAttribHandle::Container & | normalsWithLock () |
void | normalsUnlock () |
Release lock on vertices normals. | |
Wrappers to Utils::AttribManager. | |
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::AttribBase * | getAttribBase (const std::string &name) |
const Utils::AttribBase * | getAttribBase (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) | |
AbstractGeometry & | operator= (const AbstractGeometry &other) |
Ra::Core::Utils::ObservableVoid & | getAabbObservable () |
Additional Inherited Members | |
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 |
This class represents vertex + attributes per vertex. Toplogy is handled in MultiIndexedGeometry subclass.
Attributes are unique per vertex, so that same position with different normals are two vertices. Points and Normals, defining the geometry, are always present. They can be accessed through vertices() and normals(). Other attribs could be added with addAttrib() and accesssed with getAttrib().
Definition at line 25 of file TriangleMesh.hpp.
|
inlineexplicit |
Copy constructor, copy all the data (geometry, attributes).
other
are not valid for *this. Definition at line 237 of file TriangleMesh.hpp.
|
inlineexplicit |
Move constructor, copy all the data (geometry, attributes).
other
are also valid for *this. Definition at line 244 of file TriangleMesh.hpp.
|
inline |
Add attribute with the given name.
name | attrib name, uniquely identify the attrib |
Definition at line 388 of file TriangleMesh.hpp.
|
inline |
Add attribute with the given name.
name | attrib name, uniquely identify the attrib |
data | an array defining the attrib data |
Definition at line 395 of file TriangleMesh.hpp.
|
inline |
Add attribute with the given name.
name | attrib name, uniquely identify the attrib |
data | an array defining the attrib data, the data is moved to the attrib |
Definition at line 405 of file TriangleMesh.hpp.
bool Ra::Core::Geometry::AttribArrayGeometry::append | ( | const AttribArrayGeometry & | other | ) |
Appends another AttribArrayGeometry to this one, but only if they have the same attributes. Return True if other
has been successfully appended.
Definition at line 11 of file TriangleMesh.cpp.
void Ra::Core::Geometry::AttribArrayGeometry::colorize | ( | const Utils::Color & | c | ) |
Utility function colorzing the AttribArrayGeometry with a given color.
Definition at line 38 of file TriangleMesh.cpp.
|
inline |
Copy all the attributes from input
. Existing attributes are kept untouched, except if overwritten by attributes copied from other
.
input
must have the same number of vertices. Definition at line 296 of file TriangleMesh.hpp.
|
inline |
Copy only the required attributes from input
. Existing attributes are kept untouched, except if overwritten by attributes copied from other
.
input
must have the same number of vertices. Definition at line 287 of file TriangleMesh.hpp.
|
inlinevirtual |
Copy only the geometry. The needed attributes can be copied through copyAttributes().
Definition at line 279 of file TriangleMesh.hpp.
|
inline |
Definition at line 379 of file TriangleMesh.hpp.
|
inline |
Definition at line 374 of file TriangleMesh.hpp.
|
inline |
Definition at line 355 of file TriangleMesh.hpp.
|
inline |
Definition at line 360 of file TriangleMesh.hpp.
|
inline |
|
inline |
|
inline |
Return the Handle to the attribute with the given name if it exists, an invalid handle otherwise.
Definition at line 345 of file TriangleMesh.hpp.
|
inline |
|
inline |
|
inline |
Check if an attribute exists with the given name.
Definition at line 383 of file TriangleMesh.hpp.
|
inline |
Read/write access the vertices normals.
Definition at line 435 of file TriangleMesh.hpp.
|
inline |
Move assignment, copy all the data (geometry, attributes).
other
are also valid for *this. Definition at line 261 of file TriangleMesh.hpp.
|
inline |
Assignment operator, copy all the data (geometry, attributes).
other
are not valid for *this. Definition at line 249 of file TriangleMesh.hpp.
|
inline |
Remove attribute by handle.
Definition at line 414 of file TriangleMesh.hpp.
|
inline |
Return the vertexAttribs manager. In case you want to have direct access to Utils::AttribManager functionality.
Definition at line 419 of file TriangleMesh.hpp.
|
inline |
Return the vertexAttribs manager. In case you want to have direct access to Utils::AttribManager functionality.
Definition at line 423 of file TriangleMesh.hpp.
|
inline |
Read/write access to the vertices positions.
Definition at line 427 of file TriangleMesh.hpp.