Public Member Functions

ObjectConverter Class Reference

Search for all occurrences

Detailed Description

This virtual class is implemented by applications that want to supply a conversion method from one object type to another.

A typical use would be to support conversion of a native 3ds Max type (such as TriObject) to a plug-in's object type. There are a set of global functions that can be used with this class. These are documented at the bottom of the topic. One of these is called to register the ObjectConverter with the system. Note that the registered object converters are called from the methods: Object::CanConvertToType and Object::ConvertToType.

So for individual objects to support these, they'll need to add the line

if (Object::CanConvertToType(obtype)) return 1;

to the end of their CanConvertToType methods and

if (Object::CanConvertToType(obtype))

return Object::ConvertToType(t, obtype);

to the end of their ConvertToType methods.

See also:
Class InterfaceServer, Class Class_ID, Class Object, Class TriObject, Class PatchObject

#include <object.h>

Inheritance diagram for ObjectConverter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual Class_ID  ConvertsFrom ()=0
  This method returns the Class ID of the object this converter converts from.
virtual Class_ID  ConvertsTo ()=0
  This method returns the Class ID of the object this converter converts to.
virtual Object Convert (Object *from)=0
  This method actually performs the conversion, creating and returning a new object with the class ID specified in ConvertsTo().
virtual void  DeleteThis ()
  This should delete the ObjectConverter if necessary.

Member Function Documentation

virtual Class_ID ConvertsFrom ( ) [pure virtual]

This method returns the Class ID of the object this converter converts from.

virtual Class_ID ConvertsTo ( ) [pure virtual]

This method returns the Class ID of the object this converter converts to.

virtual Object* Convert ( Object from ) [pure virtual]

This method actually performs the conversion, creating and returning a new object with the class ID specified in ConvertsTo().

Parameters:
from Points to the object to convert.
virtual void DeleteThis ( ) [inline, virtual]

This should delete the ObjectConverter if necessary.

{ }

ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter
ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter ObjectConverter