#include <c4d_fielddata.h>
The full result from sampling a field. Struct own the sampled data if it is not a sub block of the full sample. FieldOutput used as subblock don't own the memory and don't carry a ref count on the allocated memory, hence the real block must stay valid during the use of a subblock.
Static Public Member Functions | |
static maxon::Result< FieldOutput * > | Alloc (Int size, FIELDSAMPLE_FLAG flags=FIELDSAMPLE_FLAG::ALL) |
static void | Free (FieldOutput *&p) |
static maxon::Result< FieldOutput > | Create (Int size, FIELDSAMPLE_FLAG flags=FIELDSAMPLE_FLAG::ALL) |
static maxon::Result< FieldOutput > | Create (FieldOutputBlock &src) |
Public Attributes | |
maxon::BaseArray< Float > | _value |
maxon::BaseArray< Float > | _alpha |
maxon::BaseArray< Vector > | _color |
maxon::BaseArray< Vector > | _direction |
maxon::BaseArray< Vector > | _rotation |
maxon::BaseArray< Vector > | _pivot |
maxon::BaseArray< Bool > | _deactivated |
Private Member Functions | |
MAXON_DISALLOW_COPY_AND_ASSIGN (FieldOutput) | |
Private Attributes | |
Int | _count |
|
default |
Creates and empty sample.
FieldOutput | ( | FieldOutput && | moveRef | ) |
Move construction. Takes ownership of the sample memory.
[in] | moveRef | The source sample. |
~FieldOutput | ( | ) |
Frees sample memory if not a sub block.
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | FieldOutput | ) |
operator FieldOutputBlock | ( | ) | const |
Casting operator, equivalent to GetBlock().
FieldOutputBlock GetBlock | ( | ) | const |
Gets the total arrays in a FieldOutputBlock.
maxon::Result<FieldOutputBlock> GetSubBlock | ( | Int | offset, |
Int | blockSize = FIELD_EXECUTION_BLOCK_SIZE |
||
) | const |
Gets a sub-section of the total arrays.
[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 FieldOutput to an empty state. All memory will be deallocated.
void Flush | ( | ) |
Flush the FieldOutput content, keeping the arrays allocated for future resize.
Int GetCount | ( | ) | const |
Gets the number of elements in the FieldOutput
Bool IsValid | ( | ) | const |
Checks if the FieldOutput allocations and sizes are valid (empty FieldOutput is considered valid).
Bool IsPopulated | ( | ) | const |
Checks if the FieldOutput is valid and non-empty.
Bool IsEqual | ( | const FieldOutput & | comp | ) | const |
Compares the content of both FieldOutput. Count and array content must be the same.
[in] | comp | Source for the comparison. |
maxon::Result<void> CopyFrom | ( | const FieldOutput & | src | ) |
Copies from the FieldOutput described by src. Performs a deep copy.
[in] | src | Source for the duplication. |
maxon::Result<void> CopyArrayContentFrom | ( | const FieldOutput & | src | ) |
Copies from the FieldOutput array content from src. Size and flags will not be affected by this action. Source data content will be copied into target up to current size. If target is bigger than source, the remaining items are cleared.
[in] | src | Source for the duplication. |
maxon::Result<void> CopyArrayContentFrom | ( | const FieldOutputBlock & | src | ) |
Copies from the FieldOutput array content from src. Size and flags will not be affected by this action. Source data content will be copied into target up to current size. If target is bigger than source, the remaining items are cleared.
[in] | src | Source for the duplication. |
maxon::Result<void> Resize | ( | Int | newSize, |
FIELDSAMPLE_FLAG | sampleFlags = FIELDSAMPLE_FLAG::ALL , |
||
maxon::COLLECTION_RESIZE_FLAGS | resizeFlags = maxon::COLLECTION_RESIZE_FLAGS::DEFAULT |
||
) |
Resizes the arrays held in the FieldOutput. Unspecified channel arrays will be resized to 0 length (according to resizeFlags).
[in] | newSize | The size that the arrays should become. |
[in] | sampleFlags | The channels to sample. |
[in] | resizeFlags | The flags for which channels should be resized. |
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.
|
static |
Allocate a heap FieldOutput with all specified sampling arrays. Equivalent of calling empty constructor followed by Resize. Use FieldOutputRef to have a scoped or auto deleted FieldOutput.
[in] | size | The size. |
[in] | flags | The flags. |
|
static |
Frees the given FieldOutput and all internal allocations.
[in] | p | The FieldOutput to free. |
|
static |
Create a FieldOutput with all specified sampling arrays. Same as Alloc, but on the stack. Equivalent of calling empty constructor followed by Resize.
[in] | size | The size. |
[in] | flags | The flags. |
|
static |
Create a FieldOutput with all specified sampling arrays. Size will be fetched from the source FieldOutput. Array content will be copied from source FieldOutput. Equivalent of calling empty constructor followed by CopyFrom.
[in] | src | The source FieldOutput. |
|
private |
maxon::BaseArray<Float> _value |
maxon::BaseArray<Float> _alpha |
The weight value at this point in space.
maxon::BaseArray<Vector> _color |
The alpha value for color and direction at this point in space, only available when color or direction are allocated.
maxon::BaseArray<Vector> _direction |
The color at this point in space.
maxon::BaseArray<Vector> _rotation |
The direction at this point in space.
maxon::BaseArray<Vector> _pivot |
The rotational velocity (axle + magnitude)
maxon::BaseArray<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.