HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 {
37 };
38 
39 // Autogenerate depth map return types
48 };
49 
51 {
52 public:
53  OBJ_Light(OP_Network *, const char *, OP_Operator *);
54  ~OBJ_Light() override;
55 
56  static PRM_Template *getObsolete();
57  static OP_Node *myConstructor(OP_Network *net,
58  const char *name, OP_Operator *entry);
59 
60  OBJ_OBJECT_TYPE getObjectType() const override;
61 
62  virtual int isObjectShadower(OBJ_Node *obj, fpreal t);
63  virtual int isSubnetShadower(OBJ_Node *subnet, fpreal t);
64  void updateLightValue(
65  fpreal t,
66  bool for_viewport = true) override;
67 
68  // The following method will create the "best" renderman shader possible
69  // for a light object.
70  void rmanBestShader(
71  UT_String &str, fpreal t) override;
72  void vexBestShader(
73  UT_String &str, fpreal t) override;
74  void vexBestShadow(
75  UT_String &str, fpreal t) override;
76 
78  PRM_ParmList *obsolete_parms) override;
79 
80  OP_Bundle *getShadowMaskBundle(fpreal t);
81 
82  void SHADOWTYPE(UT_String &str, fpreal t);
83  void SHADOWMASK(UT_String &str, fpreal t);
84  fpreal SHADOWINTENSITY(fpreal t);
85  fpreal SHADOWBIAS(fpreal t);
86  fpreal SHADOWBLUR(fpreal t);
87  fpreal SHADOWQUALITY(fpreal t);
88  void AUTOGEN(UT_String &str, fpreal t);
89  void DEPTHMAP(UT_String &str, fpreal t);
90  int DEPTHSAMPLEX(fpreal t);
91  int DEPTHSAMPLEY(fpreal t);
92  int DEPTHBLUR(fpreal t);
93  int DEEP(fpreal t);
94  void DEPTHQUANT(UT_String &str, fpreal t);
95  int MINMAX(fpreal t);
96  void DEEPSTYLE(UT_String &str, fpreal t);
97  void OFSTORAGE(UT_String &str, fpreal t);
98  void PZSTORAGE(UT_String &str, fpreal t);
99  int DEPTHCOMPRESSION(fpreal t);
100  fpreal DEPTHZBIAS(fpreal t);
101  int DEPTHOFSIZE(fpreal t);
102  void SPECMAP(UT_String &str, fpreal t);
103  void DIFFMAP(UT_String &str, fpreal t);
104  void PROJMAP(UT_String &str, fpreal t);
105  int CLAMP_PROJMAP(fpreal t);
106  int USEACTIVERADIUS(fpreal t);
107  int CONELIGHT(fpreal now);
108  fpreal CONEANGLE(fpreal t);
109  fpreal CONEDELTA(fpreal t);
110  fpreal CONEROLL(fpreal t);
111  void TATTEN(UT_String &str, fpreal t);
112  fpreal ATTEN(fpreal t);
113  fpreal SPREAD(fpreal t);
114  fpreal REFLECTX(fpreal t);
115  fpreal REFLECTY(fpreal t);
116  int DIFFUSE(fpreal t);
117  int SPECULAR(fpreal t);
118  int PHOTONDIRECT(fpreal t);
119  fpreal ENERGYR(fpreal t);
120  fpreal ENERGYG(fpreal t);
121  fpreal ENERGYB(fpreal t);
122  fpreal EXPONENT(fpreal t);
123  int CPHOTONSSTORE(fpreal t);
124  int CPHOTONSEMIT(fpreal t);
125  int GIPHOTONSSTORE(fpreal t);
126  int GIPHOTONSEMIT(fpreal t);
127  void AREASHAPE(UT_String &str, fpreal t);
128  fpreal AREASAMPLES(fpreal t);
129  fpreal AREASIZE(fpreal t);
130 
132 
133  void saveDialogScriptExtraInfo(std::ostream &os) override;
134 
135  OBJ_Light *castToOBJLight() override { return this; }
136 
140  const CH_ChannelList &channels) override;
143  UT_StringArray &names,
144  PRM_ParmNameMap &nmap) override;
145 
146 protected:
147  // Used to get pointer to indirection indices for each object type
148  int *getIndirect() const override
149  { return lightIndirect; }
150  const GU_Detail *getPortalGeometry(OP_Context &context,
151  const char *path,
152  UT_DMatrix4 &xform);
153 
154 private:
155  static int *lightIndirect;
156  char *mySavedProjectMap;
157 };
158 
159 #endif
GT_API const UT_StringHolder selection
OBJ_ParmsStyle
Definition: OBJ_Node.h:207
OBJ_LightAutogen
Definition: OBJ_Light.h:40
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int * getIndirect() const override
Definition: OBJ_Light.h:148
void saveDialogScriptExtraInfo(std::ostream &os) override
static PRM_Template * getObsolete()
OBJ_OBJECT_TYPE getObjectType() const override
OBJ_LightAreaShape
Definition: OBJ_Light.h:29
virtual void updateLightValue(fpreal t, bool for_viewport=true)
int collectPropertiesFromParms(PI_EditScriptedParms &editparms, UT_StringArray &names, PRM_ParmNameMap &nmap) override
GLuint const GLchar * name
Definition: glcorearb.h:786
int collectPropertiesFromChannels(PI_EditScriptedParms &editparms, UT_BitArray &selection, const CH_ChannelList &channels) override
virtual void vexBestShader(UT_String &str, fpreal t)=0
void resolveObsoleteParms(PRM_ParmList *obsolete_parms) override
GLdouble t
Definition: glad.h:2397
virtual void vexBestShadow(UT_String &str, fpreal t)=0
fpreal64 fpreal
Definition: SYS_Types.h:277
OBJ_LightIndex
Definition: OBJ_Light.h:22
static PRM_Template * getTemplateList()
OBJ_Light * castToOBJLight() override
Definition: OBJ_Light.h:135
#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:73
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)