imrAdvancedTranslation.h

Go to the documentation of this file.
00001 /*==============================================================================
00002 
00003   file:     imrAdvancedTranslation.h
00004 
00005   author:   Daniel Levesque
00006 
00007   created:  28 April 2004
00008 
00009   description:
00010 
00011     Defition of the mental ray advanced shader translation interface.
00012 
00013   modified: 
00014 
00015 
00016 (c) 2003 Autodesk
00017 ==============================================================================*/
00018 #pragma once
00019 
00020 #include "imrTranslation.h"
00021 #include "..\maxheap.h"
00022 
00023 //==============================================================================
00024 // class imrAdvancedTranslation
00025 //
00026 // A reference to this class is passed to imrShaderTranslation::TranslateParameters_Advanced().
00027 //
00028 // All methods in the class are an _exact_ match with a function in the mental ray API.
00029 // They need to be used in _exactly_ the same way as the mental ray API equivalent.
00030 // (For example: all the strings passed to the mental ray API need to be allocated using mi_mem_strdup()).
00031 //
00032 // For documentation on each method, see the MENTAL RAY MANUAL.
00033 //==============================================================================
00034 class imrAdvancedTranslation : public imrTranslation {
00035 
00036 public:
00037     enum miParam_type
00038     {
00039         miTYPE_BOOLEAN = 0,         /* simple types: used for */
00040         miTYPE_INTEGER,             /* returns and parameters */
00041         miTYPE_SCALAR,
00042         miTYPE_STRING,
00043         miTYPE_COLOR,
00044         miTYPE_VECTOR,
00045         miTYPE_TRANSFORM,
00046         miTYPE_SHADER,              /* complex types: used for */
00047         miTYPE_SCALAR_TEX,          /* parameters only */
00048         miTYPE_COLOR_TEX,
00049         miTYPE_VECTOR_TEX,
00050         miTYPE_LIGHT,
00051         miTYPE_STRUCT,
00052         miTYPE_ARRAY,
00053         miTYPE_TEX,
00054         miTYPE_MATERIAL,            /* phenomenon types */
00055         miTYPE_GEOMETRY,
00056         miTYPE_LIGHTPROFILE,            /* light profiles as args */
00057         miTYPE_DATA,                /* free-form user data */
00058         miNTYPES
00059     };
00060 
00061     enum miBoolean
00062     {
00063         miFALSE = 0,
00064         miTRUE  = 1
00065     };
00066 
00067     virtual miBoolean mi_api_parameter_name     (char *) = 0;
00068     virtual miBoolean mi_api_parameter_value    (miParam_type, void *, int *, int *) = 0;
00069     virtual miBoolean mi_api_parameter_push     (miBoolean) = 0;
00070     virtual miBoolean mi_api_parameter_pop      (void) = 0;
00071     virtual miBoolean mi_api_new_array_element  (void) = 0;
00072 
00073     virtual char* _mi_mem_strdup(const char*) = 0;
00074     virtual void _mi_mem_release(void*) = 0;
00075     virtual void* _mi_mem_allocate(int) = 0;
00076 };