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  virtual ~OBJ_Geometry();
50 
51  static PRM_Template *getObsolete();
52  static OP_Node *myConstructor(OP_Network *net,
53  const char *name, OP_Operator *entry);
54 
55  virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms);
56 
57  void getShaderSpace(OP_Context &context,
58  UT_DMatrix4 &xform);
59  void getDisplacementSpace(UT_DMatrix4 &xform, fpreal t);
60  void getShaderSpace(OP_Context &context, UT_Matrix4 &xform);
61  void getDisplacementSpace(UT_Matrix4 &xform, fpreal t);
62 
63  OP_Bundle *getReflectBundle(fpreal t);
64 
65  // If you need to get the light mask bundle, check to make sure you don't
66  // actually want to get the list of light mask objects.
67  OP_Bundle *getLightMaskBundle(fpreal t);
68 
69  // getLightMaskObjects differs from getLightMaskBundle method in that it
70  // will expand light subnets and return the list of objects that will light
71  // this geo.
72  void getLightMaskObjects(OP_NodeList &lights, fpreal t);
73 
74  virtual int isObjectLitBy(OBJ_Node *light, fpreal t);
75  virtual bool isLightInLightMask(const OBJ_Node *light, fpreal now);
76  virtual int isObjectLitBySubnet(OBJ_Node *subnet, fpreal t);
77 
78  virtual void getActingLightSubset(
79  const UT_ValArray<OBJ_Ambient *> &lights,
81  fpreal t);
82 
83  /// Interface to manipulate object level parameters
85 
86  virtual int doDrawLit() const { return 1; }
87 
88  virtual OBJ_OBJECT_TYPE getObjectType() const;
89 
90  virtual CHOP_Node *getSoundMaterial(fpreal t);
91  static PRM_Template *getTemplateList(OBJ_ParmsStyle style);
92 
93  virtual OBJ_Geometry*castToOBJGeometry() { return this; }
94 
97  const CH_ChannelList &channels);
99  UT_StringArray &names,
100  PRM_ParmNameMap &nmap);
101 
102  virtual obj_OnionSkin getOnionSkin();
103 
104 protected:
105  // Used to get pointer to indirection indices for each object type
106  virtual int *getIndirect() const
107  { return geoIndirect; }
108 
109  GU_DetailHandle getBoundingBoxGeometryHandle(OP_Context &context);
110  GU_DetailHandle getBoundingSphereGeometryHandle(OP_Context &context);
111 
112  virtual void buildParmDependency( int parm_index );
113 
114  // Flags for Use Parent Parameter
115 public:
116  int SMOOTH(fpreal now);
117  int NOBACK(fpreal now);
118  void DETAIL(UT_String &str, fpreal t);
119  void DETAIL_FILE(UT_String &str, fpreal t);
120  void DETAIL_AUTOARCHIVE(UT_String &str, fpreal t);
121  void DETAIL_RIBPROC(UT_String &str, fpreal t);
122  void DETAIL_MANTRAPROC(UT_String &str, fpreal t);
123  int DETAIL_BLUR(fpreal t);
124  void DETAIL_MIN(fpreal *v, fpreal t);
125  void DETAIL_MAX(fpreal *v, fpreal t);
126  int AUTOREFLECT(fpreal t);
127  void REFLMAP(UT_String &str, fpreal t);
128  int REFLRES(fpreal t);
129  void LIGHTMASK(UT_String &str,fpreal t);
130  void REFLMASK(UT_String &str, fpreal t);
131  void RISHADER(UT_String &str, fpreal t);
132  void RIDISPLACE(UT_String &str, fpreal t);
133  void RIINTERIOR(UT_String &str, fpreal t);
134  bool INSTANCEGROUP(UT_String &str, fpreal now);
135  OBJ_PHOTON_MODE CAUSTICSMODE(fpreal t);
136  OBJ_PHOTON_MODE GLOBILLUMMODE(fpreal t);
137  int RI_COLOR(fpreal now);
138  void RI_CS(fpreal v[3], fpreal t);
139  void RI_OS(fpreal v[3], fpreal t);
140  void RI_PHOTON(UT_String &str, fpreal t);
141  bool SHADESPACE(UT_String &str, fpreal t);
142  bool DISPSPACE(UT_String &str, fpreal t);
143 
144  // This parameter in the Misc tab only exists for geometry objects.
145  virtual int VPORT_SHADEOPEN()
146  { INT_OBJ_PARM("vport_shadeopen",
147  I_VPORT_SHADEOPEN, 0, 0) }
148  virtual int VPORT_DISPLAYASSUBDIV()
149  { INT_OBJ_PARM("vport_displayassubdiv",
150  I_VPORT_DISPLAYASSUBDIV, 0, 0) }
151 
152  // method for building a menu containing primitive groups
153  virtual void buildPrimitiveGroupMenu(PRM_Name *menu,
154  int size,
155  const PRM_SpareData *spare,
156  const PRM_Parm *parm);
157 
158 private:
159  GU_DetailHandle myPopStandInGdpHandle;
160  int myShaderHint;
161 
162  DEP_MicroNode myOnionSkinDepNode;
163  int myOnionSkinState;
164 
165  static int *geoIndirect;
166 };
167 
168 #undef INT_OBJ_PARM
169 
170 #endif
GT_API const UT_StringHolder selection
OBJ_ParmsStyle
Definition: OBJ_Node.h:205
virtual int isObjectLitBySubnet(OBJ_Node *, fpreal)
Definition: OBJ_Node.h:942
const GLdouble * v
Definition: glcorearb.h:836
virtual int collectPropertiesFromParms(PI_EditScriptedParms &editparms, UT_StringArray &names, PRM_ParmNameMap &nmap)
virtual OBJ_OBJECT_TYPE getObjectType() const =0
virtual SOP_ObjectAppearancePtr getObjectAppearance()
GLsizeiptr size
Definition: glcorearb.h:663
virtual OBJ_Geometry * castToOBJGeometry()
Definition: OBJ_Geometry.h:93
virtual bool isLightInLightMask(const OBJ_Node *light, fpreal now)
Function to resolve lighting based on light masks.
Definition: OBJ_Node.h:938
virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms) override
virtual int collectPropertiesFromChannels(PI_EditScriptedParms &editparms, UT_BitArray &selection, const CH_ChannelList &channels)
OBJ_PHOTON_MODE
Definition: OBJ_Geometry.h:24
virtual int * getIndirect() const
Definition: OBJ_Geometry.h:106
GLuint const GLchar * name
Definition: glcorearb.h:785
OBJ_GeoIndex
Definition: OBJ_Geometry.h:31
virtual int doDrawLit() const
Definition: OBJ_Geometry.h:86
double fpreal
Definition: SYS_Types.h:270
virtual int isObjectLitBy(OBJ_Node *, fpreal)
Definition: OBJ_Node.h:936
static void buildPrimitiveGroupMenu(void *o, PRM_Name *, int, const PRM_SpareData *, const PRM_Parm *)
virtual int VPORT_DISPLAYASSUBDIV()
Definition: OBJ_Geometry.h:148
virtual void buildParmDependency(int parm_index)
virtual void getActingLightSubset(const UT_ValArray< OBJ_Ambient * > &lights, UT_ValArray< OBJ_Ambient * > &active, fpreal t)
virtual int VPORT_SHADEOPEN()
Definition: OBJ_Geometry.h:145
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
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:71
virtual obj_OnionSkin getOnionSkin()
Definition: OBJ_Node.h:717