FieldInfo Struct Reference

#include <c4d_fielddata.h>

详细描述

Thread local information for this field sample invocation.

公共成员函数

  FieldInfo ()=default
  FieldInfo ( FieldInfo &&src)
  ~FieldInfo ()=default
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( FieldInfo )
Bool   IsValid () const
Bool   IsPopulated () const
maxon::Result < void >  CopyFrom (const FieldInfo &src)

静态公共成员函数

static maxon::Result < FieldInfo 创建 ( BaseList2D *caller, FIELDSAMPLE_FLAG callingFlags= FIELDSAMPLE_FLAG::VALUE )
static maxon::Result < FieldInfo 创建 ( BaseList2D *caller, const FieldInput &inputs, FIELDSAMPLE_FLAG callingFlags= FIELDSAMPLE_FLAG::VALUE , Int threadIndex=0, Int threadCount=0)
static maxon::Result < FieldInfo 创建 ( BaseList2D *caller, BaseDocument *doc, FIELDSAMPLE_FLAG callingFlags, const FieldInput &inputs)
static maxon::Result < FieldInfo 创建 (const FieldCallerStack &caller, BaseDocument *doc, FIELDSAMPLE_FLAG callingFlags, const FieldInput &inputs)
static FieldInfo   创建 ( FIELDSAMPLE_FLAG callingFlags, BaseThread *thread, BaseDocument *document, Int currentThreadIndex, Int threadCount, const FieldInput &inputs= FieldInput ())
static maxon::Result < FieldInfo 创建 ( FIELDSAMPLE_FLAG callingFlags, BaseThread *thread, BaseDocument *doc, Int currentThreadIndex, Int threadCount, const FieldInput &inputs, const FieldCallerStack &caller)
static maxon::Result < FieldInfo 创建 ( FIELDSAMPLE_FLAG callingFlags, BaseThread *thread, BaseDocument *doc, Int currentThreadIndex, Int threadCount, const FieldInput &inputs, const std::initializer_list< BaseList2D * > &callers)

Public Attributes

FIELDSAMPLE_FLAG   _flags
Int   _threadIndex
Int   _totalThreadCount
BaseThread _callerThread
BaseDocument _doc
FieldInput   _inputData
FieldCallerStack   _callerStack

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( FieldInfo )

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

◆  FieldInfo() [1/2]

FieldInfo ( )
default

◆  FieldInfo() [2/2]

FieldInfo ( FieldInfo &&  src )

◆  ~FieldInfo()

~ FieldInfo ( )
default

成员函数文档编制

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( FieldInfo   )

◆  IsValid()

Bool IsValid ( ) const

Checks if the FieldInfo data is valid. Default (empty) FieldInfo is considered valid.

◆  IsPopulated()

Bool IsPopulated ( ) const

Checks if the FieldInfo is valid and non-empty (all content should be set and ready for sampling)

◆  CopyFrom()

maxon::Result <void> CopyFrom ( const FieldInfo src )

Copies content from the supplied FieldInfo .

参数
[in] src The source info.
返回
A maxon::Result .

◆  Create() [1/7]

static maxon::Result < FieldInfo > Create ( BaseList2D caller ,
FIELDSAMPLE_FLAG   callingFlags = FIELDSAMPLE_FLAG::VALUE  
)
static

Creates a FieldInfo while relaying potential allocation errors. On error, the result will contain a default FieldInfo structure.

参数
[in] caller The caller object, should belong to the document being used.
[in] callingFlags (Optional) The channel sampling flags expected to be used for sampling.
返回
A maxon::Result containing the resulting FieldInfo , _inputData will not be populated, if you use this with the "Direct" sampling methods of the FieldList without populating _inputData you will encounter problematic behavior that could lead to crashes.

◆  Create() [2/7]

static maxon::Result < FieldInfo > Create ( BaseList2D caller ,
const FieldInput inputs ,
FIELDSAMPLE_FLAG   callingFlags = FIELDSAMPLE_FLAG::VALUE ,
Int   threadIndex = 0 ,
Int   threadCount = 0  
)
static

Creates a FieldInfo while relaying potential allocation errors. On error, the result will contain a default FieldInfo structure.

参数
[in] caller The caller object, should belong to the document being used.
[in] inputs The inputs that will be sampled.
[in] callingFlags (Optional) The channel sampling flags expected to be used for sampling.
[in] threadIndex (Optional) Zero-based index of the thread within the current MP loop alternatively just 0 for the initial thread.
[in] threadCount (Optional) Number of threads to be used, 0 or lower to automatically calculate for MP invocation.
返回
A maxon::Result containing the resulting FieldInfo .

◆  Create() [3/7]

static maxon::Result < FieldInfo > Create ( BaseList2D caller ,
BaseDocument doc ,
FIELDSAMPLE_FLAG   callingFlags ,
const FieldInput inputs  
)
static

Creates a FieldInfo while relaying potential allocation errors. On error, the result will contain a default FieldInfo structure.

参数
[in] caller The caller object, should belong to the document being used.
[in] doc The document to sample.
[in] callingFlags The channel sampling flags expected to be used for sampling.
[in] inputs The inputs that will be sampled.
返回
A maxon::Result containing the resulting FieldInfo .

◆  Create() [4/7]

static maxon::Result < FieldInfo > Create ( const FieldCallerStack caller ,
BaseDocument doc ,
FIELDSAMPLE_FLAG   callingFlags ,
const FieldInput inputs  
)
static

Creates a FieldInfo while relaying potential allocation errors. On error, the result will contain a default FieldInfo structure.

参数
[in] caller The caller stack object.
[in] doc The document to sample.
[in] callingFlags The channel sampling flags expected to be used for sampling.
[in] inputs The inputs that will be sampled.
返回
A maxon::Result containing the resulting FieldInfo .

◆  Create() [5/7]

static FieldInfo 创建 ( FIELDSAMPLE_FLAG   callingFlags ,
BaseThread thread ,
BaseDocument document ,
Int   currentThreadIndex ,
Int   threadCount ,
const FieldInput inputs = FieldInput()  
)
static

Creates an incomplete FieldInfo that the user has to fill in with a FieldCallerStack . This overload cannot fail.

参数
[in] callingFlags The channels to sample.
[in] thread The caller thread.
[in] document The document to sample.
[in] currentThreadIndex The thread index that will sample those points.
[in] threadCount The total thread count.
[in] inputs The full point list.
返回
The created FieldInfo .

◆  Create() [6/7]

static maxon::Result < FieldInfo > Create ( FIELDSAMPLE_FLAG   callingFlags ,
BaseThread thread ,
BaseDocument doc ,
Int   currentThreadIndex ,
Int   threadCount ,
const FieldInput inputs ,
const FieldCallerStack caller  
)
static

Creates a FieldInfo while relaying potential allocation errors. On error, the result will contain a default FieldInfo structure.

参数
[in] callingFlags The channels to sample.
[in] thread The caller thread.
[in] doc The document to sample.
[in] currentThreadIndex The thread index that will sample those points.
[in] threadCount The total thread count.
[in] inputs The full point list.
[in] caller The caller stack.
返回
A maxon::Result containing the resulting FieldInfo .

◆  Create() [7/7]

static maxon::Result < FieldInfo > Create ( FIELDSAMPLE_FLAG   callingFlags ,
BaseThread thread ,
BaseDocument doc ,
Int   currentThreadIndex ,
Int   threadCount ,
const FieldInput inputs ,
const std::initializer_list< BaseList2D * > &  callers  
)
static

Creates a FieldInfo while relaying potential allocation errors. On error, the result will contain a default FieldInfo structure.

参数
[in] callingFlags The channels to sample.
[in] thread The caller thread.
[in] doc The document to sample.
[in] currentThreadIndex The thread index that will sample those points.
[in] threadCount The total thread count.
[in] inputs The full point list.
[in] callers An initializer list to build the stack, first item is base of stack.
返回
A maxon::Result containing the resulting FieldInfo .

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( FieldInfo   )
private

Member Data Documentation

◆  _flags

FIELDSAMPLE_FLAG _flags

The current flags represent which channels are available and should be sampled.

◆  _threadIndex

Int _threadIndex

The current thread index.

◆  _totalThreadCount

Int _totalThreadCount

The number of threads active for this execution.

◆  _callerThread

BaseThread * _callerThread

The calling thread @required.

◆  _doc

BaseDocument * _doc

The calling document @required.

◆  _inputData

FieldInput _inputData

The input data to be sampled, caller owns this object @required.

◆  _callerStack

FieldCallerStack _callerStack

A list of objects that called this calculation as well as an ID for the invocation chain, useful if you need to hash data to a specific caller, this uses the memory addresses of the callers so the value could change on undo/redo and will change on document load @required.