HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_Geometry.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: Definition for geometry object
9  *
10  */
11 
12 #ifndef __OBJ_Geometry_h__
13 #define __OBJ_Geometry_h__
14 
15 #include "OBJ_API.h"
16 #include "OBJ_Node.h"
17 #include "OBJ_Shared.h"
18 
19 #include <DEP/DEP_MicroNode.h>
20 
21 class CHOP_Node;
22 class OP_Bundle;
23 
24 typedef enum {
30 
32 {
35  // Misc
39  I_N_GEO_INDICES // should always be last in the list
40 };
41 
42 #define INT_OBJ_PARM(name, idx, vi, t) \
43  return evalInt(name, &getIndirect()[idx], vi, t);
44 
46 {
47 public:
48  OBJ_Geometry(OP_Network *, const char *, OP_Operator *);
49  ~OBJ_Geometry() override;
50 
51  static PRM_Template *getObsolete();
52  static OP_Node *myConstructor(OP_Network *net,
53  const char *name, OP_Operator *entry);
54 
56  PRM_ParmList *obsolete_parms) override;
57 
58  void getShaderSpace(OP_Context &context,
59  UT_DMatrix4 &xform);
60  void getDisplacementSpace(UT_DMatrix4 &xform, fpreal t);
61  void getShaderSpace(OP_Context &context, UT_Matrix4 &xform);
62  void getDisplacementSpace(UT_Matrix4 &xform, fpreal t);
63 
64  OP_Bundle *getReflectBundle(fpreal t);
65 
66  // If you need to get the light mask bundle, check to make sure you don't
67  // actually want to get the list of light mask objects.
68  OP_Bundle *getLightMaskBundle(fpreal t);
69 
70  // getLightMaskObjects differs from getLightMaskBundle method in that it
71  // will expand light subnets and return the list of objects that will light
72  // this geo.
73  void getLightMaskObjects(OP_NodeList &lights, fpreal t);
74 
75  int isObjectLitBy(OBJ_Node *light,
76  fpreal t) override;
77  bool isLightInLightMask(const OBJ_Node *light,
78  fpreal now) override;
79  int isObjectLitBySubnet(OBJ_Node *subnet,
80  fpreal t) override;
81 
83  const UT_ValArray<OBJ_Ambient *> &lights,
85  fpreal t) override;
86 
87  /// Interface to manipulate object level parameters
89 
90  int doDrawLit() const override { return 1; }
91 
92  OBJ_OBJECT_TYPE getObjectType() const override;
93 
94  virtual CHOP_Node *getSoundMaterial(fpreal t);
95  static PRM_Template *getTemplateList(OBJ_ParmsStyle style);
96 
97  OBJ_Geometry *castToOBJGeometry() override { return this; }
98 
102  const CH_ChannelList &channels) override;
106  PRM_ParmNameMap &nmap) override;
107 
108  obj_OnionSkin getOnionSkin() override;
109 
110 protected:
111  // Used to get pointer to indirection indices for each object type
112  int *getIndirect() const override
113  { return geoIndirect; }
114 
115  GU_DetailHandle getBoundingBoxGeometryHandle(OP_Context &context);
116  GU_DetailHandle getBoundingSphereGeometryHandle(OP_Context &context);
117 
118  void buildParmDependency( int parm_index ) override;
119 
120  // Flags for Use Parent Parameter
121 public:
122  int SMOOTH(fpreal now);
123  int NOBACK(fpreal now);
124  void DETAIL(UT_String &str, fpreal t);
125  void DETAIL_FILE(UT_String &str, fpreal t);
126  void DETAIL_AUTOARCHIVE(UT_String &str, fpreal t);
127  void DETAIL_RIBPROC(UT_String &str, fpreal t);
128  void DETAIL_MANTRAPROC(UT_String &str, fpreal t);
129  int DETAIL_BLUR(fpreal t);
130  void DETAIL_MIN(fpreal *v, fpreal t);
131  void DETAIL_MAX(fpreal *v, fpreal t);
132  int AUTOREFLECT(fpreal t);
133  void REFLMAP(UT_String &str, fpreal t);
134  int REFLRES(fpreal t);
135  void LIGHTMASK(UT_String &str,fpreal t);
136  void REFLMASK(UT_String &str, fpreal t);
137  void RISHADER(UT_String &str, fpreal t);
138  void RIDISPLACE(UT_String &str, fpreal t);
139  void RIINTERIOR(UT_String &str, fpreal t);
140  bool INSTANCEGROUP(UT_String &str, fpreal now);
141  OBJ_PHOTON_MODE CAUSTICSMODE(fpreal t);
142  OBJ_PHOTON_MODE GLOBILLUMMODE(fpreal t);
143  int RI_COLOR(fpreal now);
144  void RI_CS(fpreal v[3], fpreal t);
145  void RI_OS(fpreal v[3], fpreal t);
146  void RI_PHOTON(UT_String &str, fpreal t);
147  bool SHADESPACE(UT_String &str, fpreal t);
148  bool DISPSPACE(UT_String &str, fpreal t);
149 
150  // This parameter in the Misc tab only exists for geometry objects.
151  int VPORT_SHADEOPEN() override
152  { INT_OBJ_PARM("vport_shadeopen",
153  I_VPORT_SHADEOPEN, 0, 0) }
154  int VPORT_DISPLAYASSUBDIV() override
155  { INT_OBJ_PARM("vport_displayassubdiv",
156  I_VPORT_DISPLAYASSUBDIV, 0, 0) }
157 
158  // method for building a menu containing primitive groups
160  int size,
161  const PRM_SpareData *spare,
162  const PRM_Parm *parm) override;
163 
164 private:
165  GU_DetailHandle myPopStandInGdpHandle;
166  int myShaderHint;
167 
168  DEP_MicroNode myOnionSkinDepNode;
169  int myOnionSkinState;
170 
171  static int *geoIndirect;
172 };
173 
174 #undef INT_OBJ_PARM
175 
176 #endif
GT_API const UT_StringHolder selection
int VPORT_DISPLAYASSUBDIV() override
Definition: OBJ_Geometry.h:154
OBJ_ParmsStyle
Definition: OBJ_Node.h:208
GLsizeiptr size
Definition: glew.h:1681
GLuint const GLchar * name
Definition: glew.h:1814
virtual int isObjectLitBySubnet(OBJ_Node *, fpreal)
Definition: OBJ_Node.h:952
int VPORT_SHADEOPEN() override
Definition: OBJ_Geometry.h:151
int * getIndirect() const override
Definition: OBJ_Geometry.h:112
virtual int collectPropertiesFromParms(PI_EditScriptedParms &editparms, UT_StringArray &names, PRM_ParmNameMap &nmap)
virtual OBJ_OBJECT_TYPE getObjectType() const =0
const GLdouble * v
Definition: glew.h:1391
virtual SOP_ObjectAppearancePtr getObjectAppearance()
int doDrawLit() const override
Definition: OBJ_Geometry.h:90
virtual bool isLightInLightMask(const OBJ_Node *light, fpreal now)
Function to resolve lighting based on light masks.
Definition: OBJ_Node.h:948
virtual int collectPropertiesFromChannels(PI_EditScriptedParms &editparms, UT_BitArray &selection, const CH_ChannelList &channels)
GLuint const GLuint * names
Definition: glew.h:2690
OBJ_PHOTON_MODE
Definition: OBJ_Geometry.h:24
void resolveObsoleteParms(PRM_ParmList *obsolete_parms) override
OBJ_GeoIndex
Definition: OBJ_Geometry.h:31
virtual int isObjectLitBy(OBJ_Node *, fpreal)
Definition: OBJ_Node.h:946
fpreal64 fpreal
Definition: SYS_Types.h:277
static void buildPrimitiveGroupMenu(void *o, PRM_Name *, int, const PRM_SpareData *, const PRM_Parm *)
virtual void buildParmDependency(int parm_index)
virtual void getActingLightSubset(const UT_ValArray< OBJ_Ambient * > &lights, UT_ValArray< OBJ_Ambient * > &active, fpreal t)
static PRM_Template * getObsolete()
#define OBJ_API
Definition: OBJ_API.h:10
#define INT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Geometry.h:42
GLdouble GLdouble t
Definition: glew.h:1398
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:74
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)
virtual obj_OnionSkin getOnionSkin()
Definition: OBJ_Node.h:727
OBJ_Geometry * castToOBJGeometry() override
Definition: OBJ_Geometry.h:97