FieldInput Struct Reference

#include <c4d_fielddata.h>

详细描述

The structure holding the arrays of points and optionally their directions to be sampled. Caller owns the pointed data and must ensure they are valid. FieldInput will not deallocate the data under any circumstance.

公共成员函数

  FieldInput ()=default
  FieldInput (const 向量 &pos, 矩阵 transform= 矩阵 ())
  FieldInput (const 向量 *pos, Int allocatedCount, 矩阵 transform= 矩阵 (), Int fullCount=0)
  FieldInput (const 向量 &pos, const 向量 &dir, 矩阵 transform= 矩阵 ())
  FieldInput (const 向量 *pos, const 向量 *dir, Int allocatedCount, 矩阵 transform= 矩阵 (), Int fullCount=0)
  FieldInput (const 向量 &pos, const 向量 &dir, const 向量 &uvw, 矩阵 transform= 矩阵 ())
  FieldInput (const 向量 *pos, const 向量 *dir, const 向量 *uvw, Int allocatedCount, 矩阵 transform= 矩阵 (), Int fullCount=0)
  FieldInput (const 向量 *pos, const maxon::Block < const 向量 > &dir, const maxon::Block < const 向量 > &uvw, Int allocatedCount, 矩阵 transform= 矩阵 (), Int fullCount=0)
  FieldInput (const maxon::Block < const 向量 > &pos, const maxon::Block < const 向量 > &dir, const maxon::Block < const 向量 > &uvw, Int allocatedCount, 矩阵 transform= 矩阵 (), Int fullCount=0)
  ~FieldInput ()=default
  FieldInput (const FieldInput &src)
  FieldInput ( FieldInput &&src)
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( FieldInput )
  MAXON_OPERATOR_COPY_ASSIGNMENT ( FieldInput )
void  CopyFromRaw (const FieldInput &src)
FieldInput   GetSubBlock ( Int offset, Int blockSize= FIELD_EXECUTION_BLOCK_SIZE ) const
Int   GetCount () const
Int   GetOffset () const
Bool   IsValid () const
Bool   IsPopulated () const

Public Attributes

maxon::Block < const 向量 _position
maxon::Block < const 向量 _direction
maxon::Block < const 向量 _uvw
Int   _blockCount
Int   _blockOffset
Int   _fullArraySize
矩阵   _transform

Private Attributes

Int   _allocatedArraySize

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

◆  FieldInput() [1/11]

FieldInput ( )
default

◆  FieldInput() [2/11]

FieldInput ( const 向量 pos ,
矩阵   transform = Matrix()  
)

Constructor with single position value

参数
[in] pos The position.
[in] transform (Optional) The transform matrix required to convert the position and direction inputs to global space.

◆  FieldInput() [3/11]

FieldInput ( const 向量 pos ,
Int   allocatedCount ,
矩阵   transform = Matrix() ,
Int   fullCount = 0  
)

Constructor with position data only.

参数
[in] pos The position array to sample.
[in] allocatedCount The allocated length of the pos array.
[in] transform The transform matrix required to convert the position and direction inputs to global space.
[in] fullCount The full position count if count was to big to allocate in pos. Will be allocatedCount unless specified otherwise.

◆  FieldInput() [4/11]

FieldInput ( const 向量 pos ,
const 向量 dir ,
矩阵   transform = Matrix()  
)

Constructor with single position and direction

参数
[in] pos The position.
[in] dir The direction that the sample is facing in space.
[in] transform (Optional) The transform matrix required to convert the position and direction inputs to global space.

◆  FieldInput() [5/11]

FieldInput ( const 向量 pos ,
const 向量 dir ,
Int   allocatedCount ,
矩阵   transform = Matrix() ,
Int   fullCount = 0  
)

Constructor with position and direction data.

参数
[in] pos The position array to sample.
[in] dir The direction array to sample.
[in] allocatedCount The allocated length of the pos and dir arrays.
[in] transform The transform matrix required to convert the position and direction inputs to global space.
[in] fullCount The full position count if count was to big to allocate in pos. Will be allocatedCount unless specified otherwise.

◆  FieldInput() [6/11]

FieldInput ( const 向量 pos ,
const 向量 dir ,
const 向量 uvw ,
矩阵   transform = Matrix()  
)

Constructor with single position, direction and UVW entry

参数
[in] pos The position array to sample.
[in] dir The direction array to sample.
[in] uvw The uvw array to sample.
[in] transform The transform matrix required to convert the position and direction inputs to global space.

◆  FieldInput() [7/11]

FieldInput ( const 向量 pos ,
const 向量 dir ,
const 向量 uvw ,
Int   allocatedCount ,
矩阵   transform = Matrix() ,
Int   fullCount = 0  
)

Constructor with position, direction and uvw data.

参数
[in] pos The position array to sample.
[in] dir The direction array to sample.
[in] uvw The uvw array to sample.
[in] allocatedCount The allocated length of the pos and dir arrays.
[in] transform The transform matrix required to convert the position and direction inputs to global space.
[in] fullCount (optional) The full position count if count was to big to allocate in pos. Will be allocatedCount unless specified otherwise.

◆  FieldInput() [8/11]

FieldInput ( const 向量 pos ,
const maxon::Block < const 向量 > &  dir ,
const maxon::Block < const 向量 > &  uvw ,
Int   allocatedCount ,
矩阵   transform = Matrix() ,
Int   fullCount = 0  
)

Constructor with position, direction and uvw data.

参数
[in] pos The position array to sample.
[in] dir The direction array to sample.
[in] uvw The uvw array to sample.
[in] allocatedCount The allocated length of the pos and dir arrays.
[in] transform The transform matrix required to convert the position and direction inputs to global space.
[in] fullCount (optional) The full position count if count was to big to allocate in pos. Will be allocatedCount unless specified otherwise.

◆  FieldInput() [9/11]

FieldInput ( const maxon::Block < const 向量 > &  pos ,
const maxon::Block < const 向量 > &  dir ,
const maxon::Block < const 向量 > &  uvw ,
Int   allocatedCount ,
矩阵   transform = Matrix() ,
Int   fullCount = 0  
)

Constructor with position, direction and uvw data.

参数
[in] pos The position array to sample.
[in] dir The direction array to sample.
[in] uvw The uvw array to sample.
[in] allocatedCount The allocated length of the pos and dir arrays.
[in] transform The transform matrix required to convert the position and direction inputs to global space.
[in] fullCount (optional) The full position count if count was to big to allocate in pos. Will be allocatedCount unless specified otherwise.

◆  ~FieldInput()

~ FieldInput ( )
default

Destructor. FieldInput owns no memory.

◆  FieldInput() [10/11]

FieldInput ( const FieldInput src )

Copy constructor NOTE: This performs a dumb raw copy of the FieldInput instance. I.e. internal pointers will be copied and point to the content of the original owner. Field point never owns the data, this is why a standard CopyFrom is not part of this class.

参数
[in] src Copy source.

◆  FieldInput() [11/11]

FieldInput ( FieldInput &&  src )

Move constructor

参数
[in] src Move source.

成员函数文档编制

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( FieldInput   )

◆  MAXON_OPERATOR_COPY_ASSIGNMENT()

MAXON_OPERATOR_COPY_ASSIGNMENT ( FieldInput   )

◆  CopyFromRaw()

void CopyFromRaw ( const FieldInput src )

Performs a raw copy of the the FieldInput described by src. Equivalent to copy construction. NOTE: this is not a CopyFrom, see copy constructor note above.

参数
[in] src Source for the duplication.

◆  GetSubBlock()

FieldInput GetSubBlock ( Int   offset ,
Int   blockSize = FIELD_EXECUTION_BLOCK_SIZE  
) const

Return a FieldInput struct for a subset of the original array. This can be used to pass smaller blocks to the field processing threads.

参数
[in] offset The subblock start offset in the full array (0 based).
[in] blockSize The size of the desired subblock.
返回
The sub FieldInput structure. Will be empty if request is out of bounds.

◆  GetCount()

Int GetCount ( ) const

Gets the number of elements in the FieldInput

返回
The count.

◆  GetOffset()

Int GetOffset ( ) const

Gets the offset of the first element in the full arrays.

返回
The offset.

◆  IsValid()

Bool IsValid ( ) const

Checks if the FieldInput allocations and sizes are valid. Empty FieldInput is considered valid.

◆  IsPopulated()

Bool IsPopulated ( ) const

Checks if the FieldInput is valid and non-empty.

Member Data Documentation

◆  _position

maxon::Block <const 向量 > _position

The position values for the array of points, if this is a sub-block then element 0 is at _blockOffset within the larger array, caller owns this array, size must match or be greater than count value @required.

◆  _direction

maxon::Block <const 向量 > _direction

The (optional) direction values for the array of points, if this is a sub-block then element 0 is at _blockOffset within the larger array, caller owns this array, size must match or be greater than count value.

◆  _uvw

maxon::Block <const 向量 > _uvw

The (optional) uvw values for the array of points, if this is a sub-block then element 0 is at _blockOffset within the larger array, caller owns this array, size must match or be greater than count value.

◆  _blockCount

Int _blockCount

The number of elements in the array to be processed (for this processing block, this should be treated as the count to use when iterating over elements in FieldObject and FieldLayer .

◆  _blockOffset

Int _blockOffset

The offset (starting point) of the elements if a portion of a larger array, used e.g. to get the actual index in the array actualIndex = index - points._blockOffset;.

◆  _fullArraySize

Int _fullArraySize

The full size of the source data, this may be larger than blockCount, also might be larger then the size of the allocated pointers within the FieldInput class. Do no use this size to browse the arrays!

◆  _transform

矩阵 _transform

The transform matrix for the points in the input block, use this to bring the _position and _direction arrays into world space or the local space of your FieldObject .

◆  _allocatedArraySize

Int _allocatedArraySize
private

The allocated size of the vector arrays. Use this with _blockOffset to browse all the input vectors safely. Might be larger than blockCount.