3ds Max C++ API Reference
ViewFragment Class Referenceabstract

Base class of all viewport fragment. More...

#include <ViewFragment.h>

+ Inheritance diagram for ViewFragment:

Public Member Functions

MaxGraphicsObjectAPI ViewFragment ()
 Constructor. More...
 
virtual MaxGraphicsObjectAPI ~ViewFragment ()
 Destructor. More...
 
template<typename T >
bool GetSmartHandleInput (T &handle, size_t inputIndex)
 Get a input of ref object type using SmartHandle. More...
 
template<typename T >
bool SetSmartHandleOutput (const T &handle, size_t outputIndex)
 Set a ref object to the output. More...
 
- Public Member Functions inherited from Fragment
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 InputGetInput (size_t inputIndex)
 Gets the n-th input for this fragment. More...
 
FragmentGraphAPI const InputGetInput (size_t inputIndex) const
 Gets the n-th input for this fragment. More...
 
FragmentGraphAPI const VariableGetInputVariable (size_t inputIndex) const
 Gets the n-th input variable for this fragment. More...
 
FragmentGraphAPI OutputGetInputSource (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 OutputGetOutput (size_t outputIndex)
 Gets the n-th output for this fragment. More...
 
FragmentGraphAPI const OutputGetOutput (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 FragmentGetParent () const
 Gets the parent fragment. More...
 
FragmentGraphAPI IVariableDictionaryGetParameterTable ()
 Gets the container of all built-in parameters. More...
 
FragmentGraphAPI const IVariableDictionaryGetParameterTable () const
 Gets the container of all built-in parameters. More...
 
virtual FragmentGraphAPI bool OnMessage (const FragmentMessageParameter &param)
 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...
 
- Public Member Functions inherited from ARefObject
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 IRefObjectQueryInterface (Interface_ID classID)
 Try query an interface from the ref object using a given interface id. More...
 
- Public Member Functions inherited from IRefObject
GraphicsUtilityAPI IRefObject ()
 
virtual GraphicsUtilityAPI ~IRefObject ()
 

Protected Member Functions

virtual bool DoEvaluate (EvaluationContext *evaluationContext)=0
 Do evaluation. More...
 
- Protected Member Functions inherited from Fragment
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 InputCreateInput (const Class_ID &typeID)
 Create an input instance of this fragment. More...
 
virtual FragmentGraphAPI OutputCreateOutput (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...
 
- Protected Member Functions inherited from ARefObject
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 Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_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...
 

Detailed Description

Base class of all viewport fragment.

Constructor & Destructor Documentation

◆ ViewFragment()

◆ ~ViewFragment()

virtual MaxGraphicsObjectAPI ~ViewFragment ( )
virtual

Destructor.

Member Function Documentation

◆ GetSmartHandleInput()

bool GetSmartHandleInput ( T &  handle,
size_t  inputIndex 
)
inline

Get a input of ref object type using SmartHandle.

Parameters
[in]handlethe smart handle to receive the ref object input
[in]inputIndexthe index of the input
Returns
true if we manage to get this ref object input or false otherwise
38  {
39  Output* pInputSource = GetInputSource(inputIndex);
40  if (NULL != pInputSource && T::ClassID() == pInputSource->GetTypeID())
41  {
42  handle.SetPointer(pInputSource->GetVar().AsRefObject());
43  return true;
44  }
45 
46  return false;
47  }
#define NULL
Definition: autoptr.h:18
FragmentGraphAPI Output * GetInputSource(size_t inputIndex) const
Gets the output of another fragment that is connected to n-th input for this fragment.

◆ SetSmartHandleOutput()

bool SetSmartHandleOutput ( const T &  handle,
size_t  outputIndex 
)
inline

Set a ref object to the output.

Parameters
[in]handlethe smart handle that has the ref object
[in]outputIndexthe index of the output
Returns
true if we manage to set this ref object to the output or false otherwise
56  {
57  Output& output = GetOutput(outputIndex);
58  if (T::ClassID() == output.GetTypeID())
59  {
60  return SetOutputVariable(outputIndex, Variable(handle.GetPointer()));
61  }
62 
63  return false;
64  }
FragmentGraphAPI Output & GetOutput(size_t outputIndex)
Gets the n-th output for this fragment.
FragmentGraphAPI bool SetOutputVariable(size_t outputIndex, const Variable &var)
Updates the value of the n-th output.

◆ DoEvaluate()

virtual bool DoEvaluate ( EvaluationContext evaluationContext)
protectedpure virtual

Do evaluation.

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().

Parameters
[in]evaluationContextcontext info for evaluation.
Returns
true if succeeded, false otherwise.