-
首页
-
C4D R23.110 C++ SDK
FieldOutput Struct Reference
#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.
构造函数 & 析构函数文档编制
◆
FieldOutput()
[1/2]
Creates and empty sample.
◆
FieldOutput()
[2/2]
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()
◆
operator FieldOutputBlock()
Casting operator, equivalent to
GetBlock()
.
-
返回
-
A sub block for the whole
FieldOutput
.
◆
GetBlock()
Gets the total arrays in a
FieldOutputBlock
.
-
返回
-
A sub block for the whole
FieldOutput
.
◆
GetSubBlock()
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.
|
-
返回
-
The sub block.
◆
Reset()
Resets the
FieldOutput
to an empty state. All memory will be deallocated.
◆
Flush()
Flush the
FieldOutput
content, keeping the arrays allocated for future resize.
◆
GetCount()
Gets the number of elements in the
FieldOutput
-
返回
-
The count.
◆
IsValid()
Checks if the
FieldOutput
allocations and sizes are valid (empty
FieldOutput
is considered valid).
◆
IsPopulated()
Bool
IsPopulated
|
(
|
|
)
|
const
|
Checks if the
FieldOutput
is valid and non-empty.
◆
IsEqual()
Compares the content of both
FieldOutput
. Count and array content must be the same.
-
参数
-
[in]
|
comp
|
Source for the comparison.
|
-
返回
-
True if equal.
◆
CopyFrom()
Copies from the
FieldOutput
described by src. Performs a deep copy.
-
参数
-
[in]
|
src
|
Source for the duplication.
|
-
返回
-
OK on success.
◆
CopyArrayContentFrom()
[1/2]
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.
|
-
返回
-
OK on success.
◆
CopyArrayContentFrom()
[2/2]
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.
|
-
返回
-
OK on success.
◆
Resize()
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.
|
-
返回
-
OK on success.
◆
ClearMemory()
[1/2]
void ClearMemory
|
(
|
Bool
|
deactivatedOnly
=
true
,
|
|
|
Bool
|
deactivatedState
=
false
|
|
)
|
|
|
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
|
◆
ClearMemory()
[2/2]
void ClearMemory
|
(
|
Int
|
startIdx
,
|
|
|
Int
|
count
,
|
|
|
Bool
|
deactivatedOnly
,
|
|
|
Bool
|
deactivatedState
|
|
)
|
|
|
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
|
◆
ClearDeactivated()
void ClearDeactivated
|
(
|
Bool
|
state
=
false
|
)
|
|
Clears the deactivated array.
◆
CalculateCrc()
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.
-
返回
-
The crc.
◆
Alloc()
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.
|
-
返回
-
A MemoryError if it fails, else a FieldOutput*.
◆
Free()
Frees the given
FieldOutput
and all internal allocations.
-
参数
-
◆
Create()
[1/2]
创建
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.
|
-
返回
-
The resulting
FieldOutput
.
◆
Create()
[2/2]
创建
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.
-
参数
-
-
返回
-
The resulting
FieldOutput
.
◆
MAXON_DISALLOW_COPY_AND_ASSIGN()
Member Data Documentation
◆
_value
◆
_alpha
The weight value at this point in space.
◆
_color
The alpha value for color and direction at this point in space, only available when color or direction are allocated.
◆
_direction
The color at this point in space.
◆
_rotation
The direction at this point in space.
◆
_pivot
The rotational velocity (axle + magnitude)
◆
_deactivated
The rotational pivot point in space.
◆
_count
The deactivated state for this point (i.e. cut from interior shape will be true) this skips remapping.