FieldOutputBlock Struct Reference

#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.

公共成员函数

  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  重置 ()
MAXON_ATTRIBUTE_FORCE_INLINE Int   GetCount () const
Int   GetFullCount () const
MAXON_ATTRIBUTE_FORCE_INLINE Int   GetOffset () const
const MAXON_ATTRIBUTE_FORCE_INLINE 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 < 向量 _color
maxon::Block < 向量 _direction
maxon::Block < 向量 _rotation
maxon::Block < 向量 _pivot
maxon::Block < Bool _deactivated

私有成员函数

  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

构造函数 & 析构函数文档编制

◆  FieldOutputBlock() [1/2]

FieldOutputBlock ( )
default

Creates and empty sampling block, with not data.

◆  FieldOutputBlock() [2/2]

FieldOutputBlock ( FieldOutputBlock &&  moveRef )
default

Move construction. Does not actually steal anything as FieldOutputBlock never owns the memory.

参数
[in] moveRef The source sample.

成员函数文档编制

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( FieldOutputBlock   )

◆  GetSubBlock()

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.
返回
The sub block.

◆  Reset()

void Reset ( )

Resets the FieldOutputBlock to default state (i.e. null count, no owner, no data, empty).

◆  GetCount()

MAXON_ATTRIBUTE_FORCE_INLINE Int GetCount ( ) const

Gets the number of elements in the sub block.

返回
The count.

◆  GetFullCount()

Int GetFullCount ( ) const

Gets the number of elements used in the owning FieldOutput .

返回
The count.

◆  GetOffset()

MAXON_ATTRIBUTE_FORCE_INLINE Int GetOffset ( ) const

Gets the offset of the sub block in the FieldOutput .

返回
The offset.

◆  GetOwner()

const MAXON_ATTRIBUTE_FORCE_INLINE FieldOutput * GetOwner ( ) const

Returns the owner FieldOutput .

◆  CopyFrom()

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.

◆  CopyArrayContentFrom()

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.
返回
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()

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.

返回
The crc.

◆  IsValid()

Bool IsValid ( ) const

Checks if the FieldOutputBlock allocations and sizes are valid (empty is considered valid).

◆  IsPopulated()

Bool IsPopulated ( ) const

Checks if the FieldOutputBlock is valid and non-empty.

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( FieldOutputBlock   )
private

Friends And Related Function Documentation

◆  FieldOutput::GetBlock

FieldOutputBlock FieldOutput::GetBlock ( ) const
friend

◆  FieldOutput::GetSubBlock

maxon::Result < FieldOutputBlock > FieldOutput::GetSubBlock ( Int   offset ,
Int   blockSize  
) const
friend

Member Data Documentation

◆  _value

maxon::Block < Float > _value

◆  _alpha

maxon::Block < Float > _alpha

The weight value at this point in space.

◆  _color

maxon::Block < 向量 > _color

The alpha value for color and direction at this point in space, only available when color or direction are allocated.

◆  _direction

maxon::Block < 向量 > _direction

The color at this point in space.

◆  _rotation

maxon::Block < 向量 > _rotation

The slope at this point in space.

◆  _pivot

maxon::Block < 向量 > _pivot

The rotational velocity (axle + magnitude)

◆  _deactivated

maxon::Block < Bool > _deactivated

The rotational pivot point in space.

◆  _count

Int _count
private

The deactivated state for this point (i.e. cut from interior shape will be true) this skips remapping.

◆  _offset

Int _offset
private

The number of elements in the sample arrays.

◆  _owner

const FieldOutput * _owner
private

Data offset in the original arrays (owner).