#include <c4d_fielddata.h>
FieldOutput sub block class. FieldOutputBlock never own the memory of the sampling arrays, it is owned by the FieldOutput structure. Lifetime of a block is the same as its owner. Resizing, resetting the owner, or any other operation that will have the owner reallocate or deallocate memory will invalidate the blocks.
Public Member Functions | |
FieldOutputBlock ()=default | |
FieldOutputBlock (FieldOutputBlock &&moveRef)=default | |
MAXON_OPERATOR_MOVE_ASSIGNMENT (FieldOutputBlock) | |
maxon::Result< FieldOutputBlock > | GetSubBlock (Int offset, Int blockSize=FIELD_EXECUTION_BLOCK_SIZE) const |
void | Reset () |
MAXON_ATTRIBUTE_FORCE_INLINE Int | GetCount () const |
Int | GetFullCount () const |
MAXON_ATTRIBUTE_FORCE_INLINE Int | GetOffset () const |
MAXON_ATTRIBUTE_FORCE_INLINE const FieldOutput * | GetOwner () const |
void | CopyFrom (const FieldOutputBlock &src) |
maxon::Result< void > | CopyArrayContentFrom (const FieldOutputBlock &src) |
void | ClearMemory (Bool deactivatedOnly=true, Bool deactivatedState=false) |
void | ClearMemory (Int startIdx, Int count, Bool deactivatedOnly, Bool deactivatedState) |
void | ClearDeactivated (Bool state=false) |
UInt32 | CalculateCrc () const |
Bool | IsValid () const |
Bool | IsPopulated () const |
Public Attributes | |
maxon::Block< Float > | _value |
maxon::Block< Float > | _alpha |
maxon::Block< Vector > | _color |
maxon::Block< Vector > | _direction |
maxon::Block< Vector > | _rotation |
maxon::Block< Vector > | _pivot |
maxon::Block< Bool > | _deactivated |
Private Member Functions | |
MAXON_DISALLOW_COPY_AND_ASSIGN (FieldOutputBlock) | |
Private Attributes | |
Int | _count |
Int | _offset |
const FieldOutput * | _owner |
Friends | |
FieldOutputBlock | FieldOutput::GetBlock () const |
maxon::Result< FieldOutputBlock > | FieldOutput::GetSubBlock (Int offset, Int blockSize) const |
|
default |
Creates and empty sampling block, with not data.
|
default |
Move construction. Does not actually steal anything as FieldOutputBlock never owns the memory.
[in] | moveRef | The source sample. |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | FieldOutputBlock | ) |
maxon::Result<FieldOutputBlock> GetSubBlock | ( | Int | offset, |
Int | blockSize = FIELD_EXECUTION_BLOCK_SIZE |
||
) | const |
Gets a sub-section of "this" which can be indexed from 0 to "blockSize".
[in] | offset | The offset index to retrieve a sub-block starting at. |
[in] | blockSize | Suggested size of the block, will be clamped against the maximum number of entries. |
void Reset | ( | ) |
Resets the FieldOutputBlock to default state (i.e. null count, no owner, no data, empty).
MAXON_ATTRIBUTE_FORCE_INLINE Int GetCount | ( | ) | const |
Gets the number of elements in the sub block.
Int GetFullCount | ( | ) | const |
Gets the number of elements used in the owning FieldOutput.
MAXON_ATTRIBUTE_FORCE_INLINE Int GetOffset | ( | ) | const |
Gets the offset of the sub block in the FieldOutput.
MAXON_ATTRIBUTE_FORCE_INLINE const FieldOutput* GetOwner | ( | ) | const |
Returns the owner FieldOutput.
void CopyFrom | ( | const FieldOutputBlock & | src | ) |
Copies from the FieldOutputBlock described by src. Note that FieldOutputBlock never owns the arrays, so the copy only copies the raw pointers.
[in] | src | Source for the duplication. |
maxon::Result<void> CopyArrayContentFrom | ( | const FieldOutputBlock & | src | ) |
Copies from the FieldOutput array content from src. Block size and flags will not be affected by this action. The destination allocated size must be big enough to accept the full content of the src block. Destination block will own memory if it is a normal block or not own it if it is a subblock.
[in] | src | Source for the duplication. |
Reset the sample's data to default values, optionally only the deactivated content too. Values are reset to 0, colors to 1.0, direction to 0, deactivated to 0.
[in] | deactivatedOnly | True to deactivated only. |
[in] | deactivatedState | (Optional) The state the deactivated should be cleared to |
Reset the sample's data to default values, optionally only the deactivated content too. Values are reset to 0, colors to 1.0, direction to 0, deactivated to 0.
[in] | startIdx | Array clear start index. |
[in] | count | Number of array items to reset to default value. |
[in] | deactivatedOnly | True to deactivated only. |
[in] | deactivatedState | (Optional) The state the deactivated should be cleared to |
void ClearDeactivated | ( | Bool | state = false | ) |
Clears the deactivated array.
UInt32 CalculateCrc | ( | ) | const |
Calculates a crc on all internal data using maxon::Crc32C. Crc is not kept internally and will be calculated from scratch on each CalculateCrc call.
Bool IsValid | ( | ) | const |
Checks if the FieldOutputBlock allocations and sizes are valid (empty is considered valid).
Bool IsPopulated | ( | ) | const |
Checks if the FieldOutputBlock is valid and non-empty.
|
private |
|
friend |
|
friend |
maxon::Block<Float> _value |
maxon::Block<Float> _alpha |
The weight value at this point in space.
maxon::Block<Vector> _color |
The alpha value for color and direction at this point in space, only available when color or direction are allocated.
maxon::Block<Vector> _direction |
The color at this point in space.
maxon::Block<Vector> _rotation |
The slope at this point in space.
maxon::Block<Vector> _pivot |
The rotational velocity (axle + magnitude)
maxon::Block<Bool> _deactivated |
The rotational pivot point in space.
|
private |
The deactivated state for this point (i.e. cut from interior shape will be true) this skips remapping.
|
private |
The number of elements in the sample arrays.
|
private |
Data offset in the original arrays (owner).