imrLightTranslation.h

Go to the documentation of this file.
00001 //*****************************************************************************/
00002 // Copyright (c) 1998-2006 Autodesk, Inc.
00003 // All rights reserved.
00004 // 
00005 // These coded instructions, statements, and computer programs contain
00006 // unpublished proprietary information written by Autodesk, Inc., and are
00007 // protected by Federal copyright law. They may not be disclosed to third
00008 // parties or copied or duplicated in any form, in whole or in part, without
00009 // the prior written consent of Autodesk, Inc.
00010 //*****************************************************************************/
00011 /*==============================================================================
00012 
00013   file:     imrLightTranslation.h
00014 
00015   author:   Daniel Levesque
00016 
00017   created:  27 Jan 2006
00018 
00019   description:
00020 
00021     Defition of the mental ray light translation interface.
00022 
00023   modified: 
00024 
00025 ==============================================================================*/
00026 #pragma once
00027 
00028 #include "..\maxheap.h"
00029 #include "..\baseinterface.h"
00030 #include "..\coreexp.h"
00031 #include "..\maxtypes.h"
00032 
00033 // Forward declarations
00034 class imrTranslation;
00035 class INode;
00036 class Interval;
00037 class Texmap;
00038 
00039 //==============================================================================
00040 // class imrLightTranslation
00041 //
00043 
00051 class imrLightTranslation : public BaseInterface {
00052 
00053 public:
00054 
00056     CoreExport static Interface_ID GetInterfaceID();
00057 
00061     CoreExport static imrLightTranslation* GetInterface(InterfaceServer& iserver);
00062 
00064     enum LightType {
00066         kLightType_Origin,
00068         kLightType_Directional,
00070         kLightType_DirectionalWithOrigin,
00072         kLightType_Spot
00073     };
00074 
00077     enum AreaType {
00079         kAreaType_None,
00081         kAreaType_Rectangle,
00083         kAreaType_Disc,
00085         kAreaType_Sphere,
00087         kAreaType_Cylinder,
00089         kAreaType_User
00090     };
00091 
00093     struct VectorStruct : public MaxHeapOperators {
00094         float x, y, z;
00095     };
00096 
00098     union AreaPrimitive {
00100         struct AreaLight_rectangle : public MaxHeapOperators {
00101             VectorStruct edge_u;
00102             VectorStruct edge_v;
00103         } rectangle;
00105         struct AreaLight_disc : public MaxHeapOperators {
00106             VectorStruct normal;
00107             float radius;
00108         } disc;
00110         struct AreaLight_sphere : public MaxHeapOperators {
00111             float radius;
00112         } sphere;
00114         struct AreaLight_cylinder : public MaxHeapOperators {
00115             VectorStruct axis;
00116             float radius;
00117         } cylinder;
00118     };
00119 
00121 
00122 
00135     virtual Texmap* GetLightShader(INode& node) = 0;
00136     virtual Texmap* GetPhotonEmitterShader(INode& node) = 0;
00138 
00139     // Tells the translator whether this light species a custom flux. If this returns false,
00140     // then the translator will attempt to calculate the flux based on the light type and its intensity.
00141 
00143 
00146     virtual bool HasCustomFlux(INode& node) = 0;
00147 
00148 
00150 
00168     virtual float GetFlux(INode& node, imrTranslation& translationInterface, TimeValue t, Interval& valid) = 0;
00169 
00174     virtual LightType GetLightType(TimeValue t, Interval& validity) = 0;
00175 
00180     virtual AreaType GetAreaType(TimeValue t, Interval& validity) = 0;
00181 
00188     virtual void GetAreaPrimitive(AreaPrimitive& areaPrimitive, TimeValue t, Interval& validity) = 0;
00189 
00196     virtual short GetAreaSamples(TimeValue t, Interval& validity) = 0;
00197 
00204     virtual short GetAreaLowSamples(TimeValue t, Interval& validity) = 0;
00205 
00212     virtual short GetAreaLowLevel(TimeValue t, Interval& validity) = 0;
00213 
00219     virtual bool GetAreaVisible(TimeValue t, Interval& validity) = 0;
00220 };
00221