GeometryAttribute (interface)

Interface required on an attribute in order to be contained in a GeometryAttributes container.

The GeometryAttribute interface contains the methods required by the GeometryAttributes container for managing the attribute values. By abstracting the attribute content, Geometry types can resize, duplicate or compare values without having a specific knowledge of the various attribute types. For example, this allows the PolygonMesh to manage attribute sharing, and it allows the GetAttributeAtLocation helper function to interpolate surface attribute values.

While various type implementations are provided, such as Vec3Attribute and ColorAttribute, this interface allows to add other custom attribute types to a GeometryAttributes container.

The GeometryAttribute requires specific data to be stored along the attribute values, such as a name, version and containerIndex.

注釈

The attribute version has to be incremented after any modification(s) to the attribute values. See Attribute versioning for more information.

GeometryAttribute GeometryAttribute GeometryAttribute BaseAttribute BaseAttribute BaseAttribute->GeometryAttribute ColorAttribute ColorAttribute ColorAttribute->BaseAttribute IntegerAttribute IntegerAttribute IntegerAttribute->BaseAttribute Mat33Attribute Mat33Attribute Mat33Attribute->BaseAttribute Mat44Attribute Mat44Attribute Mat44Attribute->BaseAttribute QuatAttribute QuatAttribute QuatAttribute->BaseAttribute RGBAAttribute RGBAAttribute RGBAAttribute->BaseAttribute RGBAttribute RGBAttribute RGBAttribute->BaseAttribute ScalarAttribute ScalarAttribute ScalarAttribute->BaseAttribute ScalarConstantArrayAttribute ScalarConstantArrayAttribute ScalarConstantArrayAttribute->BaseAttribute SkinningAttribute SkinningAttribute SkinningAttribute->BaseAttribute UInt16ConstantArrayAttribute UInt16ConstantArrayAttribute UInt16ConstantArrayAttribute->BaseAttribute UInt32Attribute UInt32Attribute UInt32Attribute->BaseAttribute Vec2Attribute Vec2Attribute Vec2Attribute->BaseAttribute Vec3Attribute Vec3Attribute Vec3Attribute->BaseAttribute Vec3_dAttribute Vec3_dAttribute Vec3_dAttribute->BaseAttribute Vec4Attribute Vec4Attribute Vec4Attribute->BaseAttribute

Functions

Boolean checkConsistency ? ()
  convertToCPU ! ()
  convertToGPU ! ()
  copyFrom ! ( in Ref<Object> otherAttr )
  copyValue ! ( in Ref<Object> sourceAttr, in Size sourceIndex, in Size targetIndex )
  copyValue ! ( in Size sourceIndex, in Size targetIndex )
Data data ? ()
Boolean equalValues ? ( in Size index1, in Size index2 )
String getDesc ? ( in Boolean useUnitTestPrint )
String getDesc ? ()
UInt32 getElementsMemType ? ()
String getName ? ()
Size getScalarValueSize ? ()
UInt32 getVersion ? ()
  incrementVersion ! ()
  linearCombine ! ( in Ref<Object> sourceAttr, in LocalL16UInt32Array sourceIndices, in LocalL16ScalarArray sourceWeights, in Size targetIndex )
  resize ! ( in Size count )
  setFromScalar ! ( in Size index, in LocalL16ScalarArray value )
Size size ? ()
String truncateDecimalsPrint ? ( in Size index, in UInt32 n )
String unitTestPrint ? ( in Size index )
String valueDesc ? ( in Size index )

Functions in detail

Boolean GeometryAttribute.checkConsistency? ()

バージョン 2.4.0 で追加.

Checks the attribute data consistency.


GeometryAttribute.convertToCPU! ()


GeometryAttribute.convertToGPU! ()


GeometryAttribute.copyFrom! ( in Ref<Object> otherAttr )

Sets the whole content of the attribute from the other attribute. The other attribute will be of the same type.


GeometryAttribute.copyValue! ( in Ref<Object> sourceAttr, in Size sourceIndex, in Size targetIndex )

Replaces the value located at targetIndex with source attribute’s value located at sourceIndex. The source attribute will be of the same type.


GeometryAttribute.copyValue! ( in Size sourceIndex, in Size targetIndex )

Replaces the value located at targetIndex with the value located at sourceIndex


Data GeometryAttribute.data? ()

Returns a raw pointer to contiguous attribute data, if applicable, and an uninitialized Data otherwise.


Boolean GeometryAttribute.equalValues? ( in Size index1, in Size index2 )

Return true if two values are logically equal.


String GeometryAttribute.getDesc? ( in Boolean useUnitTestPrint )

Returns a description of the attribute, including all values.

useUnitTestPrint If true, returns a numerically stable version which is unit test output friendly.


String GeometryAttribute.getDesc? ()

Returns a description of the attribute, including all values.


UInt32 GeometryAttribute.getElementsMemType? ()


String GeometryAttribute.getName? ()

Returns the name of the attribute.


Size GeometryAttribute.getScalarValueSize? ()

If all attribute values can be expressed as a constant Scalar array, returns the constant number of elements, 0 otherwise.


UInt32 GeometryAttribute.getVersion? ()

Returns the attribute values version. See Attribute versioning for more information.


GeometryAttribute.incrementVersion! ()

Increment attribute values’ version.

This must be called after value(s) have been modified. For better performance, it can be called only after all changes are finished. See Attribute versioning for more information.


GeometryAttribute.linearCombine! ( in Ref<Object> sourceAttr, in LocalL16UInt32Array sourceIndices, in LocalL16ScalarArray sourceWeights, in Size targetIndex )

Sets the value located at targetIndex as a linear combination of other values.

source The attribute for source values
sourceIndices The array of source indices, relatively to the source attribute.
sourceWeights The array of source weights, which need to correspond to each sourceIndices. Normally the sum of the weights should be 1.0.
targetIndex The target value index.


GeometryAttribute.resize! ( in Size count )

Resizes the attribute array.


GeometryAttribute.setFromScalar! ( in Size index, in LocalL16ScalarArray value )

If applicable, sets an attribute value from an array of Scalars. This array must have a size of GeometryAttribute.getScalarValueSize .


Size GeometryAttribute.size? ()

Returns the size of the attribute array.


String GeometryAttribute.truncateDecimalsPrint? ( in Size index, in UInt32 n )

Returns a description of the value, keeping the first n decimals (Float32 or Float64 based values).


String GeometryAttribute.unitTestPrint? ( in Size index )

Returns a numerically stable description of the value


String GeometryAttribute.valueDesc? ( in Size index )

Returns a description of the value