Lagrange
|
Manipulating mesh attributes. More...
Classes | |
class | AttributeBase |
Base handle for attributes. More... | |
class | Attribute< ValueType_ > |
Derived attribute class that stores the actual information. More... | |
class | IndexedAttribute< ValueType_, Index_ > |
Derived attribute class that stores the actual information. More... | |
Macros | |
#define | LA_ATTRIBUTE_X(mode, data) |
X Macro arguments for the Attribute<> class. More... | |
#define | LA_ATTRIBUTE_INDEX_X(mode, data) |
X Macro arguments for the Attribute<> class. More... | |
#define | LA_ATTRIBUTE_SCALAR_X(mode, data) |
X Macro arguments for the Attribute<> class. More... | |
#define | LA_X_attribute_make_value_type(_, ValueType) |
Typedefs | |
using | AttributeId = uint32_t |
Identified to be used to access an attribute. More... | |
Enumerations | |
enum | AttributeElement : int { Vertex = (1 << 0) , Facet = (1 << 1) , Edge = (1 << 2) , Corner = (1 << 3) , Value = (1 << 4) , Indexed = (1 << 5) } |
Type of element to which the attribute is attached. More... | |
enum class | AttributeUsage : uint16_t { Vector = (1 << 0) , Scalar = (1 << 1) , Position = (1 << 2) , Normal = (1 << 3) , Tangent = (1 << 4) , Bitangent = (1 << 5) , Color = (1 << 6) , UV = (1 << 7) , VertexIndex = (1 << 8) , FacetIndex = (1 << 9) , CornerIndex = (1 << 10) , EdgeIndex = (1 << 11) , String = (1 << 12) } |
Usage tag indicating how the attribute should behave under mesh transformations. More... | |
enum class | AttributeCreatePolicy { ErrorIfReserved , Force } |
Policy for attribute creation with reserved attribute names. More... | |
enum class | AttributeGrowthPolicy { ErrorIfExternal , AllowWithinCapacity , WarnAndCopy , SilentCopy } |
Policy for growing external attribute buffers. More... | |
enum class | AttributeShrinkPolicy { ErrorIfExternal , IgnoreIfExternal , WarnAndCopy , SilentCopy } |
Policy for shrinking external attribute buffers. More... | |
enum class | AttributeWritePolicy { ErrorIfReadOnly , WarnAndCopy , SilentCopy } |
Policy for attempting to write to read-only external buffers. More... | |
enum class | AttributeExportPolicy { CopyIfExternal , CopyIfUnmanaged , KeepExternalPtr , ErrorIfExternal } |
Policy for exporting attributes that are views onto external buffers. More... | |
enum class | AttributeCopyPolicy { CopyIfExternal , KeepExternalPtr , ErrorIfExternal } |
Policy for copying attribute that are views onto external buffers. More... | |
enum class | AttributeDeletePolicy { ErrorIfReserved , Force } |
Policy for attribute deletion of reserved attribute names. More... | |
enum class | AttributeValueType : uint8_t { LA_X_attribute_value_type_enum } |
Enum describing at runtime the value type of an attribute. More... | |
Functions | |
constexpr AttributeId | invalid_attribute_id () |
Invalid attribute id. | |
template<typename ValueType > | |
constexpr AttributeValueType | make_attribute_value_type () |
Creates an enum describing an attribute value type. More... | |
Manipulating mesh attributes.
Please read our user guide for an introduction.
#define LA_ATTRIBUTE_X | ( | mode, | |
data | |||
) |
#include <lagrange/AttributeTypes.h>
X Macro arguments for the Attribute<> class.
Since other modules might need to explicitly instantiate their own functions, this file is a public header.
Use in a .cpp as follows:
The optional data
argument can forwarded to other macros, in order to implement cartesian products when instantiating nested types.
mode | Suffix to apply to the LA_X_* macro. |
data | Data to be passed around as the first argument of the X macro. |
#define LA_ATTRIBUTE_INDEX_X | ( | mode, | |
data | |||
) |
#include <lagrange/AttributeTypes.h>
X Macro arguments for the Attribute<> class.
Usage is similar to LA_ATTRIBUTE_X, but it will only iterate over integral value types.
Use in a .cpp as follows:
The optional data
argument can forwarded to other macros, in order to implement cartesian products when instantiating nested types.
mode | Suffix to apply to the LA_X_* macro. |
data | Data to be passed around as the first argument of the X macro. |
#define LA_ATTRIBUTE_SCALAR_X | ( | mode, | |
data | |||
) |
#include <lagrange/AttributeTypes.h>
X Macro arguments for the Attribute<> class.
Usage is similar to LA_ATTRIBUTE_X, but it will only iterate over floating points value types.
Use in a .cpp as follows:
The optional data
argument can forwarded to other macros, in order to implement cartesian products when instantiating nested types.
mode | Suffix to apply to the LA_X_* macro. |
data | Data to be passed around as the first argument of the X macro. |
#define LA_X_attribute_make_value_type | ( | _, | |
ValueType | |||
) |
#include <lagrange/AttributeValueType.h>
using AttributeId = uint32_t |
#include <lagrange/AttributeFwd.h>
Identified to be used to access an attribute.
Attribute names are mapped to a unique identified when created. These unique identifiers can be used to more efficiently access the data (rather than rehashing the string every time).
enum AttributeElement : int |
#include <lagrange/AttributeFwd.h>
Type of element to which the attribute is attached.
|
strong |
#include <lagrange/AttributeFwd.h>
Usage tag indicating how the attribute should behave under mesh transformations.
This tag mostly serves as a hint, and does not impact how the attribute is stored/loaded.
Enumerator | |
---|---|
Vector | Mesh attribute can have any number of channels (including 1 channel). |
Scalar | Mesh attribute must have exactly 1 channel. |
Position | Mesh attribute must have exactly dim channels. |
Normal | Mesh attribute can have dim or dim + 1 channels. |
Tangent | Mesh attribute can have dim or dim + 1 channels. |
Bitangent | Mesh attribute can have dim or dim + 1 channels. |
Color | Mesh attribute can have 1, 2, 3 or 4 channels. |
UV | Mesh attribute must have exactly 2 channels. |
VertexIndex | Single channel integer attribute indexing a mesh vertex. |
FacetIndex | Single channel integer attribute indexing a mesh facet. |
CornerIndex | Single channel integer attribute indexing a mesh corner. |
EdgeIndex | Single channel integer attribute indexing a mesh edge. |
String | Mesh attribute is a metadata string (stored as a uint8_t buffer). |
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for attribute creation with reserved attribute names.
By default, attribute names starting with "$" are reserved for internal use. Creating a reserved attribute name requires an explicit policy flag to be passed to the appropriate function.
Enumerator | |
---|---|
ErrorIfReserved | Default deletion policy, throw an exception if attribute name is reserved. |
Force | Force creation of reserved attribute names. |
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for growing external attribute buffers.
If we need to add elements to an external attribute buffer, and we have reached the capacity of the provided span, we can either throw an exception (default behavior), or warn and create an internal copy of the buffer data.
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for shrinking external attribute buffers.
This policy controls what happens when calling shrink_to_fit()
to save memory. Shrinkage can happen either when mesh elements have been removed by another operation, or if the attribute has been created with additional capacity.
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for attempting to write to read-only external buffers.
By default any write operation on a read-only external buffer will throw an exception. Alternatively, we can issue a warning a perform a copy of the buffer data.
Enumerator | |
---|---|
ErrorIfReadOnly | Throws an exception when trying to write to a read-only buffer. |
WarnAndCopy | Logs a warning and copy the buffer data. |
SilentCopy | Silently copy the buffer data. |
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for exporting attributes that are views onto external buffers.
By default, a copy is created, meaning we can use the resulting pointer to manage the lifetime of the allocated data.
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for copying attribute that are views onto external buffers.
By default, a copy is created, meaning we can use the copied attribute to manage the lifetime of the allocated data.
|
strong |
#include <lagrange/AttributeFwd.h>
Policy for attribute deletion of reserved attribute names.
By default, attribute names starting with "$" are reserved for internal use. Deleting a reserved attribute name requires an explicit policy flag to be passed to the appropriate function.
Enumerator | |
---|---|
ErrorIfReserved | Default deletion policy, throw an exception if attribute name is reserved. |
Force | Force deletion of reserved attribute names. |
|
strong |
#include <lagrange/AttributeValueType.h>
Enum describing at runtime the value type of an attribute.
This can be accessed from the base attribute class and enables safe downcasting without global RTTI.
|
constexpr |
#include <lagrange/AttributeValueType.h>
Creates an enum describing an attribute value type.
ValueType | Value type of the attribute to convert to enum. |