ICENodeContext Class Reference

ICENodeContext is used for accessing/handling custom node graph data. Instances of this object can pass information to the C++ API callbacks that implement the custom node plug-in item. More...

#include <xsi_icenodecontext.h>

Inheritance diagram for ICENodeContext:

Context CBase List of all members.

Public Member Functions

  ICENodeContext ()
  ~ICENodeContext ()
  ICENodeContext (const CRef &in_ref)
  ICENodeContext (const ICENodeContext &in_obj)
bool  IsA (siClassID in_ClassID) const
siClassID  GetClassID () const
ICENodeContext operator= (const ICENodeContext &in_obj)
ICENodeContext operator= (const CRef &in_ref)
CStatus  GetGroupInstanceCount (ULONG in_grpUniqID, ULONG &out_inst_count) const
ULONG  GetEvaluationThreadCount () const
ULONG  GetCurrentThreadIndex () const
ULONG  GetNumberOfElementsToProcess () const
CStatus  PutNumberOfElementsToProcess (ULONG in_nElements)
CStatus  GetPortInfo (ULONG in_nPortID, siICENodeDataType &out_type, siICENodeStructureType &out_struct, siICENodeContextType &out_context) const
ULONG  GetEvaluatedOutputPortID () const
CTime  GetTime () const

Detailed Description

ICENodeContext is used for accessing/handling custom node graph data. Instances of this object can pass information to the C++ API callbacks that implement the custom node plug-in item.

See also:
ICENode, PluginRegistrar::RegisterICENode, ICENode Callbacks
Since:
7.0


Constructor & Destructor Documentation

ICENodeContext (  ) 

Default constructor.

~ICENodeContext (  ) 

Default destructor.

ICENodeContext ( const CRef in_ref  ) 

Constructor.

Parameters:
in_ref  constant reference object.

ICENodeContext ( const ICENodeContext in_obj  ) 

Copy constructor.

Parameters:
in_obj  constant class object.


Member Function Documentation

bool IsA ( siClassID  in_ClassID  )  const [virtual]

Returns true if a given class type is compatible with this API class.

Parameters:
in_ClassID  class type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from Context.

siClassID GetClassID (  )  const [virtual]

Returns the type of the API class.

Returns:
The class type.

Reimplemented from Context.

ICENodeContext& operator= ( const ICENodeContext in_obj  ) 

Creates an object from another object.

Parameters:
in_obj  constant class object.
Returns:
The new ICENodeContext object.

ICENodeContext& operator= ( const CRef in_ref  ) 

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:
in_ref  constant class object.
Returns:
The new ICENodeContext object.

Reimplemented from Context.

CStatus GetGroupInstanceCount ( ULONG  in_grpUniqID,
ULONG &  out_inst_count  
) const

Returns the number of instances for a given group.

Parameters:
in_grpUniqID  Group index to query
Return values:
out_inst_count  Number of instances
Returns:
CStatus::OK success

ULONG GetEvaluationThreadCount (  )  const

Returns the number of threads used during the Evaluate callback.

Returns:
Thread count.

ULONG GetCurrentThreadIndex (  )  const

Returns the current evaluation thread index. If called from Evaluate, the index ranges between 0 and GetEvaluationThreadCount()-1. Returns 0 if called from either the BeginEvaluate or EndEvaluate callback.

Returns:
ULONG Thread index.

ULONG GetNumberOfElementsToProcess (  )  const

Returns the total number of elements to process during the evaluation of an ICENode. Returns 0 if the operation fails. The return value can be set by the custom ICENode if an output port is set with the siICENodeContextElementGenerator context type.

Returns:
ULONG Number of elements.
See also:
ICENodeContext::PutNumberOfElementsToProcess, ICENodeDef::AddOutputPort

CStatus PutNumberOfElementsToProcess ( ULONG  in_nElements  ) 

Sets the number elements to generate for an element generator node. The new value will affect the current output port being evaluated.

Parameters:
in_nElements  Number of elements. The value is ignored if the current port has not been set with the siICENodeContextElementGenerator context type.
Returns:
CStatus::OK Success.

CStatus::Fail Operation failed.

See also:
ICENodeContext::GetNumberOfElementsToProcess, ICENodeDef::AddOutputPort
Example:
This example shows how to set the number of elements to generate for an element generator type of ICENode. The BeginEvaluate callback must be used for calling ICENodeContext::PutNumberOfElementsToProcess.
        XSIPLUGINCALLBACK CStatus MyICENodeGenerator_BeginEvaluate( ICENodeContext& in_ctxt )
        {
            // Get some values from an input port
            CDataArrayLong inSize( in_ctxt, ID_Size );

            // Total number of elements to generate
            ULONG nSize = inSize[ 0 ];
            ULONG nElements = nSize * nSize;
            in_ctxt.PutNumberOfElementsToProcess( nElements );

            return CStatus::OK;
        }

CStatus GetPortInfo ( ULONG  in_nPortID,
siICENodeDataType out_type,
siICENodeStructureType out_struct,
siICENodeContextType out_context  
) const

Returns the connection information for the specified ICENodePort.

Parameters:
in_nPortID  Index of the port to query
Return values:
out_type  Data type for this port (see ICENodePort::GetDataType)
out_struct  Structure for this port (see ICENodePort::GetStructureType)
out_context  Context for this port (see ICENodePort::GetContextType)
Returns:
CStatus::OK success

ULONG GetEvaluatedOutputPortID (  )  const

Returns the unique identifier of the output port being evaluated.

Returns:
CStatus::OK success

CTime GetTime (  )  const

Returns the evaluation time. For a custom ICENode, the evaluation time is not necessarily the same as the current scene time or that it is evaluated just once per frame.

Returns:
CTime Evaluation time


The documentation for this class was generated from the following file: