Radium Engine
1.5.20
|
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.
Definition at line 33 of file TriangleMesh.hpp.
using Ra::Core::Geometry::AttribArrayGeometry::Normal = Vector3 |
Definition at line 29 of file TriangleMesh.hpp.
Definition at line 32 of file TriangleMesh.hpp.
using Ra::Core::Geometry::AttribArrayGeometry::Point = Vector3 |
Definition at line 28 of file TriangleMesh.hpp.
Definition at line 31 of file TriangleMesh.hpp.
Definition at line 34 of file TriangleMesh.hpp.
Definition at line 35 of file TriangleMesh.hpp.
Definition at line 36 of file TriangleMesh.hpp.
|
inline |
Create an empty geometry.
Definition at line 39 of file TriangleMesh.hpp.
|
inlineexplicit |
Copy constructor, copy all the data (geometry, attributes).
other
are not valid for *this. Definition at line 235 of file TriangleMesh.hpp.
|
inlineexplicit |
Move constructor, copy all the data (geometry, attributes).
other
are also valid for *this. Definition at line 242 of file TriangleMesh.hpp.
|
inline |
Add attribute with the given name.
name | attrib name, uniquely identify the attrib |
Definition at line 386 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 393 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 403 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.
|
inlineoverridevirtual |
Erases all data, making the AttribArrayGeometry empty.
Implements Ra::Core::Geometry::AbstractGeometry.
Reimplemented in Ra::Core::Geometry::MultiIndexedGeometry.
Definition at line 270 of file TriangleMesh.hpp.
|
inline |
Erases all attributes, leaving the AttribArrayGeometry with geometry only.
Definition at line 27 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.
|
inlineoverridevirtual |
Compute bounding box.
Implements Ra::Core::Geometry::AbstractGeometry.
Definition at line 302 of file TriangleMesh.hpp.
|
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 294 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 285 of file TriangleMesh.hpp.
|
inlinevirtual |
Copy only the geometry. The needed attributes can be copied through copyAttributes().
Definition at line 277 of file TriangleMesh.hpp.
|
inline |
Definition at line 377 of file TriangleMesh.hpp.
|
inline |
Definition at line 372 of file TriangleMesh.hpp.
|
inline |
Definition at line 353 of file TriangleMesh.hpp.
|
inline |
Definition at line 358 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 343 of file TriangleMesh.hpp.
|
inline |
|
inline |
|
inline |
Check if an attribute exists with the given name.
Definition at line 381 of file TriangleMesh.hpp.
|
inline |
Return true if h
refers to an existing attribute in *this.
Definition at line 348 of file TriangleMesh.hpp.
|
inline |
Access the vertices normals.
Definition at line 337 of file TriangleMesh.hpp.
|
inline |
Release lock on vertices normals.
Definition at line 437 of file TriangleMesh.hpp.
|
inline |
Read/write access the vertices normals.
Definition at line 433 of file TriangleMesh.hpp.
|
inline |
Move assignment, copy all the data (geometry, attributes).
other
are also valid for *this. Definition at line 259 of file TriangleMesh.hpp.
|
inline |
Assignment operator, copy all the data (geometry, attributes).
other
are not valid for *this. Definition at line 247 of file TriangleMesh.hpp.
|
inline |
Remove attribute by handle.
Definition at line 412 of file TriangleMesh.hpp.
|
inline |
Set normals.
Definition at line 332 of file TriangleMesh.hpp.
|
inline |
Set normals.
Definition at line 329 of file TriangleMesh.hpp.
|
inline |
Set vertices.
Definition at line 319 of file TriangleMesh.hpp.
|
inline |
Set vertices.
Definition at line 314 of file TriangleMesh.hpp.
|
inline |
Return the vertexAttribs manager. In case you want to have direct access to Utils::AttribManager functionality.
Definition at line 417 of file TriangleMesh.hpp.
|
inline |
Return the vertexAttribs manager. In case you want to have direct access to Utils::AttribManager functionality.
Definition at line 421 of file TriangleMesh.hpp.
|
inline |
Access the vertices positions.
Definition at line 325 of file TriangleMesh.hpp.
|
inline |
Release lock on vertices positions.
Definition at line 429 of file TriangleMesh.hpp.
|
inline |
Read/write access to the vertices positions.
Definition at line 425 of file TriangleMesh.hpp.