MfxMesh#
-
class MfxMesh : public MfxBase#
Mesh data coming from an input or being sent to an output. The instance of this class like all classes from this API except the structs whose name ends with “Props” does not actually contain data, it is only a reference and can hence be freely copied around without worrying about memory usage. You MUST call Release once and only once though.
Public Functions
-
bool IsValid() const#
A mesh may be invalid if its parent input is not connected to any incoming link. If this returns false, none of the other methods must be called.
-
void FetchProperties(MfxMeshProps &props)#
Populate the provided props structure with this mesh’s properties
-
MfxMesh AllocateAndFetchIOMap(int output_points_count, int origin_points_pool_size)#
Get the attribute map
-
void FetchTransform(double **matrix)#
Populate the provided pointer to float array with this mesh’s transform matrix. Requires to have called RequestTransform during the describe action
-
MfxAttribute GetAttributeByIndex(int index)#
Get an attribute of an input or output mesh by index. The returned MfxAttribute can be used to get the data buffer and extra information like type, component count, stride, etc. If the index is out of range, this throws a MfxSuiteException.
-
MfxAttribute GetAttribute(MfxAttributeAttachment attachment, const char *name)#
Get an attribute of an input or output mesh by attachment and name. The returned MfxAttribute can be used to get the data buffer and extra information like type, component count, stride, etc.
Get*Attribute
methods are shortcuts for the different values allowed for theattachment
argument. If the queried attribute does not exist, this throws a MfxSuiteException, you can use HasAttribute to avoid throwing this exception.
-
MfxAttribute GetPointAttribute(const char *name)#
Specialization of GetAttribute for point attributes.
-
MfxAttribute GetCornerAttribute(const char *name)#
Specialization of GetAttribute for corner attributes.
-
MfxAttribute GetFaceAttribute(const char *name)#
Specialization of GetAttribute for face attributes.
-
MfxAttribute GetMeshAttribute(const char *name)#
Specialization of GetAttribute for global mesh attributes.
-
bool HasAttribute(MfxAttributeAttachment attachment, const char *name)#
Tells whether an attribute exists in the input or output mesh.
Has*Attribute
methods are shortcuts for the different values allowed for theattachment
argument.
-
bool HasPointAttribute(const char *name)#
Specialization of HasAttribute for point attributes.
-
bool HasCornerAttribute(const char *name)#
Specialization of HasAttribute for corner attributes.
-
bool HasFaceAttribute(const char *name)#
Specialization of HasAttribute for face attributes.
-
bool HasMeshAttribute(const char *name)#
Specialization of HasAttribute for global mesh attributes.
-
void Release()#
Always call this at some point, don’t use the object afterwise. (This is not in the dtor because there may be copies of the instance but Release must be called only once)
-
MfxAttribute AddAttribute(MfxAttributeAttachment attachment, const char *name, int componentCount, MfxAttributeType type, MfxAttributeSemantic semantic = MfxAttributeSemantic::None)#
Define a new attribute on an output mesh. The returned MfxAttribute can be used to set additionnal properties such has whether the data is “owned” or borrowed/forwarded from an input.
Add*Attribute
methods are shortcuts for the different values allowed for theattachment
argument.Call
only for output meshes and before allocation.- See
attributeDefine from ofxMeshEffect.h for more information.
-
MfxAttribute AddPointAttribute(const char *name, int componentCount, MfxAttributeType type, MfxAttributeSemantic semantic = MfxAttributeSemantic::None)#
Specialization of AddAttribute for point attributes.
-
MfxAttribute AddCornerAttribute(const char *name, int componentCount, MfxAttributeType type, MfxAttributeSemantic semantic = MfxAttributeSemantic::None)#
Specialization of AddAttribute for corner attributes.
-
MfxAttribute AddFaceAttribute(const char *name, int componentCount, MfxAttributeType type, MfxAttributeSemantic semantic = MfxAttributeSemantic::None)#
Specialization of AddAttribute for face attributes.
-
MfxAttribute AddMeshAttribute(const char *name, int componentCount, MfxAttributeType type, MfxAttributeSemantic semantic = MfxAttributeSemantic::None)#
Specialization of AddAttribute for global mesh attributes.
-
void Allocate(int pointCount, int cornerCount, int faceCount, bool noLooseEdge = true, int constantFaceSize = -1)#
Allocate memory for new owned attributes according to the previously called AddAttribute and likes. Non own attributes are attributes pointing to externally allocated memory (for instance memory buffers forwarded from the input) and will hence not be newly allocate. Call only for output meshes.
-
void Allocate(const MfxMeshProps &props)#
Alternatively, Allocate() can be called with a MfxMeshProps struct, which contains the same counters.
-
bool IsValid() const#