HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OBJ_Light.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OBJ library (C++)
7  *
8  * COMMENTS: Light object definition (base class for lights too)
9  *
10  */
11 
12 #ifndef __OBJ_Light_h__
13 #define __OBJ_Light_h__
14 
15 #include "OBJ_API.h"
16 #include "OBJ_Ambient.h"
17 
18 class obj_Scene;
19 class RE_Light;
20 class OP_Bundle;
21 
23 {
24  // Light
26 };
27 
28 // THIS ENUM MUST BE IN-SYNC WITH RE_LightAreaShape IN RE_Light.h.
30 {
36 };
37 
38 // Autogenerate depth map return types
47 };
48 
50 {
51 public:
52  OBJ_Light(OP_Network *, const char *, OP_Operator *);
53  virtual ~OBJ_Light();
54 
55  static PRM_Template *getObsolete();
56  static OP_Node *myConstructor(OP_Network *net,
57  const char *name, OP_Operator *entry);
58 
59  virtual OBJ_OBJECT_TYPE getObjectType() const;
60 
61  virtual int isObjectShadower(OBJ_Node *obj, fpreal t);
62  virtual int isSubnetShadower(OBJ_Node *subnet, fpreal t);
63  virtual void updateLightValue(fpreal t,
64  bool for_viewport = true);
65 
66  // The following method will create the "best" renderman shader possible
67  // for a light object.
68  virtual void rmanBestShader(UT_String &str, fpreal t);
69  virtual void vexBestShader(UT_String &str, fpreal t);
70  virtual void vexBestShadow(UT_String &str, fpreal t);
71 
72  virtual void resolveObsoleteParms(
73  PRM_ParmList *obsolete_parms);
74 
75  OP_Bundle *getShadowMaskBundle(fpreal t);
76 
77  void SHADOWTYPE(UT_String &str, fpreal t);
78  void SHADOWMASK(UT_String &str, fpreal t);
79  fpreal SHADOWINTENSITY(fpreal t);
80  fpreal SHADOWBIAS(fpreal t);
81  fpreal SHADOWBLUR(fpreal t);
82  fpreal SHADOWQUALITY(fpreal t);
83  void AUTOGEN(UT_String &str, fpreal t);
84  void DEPTHMAP(UT_String &str, fpreal t);
85  int DEPTHSAMPLEX(fpreal t);
86  int DEPTHSAMPLEY(fpreal t);
87  int DEPTHBLUR(fpreal t);
88  int DEEP(fpreal t);
89  void DEPTHQUANT(UT_String &str, fpreal t);
90  int MINMAX(fpreal t);
91  void DEEPSTYLE(UT_String &str, fpreal t);
92  void OFSTORAGE(UT_String &str, fpreal t);
93  void PZSTORAGE(UT_String &str, fpreal t);
94  int DEPTHCOMPRESSION(fpreal t);
95  fpreal DEPTHZBIAS(fpreal t);
96  int DEPTHOFSIZE(fpreal t);
97  void SPECMAP(UT_String &str, fpreal t);
98  void DIFFMAP(UT_String &str, fpreal t);
99  void PROJMAP(UT_String &str, fpreal t);
100  int CLAMP_PROJMAP(fpreal t);
101  int USEACTIVERADIUS(fpreal t);
102  int CONELIGHT(fpreal now);
103  fpreal CONEANGLE(fpreal t);
104  fpreal CONEDELTA(fpreal t);
105  fpreal CONEROLL(fpreal t);
106  void TATTEN(UT_String &str, fpreal t);
107  fpreal ATTEN(fpreal t);
108  fpreal SPREAD(fpreal t);
109  fpreal REFLECTX(fpreal t);
110  fpreal REFLECTY(fpreal t);
111  int DIFFUSE(fpreal t);
112  int SPECULAR(fpreal t);
113  int PHOTONDIRECT(fpreal t);
114  fpreal ENERGYR(fpreal t);
115  fpreal ENERGYG(fpreal t);
116  fpreal ENERGYB(fpreal t);
117  fpreal EXPONENT(fpreal t);
118  int CPHOTONSSTORE(fpreal t);
119  int CPHOTONSEMIT(fpreal t);
120  int GIPHOTONSSTORE(fpreal t);
121  int GIPHOTONSEMIT(fpreal t);
122  void AREASHAPE(UT_String &str, fpreal t);
123  fpreal AREASAMPLES(fpreal t);
124  fpreal AREASIZE(fpreal t);
125 
127 
128  virtual void saveDialogScriptExtraInfo(std::ostream &os);
129 
130  virtual OBJ_Light *castToOBJLight() { return this; }
132  UT_BitArray &selection,
133  const CH_ChannelList &channels);
135  UT_StringArray &names,
136  PRM_ParmNameMap &nmap);
137 
138 protected:
139  // Used to get pointer to indirection indices for each object type
140  virtual int *getIndirect() const
141  { return lightIndirect; }
142  const GU_Detail *getPortalGeometry(OP_Context &context,
143  const char *path,
144  UT_DMatrix4 &xform);
145 
146 private:
147  static int *lightIndirect;
148  char *mySavedProjectMap;
149  fpreal mySavedConeRoll;
150  fpreal mySavedConeAngle;
151  fpreal mySavedConeDelta;
152  unsigned mySavedConeOn:1;
153 };
154 
155 #endif
OBJ_ParmsStyle
Definition: OBJ_Node.h:204
virtual void saveDialogScriptExtraInfo(std::ostream &os)
OBJ_LightAutogen
Definition: OBJ_Light.h:39
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
virtual int collectPropertiesFromParms(PI_EditScriptedParms &editparms, UT_StringArray &names, PRM_ParmNameMap &nmap)
static PRM_Template * getObsolete()
virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms) override
virtual OBJ_Light * castToOBJLight()
Definition: OBJ_Light.h:130
OBJ_LightAreaShape
Definition: OBJ_Light.h:29
virtual void updateLightValue(fpreal t, bool for_viewport=true)
virtual int * getIndirect() const
Definition: OBJ_Light.h:140
virtual OBJ_OBJECT_TYPE getObjectType() const
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual void vexBestShader(UT_String &str, fpreal t)=0
virtual void vexBestShadow(UT_String &str, fpreal t)=0
double fpreal
Definition: SYS_Types.h:263
OBJ_LightIndex
Definition: OBJ_Light.h:22
static PRM_Template * getTemplateList()
virtual int collectPropertiesFromChannels(PI_EditScriptedParms &editparms, UT_BitArray &selection, const CH_ChannelList &channels)
#define OBJ_API
Definition: OBJ_API.h:10
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
virtual void rmanBestShader(UT_String &str, fpreal t)=0
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:70