#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.
Public Member Functions | |
FieldInput ()=default | |
FieldInput (const Vector &pos, Matrix transform=Matrix()) | |
FieldInput (const Vector *pos, Int allocatedCount, Matrix transform=Matrix(), Int fullCount=0) | |
FieldInput (const Vector &pos, const Vector &dir, Matrix transform=Matrix()) | |
FieldInput (const Vector *pos, const Vector *dir, Int allocatedCount, Matrix transform=Matrix(), Int fullCount=0) | |
FieldInput (const Vector &pos, const Vector &dir, const Vector &uvw, Matrix transform=Matrix()) | |
FieldInput (const Vector *pos, const Vector *dir, const Vector *uvw, Int allocatedCount, Matrix transform=Matrix(), Int fullCount=0) | |
FieldInput (const Vector *pos, const maxon::Block< const Vector > &dir, const maxon::Block< const Vector > &uvw, Int allocatedCount, Matrix transform=Matrix(), Int fullCount=0) | |
FieldInput (const maxon::Block< const Vector > &pos, const maxon::Block< const Vector > &dir, const maxon::Block< const Vector > &uvw, Int allocatedCount, Matrix transform=Matrix(), 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 Vector > | _position |
maxon::Block< const Vector > | _direction |
maxon::Block< const Vector > | _uvw |
Int | _blockCount |
Int | _blockOffset |
Int | _fullArraySize |
Matrix | _transform |
Private Attributes | |
Int | _allocatedArraySize |
|
default |
FieldInput | ( | const Vector & | pos, |
Matrix | 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 | ( | const Vector * | pos, |
Int | allocatedCount, | ||
Matrix | 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 | ( | const Vector & | pos, |
const Vector & | dir, | ||
Matrix | 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 | ( | const Vector * | pos, |
const Vector * | dir, | ||
Int | allocatedCount, | ||
Matrix | 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 | ( | const Vector & | pos, |
const Vector & | dir, | ||
const Vector & | uvw, | ||
Matrix | 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 | ( | const Vector * | pos, |
const Vector * | dir, | ||
const Vector * | uvw, | ||
Int | allocatedCount, | ||
Matrix | 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 | ( | const Vector * | pos, |
const maxon::Block< const Vector > & | dir, | ||
const maxon::Block< const Vector > & | uvw, | ||
Int | allocatedCount, | ||
Matrix | 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 | ( | const maxon::Block< const Vector > & | pos, |
const maxon::Block< const Vector > & | dir, | ||
const maxon::Block< const Vector > & | uvw, | ||
Int | allocatedCount, | ||
Matrix | 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. |
|
default |
Destructor. FieldInput owns no memory.
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 | ( | FieldInput && | src | ) |
Move constructor
[in] | src | Move source. |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | FieldInput | ) |
MAXON_OPERATOR_COPY_ASSIGNMENT | ( | FieldInput | ) |
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. |
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. |
Int GetCount | ( | void | ) | const |
Gets the number of elements in the FieldInput
Int GetOffset | ( | ) | const |
Gets the offset of the first element in the full arrays.
Bool IsValid | ( | ) | const |
Checks if the FieldInput allocations and sizes are valid. Empty FieldInput is considered valid.
Bool IsPopulated | ( | ) | const |
Checks if the FieldInput is valid and non-empty.
maxon::Block<const Vector> _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.
maxon::Block<const Vector> _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.
maxon::Block<const Vector> _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.
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.
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;.
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!
Matrix _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.
|
private |
The allocated size of the vector arrays. Use this with _blockOffset to browse all the input vectors safely. Might be larger than blockCount.