3ds Max C++ API Reference
|
Fragment is the base computation unit in the view system. More...
#include <Fragment.h>
Public Member Functions | |
FragmentGraphAPI | Fragment () |
Constructor. More... | |
virtual FragmentGraphAPI | ~Fragment () |
Destructor. More... | |
FragmentGraphAPI bool | Evaluate (void *evaluationContext) |
Evaluates this fragment. More... | |
FragmentGraphAPI bool | ReEvaluate (void *evaluationContext) |
Re-evaluates this fragment. More... | |
FragmentGraphAPI size_t | GetNumberOfInputs () const |
Gets the number of inputs for this fragment. More... | |
FragmentGraphAPI Input & | GetInput (size_t inputIndex) |
Gets the n-th input for this fragment. More... | |
FragmentGraphAPI const Input & | GetInput (size_t inputIndex) const |
Gets the n-th input for this fragment. More... | |
FragmentGraphAPI const Variable * | GetInputVariable (size_t inputIndex) const |
Gets the n-th input variable for this fragment. More... | |
FragmentGraphAPI Output * | GetInputSource (size_t inputIndex) const |
Gets the output of another fragment that is connected to n-th input for this fragment. More... | |
FragmentGraphAPI bool | SetInputSource (size_t inputIndex, Output *pOutput) |
Connects the input to an output. More... | |
FragmentGraphAPI size_t | GetNumberOfOutputs () const |
Gets the number of outputs for this fragment. More... | |
FragmentGraphAPI Output & | GetOutput (size_t outputIndex) |
Gets the n-th output for this fragment. More... | |
FragmentGraphAPI const Output & | GetOutput (size_t outputIndex) const |
Gets the n-th output for this fragment. More... | |
FragmentGraphAPI bool | SetOutputVariable (size_t outputIndex, const Variable &var) |
Updates the value of the n-th output. More... | |
FragmentGraphAPI bool | GetFlag (FragmentFlags flag) const |
Gets a flag for this fragment. More... | |
FragmentGraphAPI void | SetFlag (FragmentFlags flag, bool onOff) |
Sets a flag for this fragment. More... | |
FragmentGraphAPI void | SetParent (Fragment *pParent) |
Assigns the parent fragment. More... | |
FragmentGraphAPI Fragment * | GetParent () const |
Gets the parent fragment. More... | |
FragmentGraphAPI IVariableDictionary * | GetParameterTable () |
Gets the container of all built-in parameters. More... | |
FragmentGraphAPI const IVariableDictionary * | GetParameterTable () const |
Gets the container of all built-in parameters. More... | |
virtual FragmentGraphAPI bool | OnMessage (const FragmentMessageParameter ¶m) |
The fragment message handling callback function that is called if any of its registered messages (including the timer message) is invoked. More... | |
FragmentGraphAPI void | SetTimerTicks (size_t timerTicks) |
Registers or deregisters the timer message and set the timer ticks value in milliseconds. More... | |
FragmentGraphAPI size_t | GetTimerTicks () const |
Gets the timer ticks value in milliseconds. More... | |
FragmentGraphAPI void | RegisterMessage (size_t messageID) |
Register a message with this fragment. More... | |
FragmentGraphAPI bool | UnRegisterMessage (size_t messageID) |
Deregister a message with this fragment. More... | |
FragmentGraphAPI const Tab< size_t > & | GetRegisteredMessageIDs () const |
Gets all the messages that have been registered. More... | |
virtual FragmentGraphAPI Class_ID | GetClassID () const |
Gets the class ID of this fragment. More... | |
![]() | |
GraphicsUtilityAPI | ARefObject () |
virtual GraphicsUtilityAPI long | AddRef () |
from IRefObject, see comments in IRefObject More... | |
virtual GraphicsUtilityAPI long | Release () |
decrease reference count of this object by one, if the decreased reference count equals zero, the object will be deleted. More... | |
GraphicsUtilityAPI IRefObject * | QueryInterface (Interface_ID classID) |
Try query an interface from the ref object using a given interface id. More... | |
![]() | |
GraphicsUtilityAPI | IRefObject () |
virtual GraphicsUtilityAPI | ~IRefObject () |
Protected Member Functions | |
FragmentGraphAPI bool | InitializeInputs (const Class_ID &type1) |
Initializes the inputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeInputs (const Class_ID &type1, const Class_ID &type2) |
Initializes the inputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeInputs (const Class_ID &type1, const Class_ID &type2, const Class_ID &type3) |
Initializes the inputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeInputs (const Class_ID &type1, const Class_ID &type2, const Class_ID &type3, const Class_ID &type4) |
Initializes the inputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeInputs (size_t numberOfInputs, const Class_ID *pInputTypes) |
Initializes the inputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeOutputs (const Class_ID &type1) |
Initializes the outputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeOutputs (const Class_ID &type1, const Class_ID &type2) |
Initializes the outputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeOutputs (const Class_ID &type1, const Class_ID &type2, const Class_ID &type3) |
Initializes the outputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeOutputs (const Class_ID &type1, const Class_ID &type2, const Class_ID &type3, const Class_ID &type4) |
Initializes the outputs for the fragment. More... | |
FragmentGraphAPI bool | InitializeOutputs (size_t numberOfOutputs, const Class_ID *pOutputTypes) |
Initializes the outputs for the fragment. More... | |
virtual FragmentGraphAPI Input * | CreateInput (const Class_ID &typeID) |
Create an input instance of this fragment. More... | |
virtual FragmentGraphAPI Output * | CreateOutput (const Class_ID &typeID) |
Create an output instance of this fragment. More... | |
virtual FragmentGraphAPI void | HandleFlagChanged (FragmentFlags flag, bool oldValue) |
This function will be invoked when any fragment flag gets changed. More... | |
virtual FragmentGraphAPI void | HandleSubFragmentFlagChanged (Fragment *pSubFragment, FragmentFlags flag, bool oldValue) |
This function will be invoked when any fragment flag of a sub fragment gets changed. More... | |
virtual bool | DoEvaluate (void *evaluationContext)=0 |
Do evaluation. More... | |
![]() | |
virtual GraphicsUtilityAPI void | DeleteThis () |
This function will be called when the reference count of an ARefObject equals zero. More... | |
virtual GraphicsUtilityAPI | ~ARefObject () |
Additional Inherited Members | |
![]() | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void | operator delete (void *ptr) |
Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. More... | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. More... | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. More... | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. More... | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More... | |
Fragment is the base computation unit in the view system.
A fragment has multiple inputs and outputs. Fragments can be connected together as a compute graph via those inputs and outputs. In this way, very complicated view features can be achieved, for example, combining the mental-ray GI pass with the Nitrous gizmo pass.
Constructor.
|
virtual |
Destructor.
|
protected |
Initializes the inputs for the fragment.
The inputs can only be initialized once for each fragment. Once the inputs are initialized, developers cannot change any of the inputs at runtime. This function will initialize the fragment to one input with the given type.
[in] | type1 | type of the first input. |
|
protected |
Initializes the inputs for the fragment.
The inputs can only be initialized once for each fragment. Once the inputs are initialized, developers cannot change any of the inputs at runtime. This function will initialize the fragment to two inputs with the given types.
[in] | type1 | type of the first input. |
[in] | type2 | type of the second input. |
|
protected |
Initializes the inputs for the fragment.
The inputs can only be initialized once for each fragment. Once the inputs are initialized, developers cannot change any of the inputs at runtime. This function will initialize the fragment to three inputs with the given types.
[in] | type1 | type of the first input. |
[in] | type2 | type of the second input. |
[in] | type3 | type of the third input. |
|
protected |
Initializes the inputs for the fragment.
The inputs can only be initialized once for each fragment. Once the inputs are initialized, developers cannot change any of the inputs at runtime. This function will initialize the fragment to four inputs with the given types.
[in] | type1 | type of the first input. |
[in] | type2 | type of the second input. |
[in] | type3 | type of the third input. |
[in] | type4 | type of the forth input. |
|
protected |
Initializes the inputs for the fragment.
The inputs can only be initialized once for each fragment. Once the inputs are initialized, developers cannot change any of the inputs at runtime. This function will initialize the fragment to n input with the given types.
[in] | numberOfInputs | the number of inputs for this fragment. |
[in] | pInputTypes | pointer to an array of the input types. This array must be the same size as numberOfInputs. |
|
protected |
Initializes the outputs for the fragment.
The outputs can only be initialized once for each fragment. Once the outputs are initialized, developers cannot change any of the outputs at runtime. This function will initialize the fragment to one output with the given type.
[in] | type1 | type of the first output. |
|
protected |
Initializes the outputs for the fragment.
The outputs can only be initialized once for each fragment. Once the outputs are initialized, developers cannot change any of the outputs at runtime. This function will initialize the fragment to two outputs with the given types.
[in] | type1 | type of the first output. |
[in] | type2 | type of the second output. |
|
protected |
Initializes the outputs for the fragment.
The outputs can only be initialized once for each fragment. Once the outputs are initialized, developers cannot change any of the outputs at runtime. This function will initialize the fragment to three outputs with the given types.
[in] | type1 | type of the first output. |
[in] | type2 | type of the second output. |
[in] | type3 | type of the third output. |
|
protected |
Initializes the outputs for the fragment.
The outputs can only be initialized once for each fragment. Once the outputs are initialized, developers cannot change any of the outputs at runtime. This function will initialize the fragment to four outputs with the given types.
[in] | type1 | type of the first output. |
[in] | type2 | type of the second output. |
[in] | type3 | type of the third output. |
[in] | type4 | type of the forth output. |
|
protected |
Initializes the outputs for the fragment.
The outputs can only be initialized once for each fragment. Once the outputs are initialized, developers cannot change any of the outputs at runtime. This function will initialize the fragment to n outputs with the given types.
[in] | numberOfOutputs | the number of outputs for this fragment. |
[in] | pOutputTypes | pointer to an array of the output types. This array must be the same size as numberOfOutputs. |
|
protectedvirtual |
Create an input instance of this fragment.
This function is called by InitializeInputs() when initializing inputs. This function could be overridden if a fragment would like to customize its own implementation of fragment inputs.
[in] | typeID | type of the input |
Reimplemented in FragmentGraph.
|
protectedvirtual |
Create an output instance of this fragment.
This function is called by InitializeOutputs() when initializing outputs. This function could be overridden if a fragment would like to customize its own implementation of fragment inputs.
[in] | typeID | type of the output |
Reimplemented in FragmentGraph.
|
protectedvirtual |
This function will be invoked when any fragment flag gets changed.
[in] | flag | the flag that gets changed |
[in] | oldValue | the old value of the flag |
Reimplemented in FragmentGraph.
|
protectedvirtual |
This function will be invoked when any fragment flag of a sub fragment gets changed.
[in] | pSubFragment | the sub fragment whose flag gets changed |
[in] | flag | the flag that gets changed |
[in] | oldValue | the old value of the flag |
|
protectedpure virtual |
Do evaluation.
A concrete fragment class must override this function, perform necessary computation in this function, and set value to its output. Please note this function cannot be directly called, it can only be called indirectly by calling Fragment::Evaluate().
[in] | evaluationContext | context info for evaluation. |
Implemented in FragmentGraph.
FragmentGraphAPI bool Evaluate | ( | void * | evaluationContext | ) |
Evaluates this fragment.
Updates the output values.
[in] | evaluationContext | context info for evaluation. |
FragmentGraphAPI bool ReEvaluate | ( | void * | evaluationContext | ) |
Re-evaluates this fragment.
We will first clear the FragmentFlagsEvaluated flag and then Call Evaluate().
[in] | evaluationContext | context info for evaluation. |
FragmentGraphAPI size_t GetNumberOfInputs | ( | ) | const |
Gets the number of inputs for this fragment.
FragmentGraphAPI Input& GetInput | ( | size_t | inputIndex | ) |
Gets the n-th input for this fragment.
[in] | inputIndex | the index of the input. |
FragmentGraphAPI const Input& GetInput | ( | size_t | inputIndex | ) | const |
Gets the n-th input for this fragment.
[in] | inputIndex | the index of the input. |
FragmentGraphAPI const Variable* GetInputVariable | ( | size_t | inputIndex | ) | const |
Gets the n-th input variable for this fragment.
[in] | inputIndex | the index of the input. |
FragmentGraphAPI Output* GetInputSource | ( | size_t | inputIndex | ) | const |
Gets the output of another fragment that is connected to n-th input for this fragment.
[in] | inputIndex | the index of the input. |
FragmentGraphAPI bool SetInputSource | ( | size_t | inputIndex, |
Output * | pOutput | ||
) |
Connects the input to an output.
[in] | inputIndex | the index of the input. |
[in] | pOutput | the pointer to an output of another fragment. Please note the fragment system doesn't accept circular connections. (i.e. A is connected to B, B is connected to C, while C is connected to A). |
FragmentGraphAPI size_t GetNumberOfOutputs | ( | ) | const |
Gets the number of outputs for this fragment.
FragmentGraphAPI Output& GetOutput | ( | size_t | outputIndex | ) |
Gets the n-th output for this fragment.
[in] | outputIndex | the index of the output. |
FragmentGraphAPI const Output& GetOutput | ( | size_t | outputIndex | ) | const |
Gets the n-th output for this fragment.
[in] | outputIndex | the index of the output. |
FragmentGraphAPI bool SetOutputVariable | ( | size_t | outputIndex, |
const Variable & | var | ||
) |
Updates the value of the n-th output.
[in] | outputIndex | the index of the output. |
[in] | var | the value to update. |
FragmentGraphAPI bool GetFlag | ( | FragmentFlags | flag | ) | const |
Gets a flag for this fragment.
[in] | flag | the flag bit to query |
FragmentGraphAPI void SetFlag | ( | FragmentFlags | flag, |
bool | onOff | ||
) |
Sets a flag for this fragment.
[in] | flag | the flag bit to set |
[in] | onOff | the value for the flag bit. |
FragmentGraphAPI void SetParent | ( | Fragment * | pParent | ) |
Assigns the parent fragment.
This function will be invoked when a fragment node is added to a fragment graph.
[in] | pParent | the parent of this fragment |
FragmentGraphAPI Fragment* GetParent | ( | ) | const |
Gets the parent fragment.
FragmentGraphAPI IVariableDictionary* GetParameterTable | ( | ) |
Gets the container of all built-in parameters.
FragmentGraphAPI const IVariableDictionary* GetParameterTable | ( | ) | const |
Gets the container of all built-in parameters.
|
virtual |
The fragment message handling callback function that is called if any of its registered messages (including the timer message) is invoked.
[in] | param | The message id and parameters of the message that has been invoked. |
FragmentGraphAPI void SetTimerTicks | ( | size_t | timerTicks | ) |
Registers or deregisters the timer message and set the timer ticks value in milliseconds.
To deregister this timer, assign TIMER_NONE to timerTicks.
[in] | timerTicks | the timer ticks value |
FragmentGraphAPI size_t GetTimerTicks | ( | ) | const |
Gets the timer ticks value in milliseconds.
FragmentGraphAPI void RegisterMessage | ( | size_t | messageID | ) |
Register a message with this fragment.
[in] | messageID | the id of the message to register |
FragmentGraphAPI bool UnRegisterMessage | ( | size_t | messageID | ) |
Deregister a message with this fragment.
[in] | messageID | the id of the message to deregister |
FragmentGraphAPI const Tab<size_t>& GetRegisteredMessageIDs | ( | ) | const |
Gets all the messages that have been registered.
|
virtual |
Gets the class ID of this fragment.
Reimplemented in FragmentGraph.