3ds Max C++ API Reference
ITargetedIO Class Referenceabstract

#include <iTargetedIO.h>

+ Inheritance diagram for ITargetedIO:

Public Member Functions

virtual void AddSaveTarget (int targetIndex, ReferenceTarget *rt)=0
 This is used when a preset is saved. More...
 
virtual ReferenceTargetGetSaveTarget (int targetIndex)=0
 This is used when a preset is loaded. More...
 
virtual int SaveToFile (const MCHAR *fileName, FileIOType context)=0
 This is used internally and should not be called by developers. More...
 
virtual int LoadFromFile (const MCHAR *fileName, FileIOType context)=0
 This is used internally and should not be called by developers. More...
 
virtual void Store (int targetIndex, ReferenceTarget *rt)=0
 Allows the renderer to preserve a ReferenceTarget object before a preset is loaded.
More...
 
virtual ReferenceTargetRetrieve (int targetIndex)=0
 returns a referenceTarget that was previously saved with Store(). More...
 

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

See also
Class Renderer
Description:
The TargetedIO system is useful for renderers that wish to implement custom Render Preset categories. The Mental Ray categories "Processing" and "Illumination" are an example. TargetedIO is NOT important to developers who wish only to load and save render presets, and are not implementing their own renderer.

Abstractly, ITargetedIO represents a subset of the current scene, a "targeted" set of parameters, to be saved as a preset. Render Preset files are stored in the same format as .max files, but contain only the target parts of the scene, namely the renderer's parameters.

In practice, an ITargetedIO instance is passed to the renderer when presets are saved and loaded. The renderer filters what is saved and loaded by interacting with this IO object.

Member Function Documentation

◆ AddSaveTarget()

virtual void AddSaveTarget ( int  targetIndex,
ReferenceTarget rt 
)
pure virtual

This is used when a preset is saved.

It is possible for the user to choose some categories for the preset without selecting the renderer itself. In this case the renderer is NOT part of the preset and its Load() method is not called when the preset is loaded. Other categories defined by the renderer might still be saved in the preset. For this reason, it is important that each category be separate a ReferenceTarget with its own Load() and Save().

Parameters
targetIndex- a category ID number as determined by the renderer.
rt- the object which embodies this category of parameters.

◆ GetSaveTarget()

virtual ReferenceTarget* GetSaveTarget ( int  targetIndex)
pure virtual

This is used when a preset is loaded.

The renderer can then copy this loaded set of parameters into its own active set. As described above, the renderer might not have its Load() method called when the preset is loaded, so so the renderer must take responsibility to call GetSaveTarget() and manually copy its parameters out of this object.

Parameters
targetIndex- A category ID number as determined by the renderer.
Returns
the ReferenceTarget that was loaded under that category.

◆ SaveToFile()

virtual int SaveToFile ( const MCHAR fileName,
FileIOType  context 
)
pure virtual

This is used internally and should not be called by developers.

◆ LoadFromFile()

virtual int LoadFromFile ( const MCHAR fileName,
FileIOType  context 
)
pure virtual

This is used internally and should not be called by developers.

◆ Store()

virtual void Store ( int  targetIndex,
ReferenceTarget rt 
)
pure virtual

Allows the renderer to preserve a ReferenceTarget object before a preset is loaded.

these utility methods can be used by renderers to hang on to reference targets between the RenderPresetsPreLoad and RenderPresetsPostLoad calls. This is needed when the user has chosen to save the renderer in the preset, but NOT all of its parameters. In this case the renderer's Load() will be called which may result in loading parameters that the user did not want as part of the preset. If the renderer sees that a certain category is not being loaded, it can Store() that object before the load and Retrieve() it afterwards, restoring its active set of parameters to their correct value.

Parameters
targetIndex- A category ID number as determined by the renderer.
rt- the object which embodies this category of parameters.

◆ Retrieve()

virtual ReferenceTarget* Retrieve ( int  targetIndex)
pure virtual

returns a referenceTarget that was previously saved with Store().

these utility methods can be used by renderers to hang on to reference targets between the RenderPresetsPreLoad and RenderPresetsPostLoad calls.

Parameters
targetIndex- A category ID number as determined by the renderer.
Returns
the object which embodies this category of parameters.