FieldLayerData Class Referenceabstract

#include <c4d_fieldplugin.h>

Inheritance diagram for FieldLayerData:

Public Member Functions

 FieldLayerData ()
 
virtual maxon::Result< void > InitSampling (FieldLayer &layer, const FieldInfo &info, FieldShared &shared)
 
virtual maxon::Result< void > Sample (const FieldLayer &layer, const FieldInput &inputs, FieldOutputBlock &outputs, const FieldInfo &info) const =0
 
virtual maxon::Result< void > Aggregate (const FieldLayer &layer, const FieldInput &inputs, const FieldOutputBlock &outputs, const FieldInfo &info)
 
virtual void FreeSampling (FieldLayer &layer, const FieldInfo &info, FieldShared &shared)
 
virtual Bool IsEqual (const FieldLayer &layer, const FieldLayerData &comp) const
 
virtual FieldLayerLink GetLinkedObject (const FieldLayer &layer, BaseDocument *doc) const
 
virtual Bool SetLinkedObject (FieldLayer &layer, const FieldLayerLink &link)
 
virtual void CheckDirty (FieldLayer &layer, BaseDocument *doc)
 
- Public Member Functions inherited from NodeData
 NodeData ()
 
GeListNodeGet (void) const
 
virtual Bool Message (GeListNode *node, Int32 type, void *data)
 
virtual void GetBubbleHelp (GeListNode *node, maxon::String &str)
 
virtual BaseDocumentGetDocument (GeListNode *node)
 
virtual Int32 GetBranchInfo (GeListNode *node, BranchInfo *info, Int32 max, GETBRANCHINFO flags)
 
virtual Bool IsInstanceOf (const GeListNode *node, Int32 type) const
 
virtual Bool IsDocumentRelated (const GeListNode *node, Bool &docrelated) const
 
virtual Bool Init (GeListNode *node)
 
virtual void Free (GeListNode *node)
 
virtual Bool Read (GeListNode *node, HyperFile *hf, Int32 level)
 
virtual Bool Write (GeListNode *node, HyperFile *hf)
 
virtual Bool CopyTo (NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn)
 
virtual Bool GetDDescription (GeListNode *node, Description *description, DESCFLAGS_DESC &flags)
 
virtual Bool GetDParameter (GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
 
virtual Bool SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 
virtual Bool GetDEnabling (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
 
virtual Bool TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at)
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData (void)
 
void Destructor (void)
 

Private Member Functions

 MAXON_DISALLOW_COPY_AND_ASSIGN (FieldLayerData)
 

Additional Inherited Members

- Protected Attributes inherited from NodeData
GeListNodeprivate_link
 

Constructor & Destructor Documentation

◆ FieldLayerData()

Default constructor.

Since
R17.032

Member Function Documentation

◆ MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( FieldLayerData  )
private

◆ InitSampling()

virtual maxon::Result<void> InitSampling ( FieldLayer layer,
const FieldInfo info,
FieldShared shared 
)
virtual

Called to allow you to initialize any memory or values prior to sampling for the sake of speed. This function is single threaded.

Parameters
[in]layerThe layer a convenience value, equivalent to Get().
[in]infoThe information used for sampling within this core.
[in,out]sharedShared data between layers/fields.
Returns
OK on success, error will cancel sampling.

◆ Sample()

virtual maxon::Result<void> Sample ( const FieldLayer layer,
const FieldInput inputs,
FieldOutputBlock outputs,
const FieldInfo info 
) const
pure virtual

Called to modify the passed output values. This is the central purpose of the layer and as a requirement for the layer to function. It is critical that this function is as fast as possible and avoids too many memory operations. This function operates within a multithreaded environment and as such it is important to pay attention to the thread information passed within the supplied 'info' FieldInfo structure in order to avoid garbled output. NOTE: Sample does not receive the SharedData. If a layer needs access to it, it can keep a reference on it or copy parts of it in InitSampling.

Parameters
[in]layerThe layer a convenience value, equivalent to Get().
[in]inputsThe spacial points being sampled.
[in,out]outputsThe output arrays to modify, this will have content already from prior layers.
[in]infoThe information used for sampling within this core.
Returns
OK on success.

◆ Aggregate()

virtual maxon::Result<void> Aggregate ( const FieldLayer layer,
const FieldInput inputs,
const FieldOutputBlock outputs,
const FieldInfo info 
)
virtual

This function requires the FIELDLAYER_AGGREGATE registration flag to be set. This function receives the final output of the FieldLayers and is called at the end of each thread/block to allow the layer to Aggregate this output for it's own storage purposes or do per block cleanup as required.

Parameters
[in]layerThe layer a convenience value, equivalent to Get().
[in]inputsThe spacial points being sampled.
[in]outputsThe output arrays to modify, this will have content already from prior layers.
[in]infoThe information used for sampling within this core.
Returns
OK on success.

◆ FreeSampling()

virtual void FreeSampling ( FieldLayer layer,
const FieldInfo info,
FieldShared shared 
)
virtual

Called after sampling in order to allow you to clean up any memory utilized by your sampling algorithm. This function is single threaded.

Parameters
[in]layerThe layer a convenience value, equivalent to Get().
[in]infoThe information used for sampling within this core.
[in,out]sharedShared data between layers/fields.

◆ IsEqual()

virtual Bool IsEqual ( const FieldLayer layer,
const FieldLayerData comp 
) const
virtual

Query if 'layer' is equal to the passed 'comp' layer. This is mandatory to fill in, if a comparison is not correctly done then any changes made by the developer or user will not be stored within the GUI.

Parameters
[in]layerThe layer a convenience value, equivalent to Get().
[in]compThe layer data to compare with.
Returns
true if equal, false if not.

◆ GetLinkedObject()

virtual FieldLayerLink GetLinkedObject ( const FieldLayer layer,
BaseDocument doc 
) const
virtual

In a situation where the layer is a wrapper around another object, for example the built in FieldObject layers, this allows the layer to return it's linked object to the Layer GUI for dirty checks so that the owner of the GUI can update when for example an object that's linked moves.

Parameters
[in]layerThe layer, a convenience function the same as Get().
[in]docThe document.
Returns
A filled in FiledLayerLink structure containing passed BaseList and secondary data.

◆ SetLinkedObject()

virtual Bool SetLinkedObject ( FieldLayer layer,
const FieldLayerLink link 
)
virtual

This function is invoked to set the linked object. The passed structure corresponds to the data that might be found in a Drag & Drop invocation.

Parameters
[in]layerThe layer.
[in]linkThe link data containing the object and/or any secondary information that may be required, e.g. DescID from a DescID drag&drop into the Fields GUI.
Returns
True if it succeeds, false if it fails and the object cannot receive the passed information (or it is incorrect).

◆ CheckDirty()

virtual void CheckDirty ( FieldLayer layer,
BaseDocument doc 
)
virtual

Called to update the dirtiness of the Fieldlayer. Use layer->SetDirty(FLAGS) to set the dirtiness as required

Parameters
[in]layerThe layer.
[in]docThe document.