FieldList Class Reference

#include <customgui_field.h>

Inheritance diagram for FieldList:

Detailed Description

Field custom GUI (CUSTOMDATATYPE_FIELDLIST) for the Field list data.

Public Member Functions

maxon::Result< FieldOutputSampleListSimple (const BaseList2D &caller, const FieldInput &inputs, FIELDSAMPLE_FLAG flags=FIELDSAMPLE_FLAG::ALL) const
 
maxon::Result< void > SampleList (const FieldInfo &info, const FieldInput &inputs, FieldOutput &outputs) const
 
maxon::Result< void > SampleListWithLambda (const FieldInfo &info, const FieldLambdaInput &&inputFunc, const FieldLambdaOutput &&outputFunc) const
 
maxon::Result< maxon::GenericDataDirectInitSampling (const FieldInfo &info) const
 
maxon::Result< void > DirectSample (const FieldInput &inputs, FieldOutputBlock &outputs, const FieldInfo &info, const maxon::GenericData &extraData) const
 
void DirectFreeSampling (const FieldInfo &info, maxon::GenericData &extraData) const
 
maxon::Result< void > ForEachLayer (const maxon::Delegate< maxon::Result< void >(const FieldLayer *layer, const maxon::GenericData &extra)> &callback, const maxon::GenericData &listData) const
 
UInt32 GetDirty (const BaseDocument *doc) const
 
Int32 GetCount () const
 
void Flush ()
 
maxon::Result< void > InsertLayer (FieldLayer *layer, FieldLayer *parent=nullptr, FieldLayer *prev=nullptr)
 
GeListHeadGetLayersRootWritable (Bool create)
 
const GeListHeadGetLayersRootConst () const
 
maxon::Result< void > GetSelected (maxon::BaseArray< FieldLayer * > &selected, Bool includeChildren=true) const
 
maxon::Result< void > FindByReference (FieldLayerLink link, BaseDocument *doc, maxon::BaseArray< FieldLayer * > &found) const
 
void SetFlags (FIELDLIST_FLAGS flags, Bool state)
 
FIELDLIST_FLAGS GetFlags () const
 
Bool CheckFlag (FIELDLIST_FLAGS flag) const
 
Bool HasContent (FIELDLAYER_CHANNELFLAG channel=FIELDLAYER_CHANNELFLAG::COLOR|FIELDLAYER_CHANNELFLAG::DIRECTION|FIELDLAYER_CHANNELFLAG::VALUE|FIELDLAYER_CHANNELFLAG::ROTATION) const
 
maxon::Result< BoolGetAccessedObjects (const BaseList2D *caller, METHOD_ID method, AccessedObjectsCallback &access) const
 

Private Member Functions

 FieldList ()=default
 
 ~FieldList ()=default
 

Alloc/Free

static FieldListAlloc ()
 
static void Free (FieldList *&list)
 

Additional Inherited Members

- Static Public Attributes inherited from CustomDataTypeT< 440000246 >
static constexpr Int32 DATATYPEID
 

Constructor & Destructor Documentation

◆ FieldList()

FieldList ( )
privatedefault

Default constructor.

◆ ~FieldList()

~FieldList ( )
privatedefault

Destructor.

Member Function Documentation

◆ Alloc()

static FieldList* Alloc ( )
static

Allocates a field list data. Destroy the allocated field list data with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated field list data, or nullptr if the allocation failed.

◆ Free()

static void Free ( FieldList *&  list)
static

Destructs field list data allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]listThe field list data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ SampleListSimple()

maxon::Result<FieldOutput> SampleListSimple ( const BaseList2D caller,
const FieldInput inputs,
FIELDSAMPLE_FLAG  flags = FIELDSAMPLE_FLAG::ALL 
) const

Sample a block of values. Use this method to avoid to avoid having to pre create FieldInfo and FieldOutput structures. Sampling will be performed in the caller's document with default FieldInfo parameters.

Parameters
[in]callerThe caller object, simply pass the BaseList2D you are invoking the sampling from.
[in]inputsThe inputs to sample from.
[in]flagsThe channels to sample.
Returns
The sampled FieldOutput.

◆ SampleList()

maxon::Result<void> SampleList ( const FieldInfo info,
const FieldInput inputs,
FieldOutput outputs 
) const

Sample a block of values. Allows full parameter control to the user. You can supply a simple Vector as inputs to sample just one position. User needs to supply a valid FieldInfo filled with all parameters.

Parameters
[in]infoThe sampling informations, document, threading, flags... Should succeed IsPopulated().
[in]inputsThe inputs to sample from.
[out]outputsArrays that hold the sampling results, based on sampling flags.
Returns
OK on success.

◆ SampleListWithLambda()

maxon::Result<void> SampleListWithLambda ( const FieldInfo info,
const FieldLambdaInput &&  inputFunc,
const FieldLambdaOutput &&  outputFunc 
) const

Sample a block of specified length using the passed lambda's to initialize the FieldInput and apply the final FieldOutputBlock.

Parameters
[in]infoThe information required for execution. Should succeed IsPopulated().
[in]inputFuncThe input function, fill the passed FieldInput arrays within this function.
[in]outputFuncThe output function, make use of the calculated FieldOutputBlock within this function.
Returns
OK on success.

◆ DirectInitSampling()

maxon::Result<maxon::GenericData> DirectInitSampling ( const FieldInfo info) const

Direct initialize to be used only with DirectSample function, DirectFree must be called afterwards.

Parameters
[in]infoThe pre-filled FieldInfo, caller owns the object.
Returns
OK on success.

◆ DirectSample()

maxon::Result<void> DirectSample ( const FieldInput inputs,
FieldOutputBlock outputs,
const FieldInfo info,
const maxon::GenericData extraData 
) const

Direct sample function, DirectInitSampling must be called before and DirectFree afterwards.

Parameters
[in]inputsThe points to sample, caller owns the object.
[out]outputsThe output, caller owns the object.
[in]infoThe pre-filled FieldInfo, caller owns the object.
[in,out]extraDataThe internal data of a sampling process provided by an sampling initialization function.
Returns
OK on success.

◆ DirectFreeSampling()

void DirectFreeSampling ( const FieldInfo info,
maxon::GenericData extraData 
) const

Direct free, must be called after DirectInitSampling

Parameters
[in]infoThe pre-filled FieldInfo, caller owns the object.
[in,out]extraDataThe internal data of a sampling process provided by an sampling initialization function.

◆ ForEachLayer()

maxon::Result<void> ForEachLayer ( const maxon::Delegate< maxon::Result< void >(const FieldLayer *layer, const maxon::GenericData &extra)> &  callback,
const maxon::GenericData listData 
) const

◆ GetDirty()

UInt32 GetDirty ( const BaseDocument doc) const

Gets the dirtiness of the field GUI and it's objects.

Parameters
[in]docThe document.
Returns
The dirty.

◆ GetCount()

Int32 GetCount ( ) const

Retrieves the total number of fields and groups in the list.

Returns
The count.

◆ Flush()

void Flush ( )

Empties the list of all entries, frees any used memory and resets the FieldList back to it's default state.

◆ InsertLayer()

maxon::Result<void> InsertLayer ( FieldLayer layer,
FieldLayer parent = nullptr,
FieldLayer prev = nullptr 
)

Inserts a pre-existing layer into the FieldList.

Parameters
[in]layerThe layer to insert into the .FieldList. The caller must own this layer and it must not be already inserted in any other FieldList (or in the current fieldList in another location)
[in]parentThe layer that will be the parent of the layer being inserted.
[in]prevThe previous layer to the one being inserted.
Returns
OK on success.

◆ GetLayersRootWritable()

GeListHead* GetLayersRootWritable ( Bool  create)

Retrieves the root GeListHead that owns the layers in the FieldList.

Returns
Null if it fails, else the root GeListHead for the FieldList. THe FieldList owns the passed object.

◆ GetLayersRootConst()

const GeListHead* GetLayersRootConst ( ) const

◆ GetSelected()

maxon::Result<void> GetSelected ( maxon::BaseArray< FieldLayer * > &  selected,
Bool  includeChildren = true 
) const

Retrieves a list of all the selected layers in the FieldList, this may include the background layer.

Parameters
[out]selected[out] The selected FieldLayers in the FieldList.
[in]includeChildren(Optional) True to include, false to exclude the children.
Returns
A maxon::Result<void>

◆ FindByReference()

maxon::Result<void> FindByReference ( FieldLayerLink  link,
BaseDocument doc,
maxon::BaseArray< FieldLayer * > &  found 
) const

Searches for the field Layers that match the passed Reference.

Parameters
[in]linkThe FieldLayerLink, this follows the same type of format as Drag & Drop data.
[in]docThe document.
[out]found[out] The list of FieldLayers found by the passed reference.
Returns
A maxon::Result<void>

◆ SetFlags()

void SetFlags ( FIELDLIST_FLAGS  flags,
Bool  state 
)

Sets the state of the FIELDLIST_FLAGS for this FieldList

Parameters
[in]flagsThe flags to set or clear.
[in]stateTrue to set the flag, false to clear it.

◆ GetFlags()

FIELDLIST_FLAGS GetFlags ( ) const

Gets the FIELDLIST_FLAGS for this FieldList

Returns
The complete set of flags.

◆ CheckFlag()

Bool CheckFlag ( FIELDLIST_FLAGS  flag) const

Checks a specific flag (or combination) to see if they are set, all flags must be set to return a true result i.e. this is functionally the equivalent of (GetFlags()&flag) == flag rather than just a check for any set flag within the passed flag value.

Parameters
[in]flagThe flag(s) to check.
Returns
True if the flag is set, false if it has not been set.

◆ HasContent()

Query if the FieldList has content i.e. any FieldLayers in it in order to determine if it's worth evaluation

Parameters
[in]channel(Optional) The channels to check that content exists for.
Returns
True if there are FieldLayers in the FieldList, false if not.

◆ GetAccessedObjects()

maxon::Result<Bool> GetAccessedObjects ( const BaseList2D caller,
METHOD_ID  method,
AccessedObjectsCallback access 
) const