iLuminaire.h

Go to the documentation of this file.
00001      /**********************************************************************
00002  
00003     FILE: ILuminaire.h
00004 
00005     DESCRIPTION:  Public interface of a Luminaire (lighting fixture)
00006 
00007     CREATED BY: Attila Szabo, Discreet
00008 
00009     HISTORY: - created Aug 12, 2001
00010 
00011  *> Copyright (c) 1998-2001, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 
00016 #include "iFnPub.h"
00017 #include "maxtypes.h"
00018 #include "interval.h"
00019 
00020 
00021 //  This is an interface class that defines the operations and properties
00022 //  of a luminaire. A luminaire is a lighting fixture. A luminaire is made
00023 //  up by at least one light object and several other objects (geometry, etc)
00024 //
00025 //  This interface can be implemented by any plugin object, whether it is a 
00026 //  helper, geometry, etc. 
00027 //  Luminaire plugin objects can be used, for example,
00028 //  as luminaire assembly head objects. In this case, the object's parameters 
00029 //  defined in its param block can be parameter wired to the the parameters of
00030 //  the light objects in the luminaire assembly. In this case, the methods of 
00031 //  this interface should read and write the corresponding paramblock parameters 
00032 //  of the object plugin. 
00033 #pragma warning(push)
00034 #pragma warning(disable:4239)
00035 class ILuminaire : public FPMixinInterface 
00036 {
00037     public:
00038     // Dimming a luminaire means changing the intensity of all of its light 
00039     // sources at once with the same percentage.
00040     // A dimmer value of zero means effectively turning off all light sources 
00041     // in the luminiare; a dimmer value of 100 means that the light sources 
00042     // shine at their ("factory") default intensity, while a dimmer value 
00043     // greater than 100 means that their intensity is amplified\multiplied above
00044     // the ("factory") default value.
00045     // In the case of standard Max light sources, "factory" default intensity 
00046     // means a certain arbitrary multiplier value that is chosen by the user.
00047     // In case of physically based light sources, "factory" default intensity 
00048     // means the intensity given in the light's photometric file.
00049         virtual void        SetDimmer(float value, TimeValue time) = 0;
00050         virtual float       GetDimmer(TimeValue time, Interval& valid = FOREVER) const = 0 ;
00051 
00052         // These methods allow for specifing and retrieving at once (simultaneously) 
00053     // the filter color of all light sources of a luminaire
00054         virtual void        SetRGBFilterColor(Point3& value, TimeValue& time) = 0;
00055         virtual Point3  GetRGBFilterColor(TimeValue& time, Interval& valid = FOREVER) const = 0;
00056 
00057         // These methods allow for specifing and retrieving at once (simultaneously) 
00058     // the on\off state of all light sources of a luminaire
00059         virtual void        SetUseState(bool onOff, TimeValue& time) = 0;
00060         virtual bool        GetUseState(TimeValue& time, Interval& valid = FOREVER) const = 0;
00061 
00062         // Function Publishing Methods IDs
00063         enum 
00064         { 
00065             kLUM_SET_DIMMER, 
00066             kLUM_GET_DIMMER, 
00067             kLUM_SET_RGB_FILTER_COLOR, 
00068             kLUM_GET_RGB_FILTER_COLOR, 
00069             kLUM_SET_USE_STATE, 
00070             kLUM_GET_USE_STATE, 
00071         }; 
00072     
00073 }; 
00074 
00075 #pragma warning(pop)
00076 // Luminaire interface ID
00077 #define LUMINAIRE_INTERFACE Interface_ID(0x7e631fe1, 0x7163389b)
00078 
00079 inline ILuminaire* GetLuminaireInterface(BaseInterface* baseIfc)    
00080 { 
00081     DbgAssert( baseIfc != NULL);
00082     return static_cast<ILuminaire*>(baseIfc->GetInterface(LUMINAIRE_INTERFACE));
00083 }
00084 
00085