HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GR_UpdateParms.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: GR_UpdateParms.h ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Parameter class containing all parameters for GR_Primitive::update()
10  * and GR_GeoRender::update().
11  * GR_ViewUpdateParms is a subset of these parameters sent to viewUpdate().
12  */
13 #ifndef GR_UpdateParms_h
14 #define GR_UpdateParms_h
15 
16 #include "GR_API.h"
17 #include "GR_Defines.h"
18 #include "GR_DisplayOption.h"
19 
20 #include <GU/GU_SelectType.h>
21 #include <GT/GT_RefineParms.h>
22 #include <GU/GU_DetailHandle.h>
23 #include <RE/RE_Material.h>
24 #include <RE/RE_CachedObject.h>
25 
26 #include <UT/UT_Matrix4.h>
27 #include <UT/UT_String.h>
28 
29 class OP_Node;
30 class UT_StringArray;
31 class UT_BitArray;
32 
33 /// set of parameters sent to GR_Primitive::update()
35 {
36 public:
37  GR_UpdateReason reason; // reason(s) for update
38  OP_Node *op_node; // node detail belongs to
39  GU_ConstDetailHandle geometry; // detail prim is processed for
40  const UT_IntArray &geo_indices; // DOP geometry indices selection
41  const GT_RefineParms &refine_parms; // GT refinement parms
42  const GR_DisplayOption &dopts; // current display options
43  const RE_MaterialAtlas &material_atlas; // new material list
44  const char *view_name; // full pathname of the viewer
45  int poly_mesh_limit; // max #polys in poly mesh
46  GU_SelectionHandle sel_override; // override selection
47 
48  GR_RenderVersion gl_version; // GL Renderer version (GL1,2,3)
49  RE_CacheVersion geo_version; // geometry serial version
50  RE_CacheVersion select_version; // selection serial version
51  RE_CacheVersion instance_version; // instanced geo serial verison
52  RE_CacheVersion view_version; // view frustum serial version
53  RE_CacheVersion inst_select_version; // Instance selection version
54  int instance_group; // Instancing group
55  const UT_Matrix4DArray *instances; // per-point instance transforms
56  // May be NULL if no instancing
57  const UT_BitArray *inst_select; // instance selection
58  const GR_FrustumList &visible_frustums; // frustums for visible viewports
59  bool object_selected; // true if selected at object lvl
60  GR_DecorationOverride required_dec; // decor required above user
61  // dispopt setting
62  unsigned force_wire:1, // must be wireframe
63  force_shaded:1, // must be smooth shaded
64  force_smooth:1, // ignore flat shading
65  build_bone_weights:2, // bone weight arrays for (0,1,2,3) -> (0,4,8,12) bones
66  build_selection:1,// allow selection to be built
67  build_prim_selection:1, // finer control of
68  build_point_selection:1, // selections to build
69  build_vertex_selection:1,// by type; build_selection
70  build_edge_selection:1, // must be true as well
71  build_bpoint_selection:1,
72  build_ids:1; // allow prim/vert ids to be built
73 
75  OP_Node *node,
76  const GU_ConstDetailHandle &dtl,
77  const UT_IntArray &geoi,
78  const RE_MaterialAtlas &material_atlas,
79  UT_StringArray *attribs,
80  const char *view_name,
81  int max_poly_mesh_size,
82  const GT_RefineParms &ref,
83  const GR_DisplayOption &d,
85  bool objselect,
86  GR_DecorationOverride req_dec,
87  RE_CacheVersion viewv,
88  const GR_FrustumList &view_frustums,
89  const UT_Matrix4DArray *insts,
90  int inst_grp,
91  RE_CacheVersion instv,
92  const UT_BitArray *inst_select,
93  RE_CacheVersion ints_select_version);
94 
96 
98  const GU_ConstDetailHandle &dtl);
99 
101  const RE_MaterialAtlas &atlas);
102  ~GR_UpdateParms();
103 
105  { return myNeededAttribs; }
107  {
108  UT_ASSERT(myAttribsCopied);
109  return myAttribsCopied ? myNeededAttribs : NULL;
110  }
111  void copyNeededAttribs(bool only_if_shallow_ref);
112  void setNeededAttribs(UT_StringArray *attribs, bool give_own);
113 
114  void printNeededAttribs(std::ostream *os = NULL) const;
115 private:
116  bool myAttribsCopied;
117  UT_StringArray *myNeededAttribs; // attribs needed for all shaders
118 };
119 
120 /// Set of parameters sent to GR_Primitive::viewUpdate().
122 {
123 public:
125  const GU_ConstDetailHandle &geo,
126  RE_CacheVersion geov,
127  RE_CacheVersion selv,
128  RE_CacheVersion viewv,
129  const GR_FrustumList &frustums)
130  : dopts(opt),
131  geometry(geo),
132  geo_version(geov),
133  select_version(selv),
134  view_version(viewv),
135  visible_frustums(frustums) {}
136 
137 
138  const GR_DisplayOption &dopts; // current display options
139  GU_ConstDetailHandle geometry; // detail prim is processed for
140  RE_CacheVersion geo_version; // geometry serial version
141  RE_CacheVersion select_version; // selection serial version
142  RE_CacheVersion view_version; // view frustum serial version
143  const GR_FrustumList &visible_frustums; // frustums of all open viewports
144  // stereo cams have 2/viewport
145 };
146 
147 #endif
GR_ViewUpdateParms(const GR_DisplayOption &opt, const GU_ConstDetailHandle &geo, RE_CacheVersion geov, RE_CacheVersion selv, RE_CacheVersion viewv, const GR_FrustumList &frustums)
const UT_StringArray * getConstNeededAttribs() const
const GR_FrustumList & visible_frustums
GR_DecorationOverride
Definition: GR_Defines.h:194
Set of parameters sent to GR_Primitive::viewUpdate().
GU_ConstDetailHandle geometry
RE_CacheVersion geo_version
OP_Node * op_node
const RE_MaterialAtlas & material_atlas
UT_StringArray * getNeededAttribs()
const GT_RefineParms & refine_parms
RE_CacheVersion select_version
const GR_DisplayOption & dopts
RE_CacheVersion view_version
RE_CacheVersion instance_version
GR_UpdateReason reason
set of parameters sent to GR_Primitive::update()
GR_RenderVersion gl_version
const GR_DisplayOption & dopts
RE_CacheVersion geo_version
const char * view_name
GLint ref
Definition: glcorearb.h:123
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
const UT_BitArray * inst_select
#define GR_API
Definition: GR_API.h:10
GR_UpdateReason
Definition: GR_Defines.h:278
RE_CacheVersion view_version
GR_RenderVersion
Definition: GR_Defines.h:19
RE_CacheVersion select_version
const GR_FrustumList & visible_frustums
GU_ConstDetailHandle geometry
const UT_IntArray & geo_indices
GR_DecorationOverride required_dec
Simple class for a mutli-integer cache tag.
RE_CacheVersion inst_select_version
GU_SelectionHandle sel_override
const UT_Matrix4DArray * instances