HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_Primitive.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_Primitive.h ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Base class for all primitives that Houdini is natively capable of
10  * rendering with OpenGL.
11  */
12 #ifndef GR_PRIMITIVE_H
13 #define GR_PRIMITIVE_H
14 
15 class RE_Geometry;
16 class RE_Render;
17 class GR_GeoRender;
18 class GR_DisplayOption;
20 class GT_Primitive;
21 
22 #include <SYS/SYS_AtomicInt.h>
23 #include <UT/UT_Array.h>
24 #include <UT/UT_IntrusivePtr.h>
25 #include <UT/UT_String.h>
26 #include <RE/RE_Types.h>
27 #include <GEO/GEO_PrimTypeCompat.h>
28 #include <GT/GT_Types.h>
29 #include <GT/GT_PrimitiveTypes.h>
30 #include <GT/GT_Handles.h>
31 #include <GT/GT_GEOPrimitive.h>
32 #include <GU/GU_Detail.h>
33 #include "GR_Defines.h"
34 #include "GR_DecorationRender.h"
35 #include "GR_DrawParms.h"
36 #include "GR_ErrorManager.h"
37 #include "GR_PickSelection.h"
38 #include "GR_PickRender.h"
39 #include "GR_UpdateParms.h"
40 #include "GR_API.h"
41 
42 class GA_Primitive;
43 class GA_PointGroup;
44 class GA_EdgeGroup;
45 class GA_PrimitiveGroup;
46 class OP_Node;
47 class GT_RefineParms;
48 class GR_DisplayOption;
50 class GR_RenderInfo;
51 class GEO_Primitive;
52 
54 {
55 public:
56  /// Return a string version of this class's name
57  virtual const char *className() const = 0;
58 
59  /// The cache name is assigned to this primitive by the viewport. It can be
60  /// used as a base name for multiple objects by adding a suffix, but do not
61  /// change the base name. Returns true if the name changed.
62  bool setCacheName(const char *cache_name);
63 
64  /// returns true if the given GT primitive can be rendered by this primitive
65  /// if t==GT_GEO_PRIMITIVE, geo_type will be the geo type id and prim will
66  /// be non-NULL. If t is any other type, ph will be a valid GT primitive.
67  /// The primitives themselves can be used for more sophisticated matching.
68  virtual GR_PrimAcceptResult acceptPrimitive(GT_PrimitiveType t,
69  int geo_type,
70  const GT_PrimitiveHandle &ph,
71  const GEO_Primitive *prim) = 0;
72 
73  /// This is called if this primitive is collecting multiple GEO or GT
74  /// primitives. It will be called just before the viewport starts iterating
75  /// through the primitives. The GR_Primitive should clear its list of
76  /// collected primitive IDs.
77  virtual void resetPrimitives() {}
78 
79  /// The base primitive type is usually NORMAL unless this is a packed type.
81  { return GR_BASE_PRIM_NORMAL; }
82 
83  /// Returns the contained instance prim. Will only be valid if
84  /// getBasePrimType() is not GR_BASE_PRIM_NORMAL.
86  { return GT_PrimitiveHandle(); }
87 
88  /// returns true if this primitive's type mask is part of "mask".
90  { return bool(mask & myGAPrimMask); }
91 
92 
93  virtual void checkForDeferredDraw(const RE_Render *r,
96  const GR_DrawParms &dp,
97  const UT_Matrix4D &proj_view,
98  const UT_Matrix4D &object,
99  const UT_Vector2F &min_proj_size,
100  bool &visible,
101  bool &defer);
102 
104  {
107  DISPLAY_VERSION_CHANGED
108  };
109 
110  /// Called when the geometry-related display options change, to determine if
111  /// an update is required. By default, no update is required. If the options
112  /// did change, return either DISPLAY_CHANGED, which will call update()
113  /// without bumping the display option version, or DISPLAY_VERSION_CHANGED,
114  /// which will bump the version.
115  GR_DispOptChange checkDisplayOptionChange(const GR_DisplayOption &opts);
116 
117 
118  /// If this primitive requires an update when the view changes, return true.
119  virtual bool updateOnViewChange(const GR_DisplayOption &) const
120  { return false; }
121 
122  /// called every time the metacount version is bumped on the GU_Detail.
123  void updatePrim(RE_Render *r,
124  const GT_PrimitiveHandle &primh,
125  const GR_UpdateParms &parms);
126 
127  /// If updateOnViewChange() returns true, this is called when the view
128  /// changes.
129  virtual void viewUpdate(RE_Render *r,
130  const GR_ViewUpdateParms &parms)
131  {}
132 
133  /// Update an array on the specified instance group. If instance group is
134  /// -1, array->getInstanceGroup() must specify a valid instance group.
135  /// If 'array' is null, it will be removed from the instances but
136  /// you must specify the instance_group and attrib_name.
137  virtual void updateInstanceGroup(const RE_VertexArray *array,
138  int instance_group = -1,
139  const char *attrib_name = NULL,
142 
143  /// For primitives that may need updating if the GL state changes, this
144  /// hook allows you to perform a check if no update is otherwise required.
145  /// Return true to have checkGLState() called. Returning true from that
146  /// will trigger an update.
147  /// @{
148  virtual bool needsGLStateCheck(const GR_DisplayOption &opts) const
149  { return false; }
150  virtual bool checkGLState(RE_Render *r,const GR_DisplayOption &opts)
151  { return false; }
152  /// @}
153 
154  /// Main render call, which can be called several times in a redraw with
155  /// different render modes. Calls render to do the real work specialized
156  /// for each primitive type.
157  void draw(RE_Render *r,
158  GR_RenderMode render_mode,
159  GR_RenderFlags render_flags,
160  GR_DrawParms parms);
161 
162  /// Picking version of draw(). Calls renderPick to do the real work
163  /// specialized for each primitive type.
164  int drawPick(RE_Render *r,
165  const GR_DisplayOption *opt,
166  unsigned int pick_type,
167  GR_PickStyle pick_style,
168  bool has_pick_map);
169 
170  /// Called just before drawing our first decoration.
171  virtual void setupDrawDecorations(RE_Render *r);
172  /// Decoration version of draw(). Calls renderDecoration to do the real
173  /// work specialized for each primitive type.
174  void drawDecoration(RE_Render *r,
175  GR_Decoration decor,
176  const GR_DecorationParms &parms);
177 
178  /// called once per viewport draw, setup() before any renders are done, and
179  /// cleanup() after all are complete. There is a possibility that render()
180  /// may not be called at all.
181  /// @{
182  virtual bool setup(const GR_DisplayOption *)
183  { return true; }
184  virtual void cleanup(RE_Render *r) {}
185  /// @}
186 
187 
188  /// return true if the primitive is in or overlaps the view frustum.
189  /// always returning true will effectively disable frustum culling.
190  /// bbox is an option bounding box which can be used for frustum testing.
191  virtual bool inViewFrustum(const UT_Matrix4D &objviewproj,
192  const UT_BoundingBoxD *bbox = nullptr)
193  { return true; }
194 
195  /// Similar to inViewFrustum, but also considers if the prim is too small
196  /// to render in the viewport. Also uses 32b FP precision for speed.
197  virtual bool isRasterizedInView(const UT_Matrix4F &objviewproj,
198  const UT_Vector2F &min_proj_size,
199  const UT_BoundingBoxF *bbox=nullptr);
200 
201  /// Return a bitfield of what decorations are supported by this primitive.
202  /// Set bit (1 << GR_Decoration) if that decoration is supported.
203  /// Not all primitives will support all decorations.
204  int64 supportedDecorations() { return myDecorMask; }
205 
206  /// Return true if this primitive supports drawing into a UV viewport.
207  virtual bool supportsRenderUV();
208 
209  /// Return true if this primitive requires an alpha pass.
210  virtual bool requiresAlphaPass() const { return false; }
211 
212  /// Return true if this should be drawn in the given alpha pass.
214  { return myAlphaPassMask & alpha; }
215 
216  /// Return true if this primitive renders in the specified alpha pass.
217  virtual bool renderInAlphaPass(GR_AlphaPass a);
218 
219  /// Returns the bounding box of this primitive if it can be determined.
220  virtual bool getBoundingBox(UT_BoundingBoxD &bbox) const
221  { return false; }
222 
223  // this is assigned by updatePrim() and should not generally be overriden.
225  { myAlphaPassMask = mask; }
226  int getAlphaPassMask() const
227  { return myAlphaPassMask; }
228 
229  /// Return the GA_Primitive corresponding to this primitive. Some
230  /// rendering primitives may be comprised of multiple GA/GU primitives.
231  /// The @c id parameter (corresponding to the @c __primitive_id attribute)
232  /// can be used to extract a specific primitive.
233  virtual const GA_Primitive *getGAPrimitive(const GU_Detail *gdp,
234  exint primitive_id) const;
235 
236  /// Find the vertex offset for a given vertex id. The integer returned
237  /// corresponds with the GA_Offset for the given vertex. If the vertex_id
238  /// is invalid, the method will return -1.
239  virtual exint getGAVertex(const GU_Detail *gdp,
240  exint vertex_id) const;
241 
242  /// Return the actual or estimated number of GL primitive that this
243  /// primitive will be rendering.
244  virtual exint getNumGLPrimitives(const GR_DisplayOption *);
245 
246  /// The GL render version to use for this primitive
247  GR_RenderVersion getRenderVersion() const;
248 
249  /// whether to display component selections or not.
250  bool showSelections() const;
251 
252  /// Instancing matrix list and version (for the vertex array)
253  bool canDoInstancing() const;
254 
255  /// Returns true if the full object is selected at the scene level.
256  bool isObjectSelection() const;
257 
258  /// Returns the current display option version for this primitive.
259  /// It will only be non-zero if the primitive responds to display option
260  /// changes and bumps the display option version.
262  { return myDispOptVersion; }
263 
265  {
266  myDispOptVersion++;
267  return myDispOptVersion;
268  }
269 
270  /// GT Primitive caching. This is handled by updatePrim()
271  /// @{
272  GT_PrimitiveHandle getCachedGTPrimitive() { return myCachedPrim; }
274  {
275  if(prim)
276  {
277  if(prim != myCachedPrim)
278  myCachedPrim = prim;
279  }
280  else
281  myCachedPrim = NULL;
282  }
283 
284  /// @}
285 
286  /// Called when a node is no longer actively displayed, but still cached
287  virtual void retirePrimitive();
288 
289  /// return the RE_Geometry containing the geometry to be decorated by user
290  /// display options. May return NULL if no user decorations are to be shown.
291  virtual RE_Geometry *getDecorationGeometry() { return NULL; }
292 
293  /// Only for the Scene Graph view: highlighted prims.
294  virtual bool isHighlighted() const { return false; }
295 
296  /// create a primitive for the given GT type, with appropriate cache name
297  /// and GL render level
298  static GR_Primitive *createPrimitive(GT_PrimitiveType ptype,
299  int geo_type,
300  const GR_RenderInfo *info,
301  const char *cache_name);
302 
303  void setPrimUsed(bool used) { myPrimUsed = used; }
304  bool isPrimUsed() const { return myPrimUsed; }
305 
306  /// set for those primitives that are within packed primitives
308  { myParentPrimType = type; }
310  { return myParentPrimType; }
311 
312  const GR_RenderInfo *getRenderInfo() const { return myInfo; }
313 
314  virtual void getGeoRenders(UT_Array<GR_GeoRender *> &renders) {}
315 
316  void addUpdateMessage(GR_ErrorManager::Source err_source,
317  GR_ErrorCode gr_code,
318  UT_StringHolder extra_text=UT_StringHolder(),
319  UT_StringHolder src_name=UT_StringHolder());
320  void addUpdateWarning(GR_ErrorManager::Source err_source,
321  GR_ErrorCode gr_code,
322  UT_StringHolder extra_text=UT_StringHolder(),
323  UT_StringHolder src_name=UT_StringHolder());
324  void addUpdateError (GR_ErrorManager::Source err_source,
325  GR_ErrorCode gr_code,
326  UT_StringHolder extra_text=UT_StringHolder(),
327  UT_StringHolder src_name=UT_StringHolder());
328  void addUpdateFatal (GR_ErrorManager::Source err_source,
329  GR_ErrorCode gr_code,
330  UT_StringHolder extra_text=UT_StringHolder(),
331  UT_StringHolder src_name=UT_StringHolder());
332 
333  void addRedrawMessage(GR_ErrorManager::Source err_source,
334  GR_ErrorCode gr_code,
335  UT_StringHolder extra_text=UT_StringHolder(),
336  UT_StringHolder src_name=UT_StringHolder());
337  void addRedrawWarning(GR_ErrorManager::Source err_source,
338  GR_ErrorCode gr_code,
339  UT_StringHolder extra_text=UT_StringHolder(),
340  UT_StringHolder src_name=UT_StringHolder());
341  void addRedrawError (GR_ErrorManager::Source err_source,
342  GR_ErrorCode gr_code,
343  UT_StringHolder extra_text=UT_StringHolder(),
344  UT_StringHolder src_name=UT_StringHolder());
345  void addRedrawFatal (GR_ErrorManager::Source err_source,
346  GR_ErrorCode gr_code,
347  UT_StringHolder extra_text=UT_StringHolder(),
348  UT_StringHolder src_name=UT_StringHolder());
349 
350  /// The base GL cache name assigned to this primitive.
351  const char * getCacheName() const { return myCacheName; }
352 
353  // For reference counted GR prims only
354  void incref() { myRef.add(1); }
355  void decref()
356  {
357  if( myRef.add(-1) == 0)
358  delete this;
359  }
360 
361 protected:
362  /// Primitive constructor. info and cache_name are assigned by the viewport.
363  /// GR_Primitive subclasses can assign a typemask which is used to determine
364  /// if the primitive is rendered in instances where only a subset of
365  /// primitive types is requested.
366  GR_Primitive(const GR_RenderInfo *info,
367  const char *cache_name,
368  GEO_PrimTypeCompat::TypeMask gaprimtype);
369 
370  virtual ~GR_Primitive();
371 
372 
373  /// Called when the geometry-related display options change, to determine if
374  /// an update is required. By default, no update is required. If the options
375  /// did change, return either DISPLAY_CHANGED, which will call update()
376  /// without bumping the display option version, or DISPLAY_VERSION_CHANGED,
377  /// which will bump the version.
378  /// If 'first_init' is true, this is being called to initialize any cached
379  /// display options. The return value will be ignored. This will happen
380  /// just after the primitive is created.
381  virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts,
382  bool first_init);
383 
384  /// Main update method, called when conditions change which may require the
385  /// geometry to be updated. These include geometry changes, selections,
386  /// volatile display options (level of detail), instancing updates,
387  /// and some GL state changes (if needsGLStateCheck returns true)
388  virtual void update(RE_Render *r,
389  const GT_PrimitiveHandle &primh,
390  const GR_UpdateParms &p) = 0;
391 
392  /// Main drawing method. update() will always be called before render(), but
393  /// render() may execute multiple times before the next update call. This
394  /// method should be fairly lightweight; do as much work in update() as
395  /// possible. There is no access to the GU_Detail from this method.
396  virtual void render(RE_Render *r,
397  GR_RenderMode render_mode,
399  GR_DrawParms dp) = 0;
400 
401  /// Render this primitive for picking, where pick_type is defined as one of
402  /// the pickable bits in GU_SelectType.h (like GR_PICK_GEOPOINT)
403  /// return the number of picks
404  virtual int renderPick(RE_Render *r,
405  const GR_DisplayOption *opt,
406  unsigned int pick_type,
407  GR_PickStyle pick_style,
408  bool has_pick_map) = 0;
409 
410  /// Render the attributes required for decoration 'decor' (like point
411  /// markers, uv text, normals, etc). 'overlay' should be set to true if
412  /// currently rendering in the overlay texture, false if in the main
413  /// viewport.
414  virtual void renderDecoration(RE_Render *r,
415  GR_Decoration decor,
416  const GR_DecorationParms &parms);
417 
418  /// Check if the builtin Houdini markers (point numbers, profile curves,
419  /// prim normals, etc) have changed since the last redraw, and return true
420  /// if at least one did. 'markers' is a list of markers to check that must
421  /// be terminated by GR_NO_DECORATION.
422  bool standardMarkersChanged(const GR_DisplayOption &opts,
423  const GR_Decoration *markers,
424  bool first_init);
425 
426  /// Updates a decoration for the pass RE_Geometry object. Called from
427  /// update().
428  void updateDecoration(RE_Render *r,
429  GR_Decoration dec,
430  const GR_UpdateParms &p,
431  const GT_PrimitiveHandle &prim,
432  RE_Geometry *geo);
433 
434  /// Helper mother to draw a decoration on a given GR_GeoRender object.
435  /// Called from renderDecoration() or render().
436  void drawDecoration(RE_Render *r,
437  GR_GeoRender *geo,
438  GR_Decoration dec,
439  const GR_DisplayOption *opts,
441  bool overlay,
442  bool override_vis,
443  int instance_group = -1,
444  GR_SelectMode *select_override = NULL,
447 
448  void drawVisualizer(RE_Render *r,
449  GR_GeoRender *geo,
450  const GR_VisualizerInfo *dec_info,
451  const GR_DisplayOption *opts,
455 
456 
457  /// Helper method to draw a decoration on a given RE_Geometry object.
458  /// Called from renderDeocration() or render().
459  void drawDecorationForGeo(RE_Render *r,
460  RE_Geometry *geo,
461  GR_Decoration dec,
462  const GR_DisplayOption *opts,
464  bool overlay,
465  bool override_vis,
466  int instance_group,
467  GR_SelectMode smode,
470  RE_OverrideList *override_list = NULL);
471 
472  void drawVisualizerForGeo(RE_Render *r,
473  RE_Geometry *geo,
474  const GR_VisualizerInfo *dec_info,
475  const GR_DisplayOption *opts,
479 
480 
481  /// Helper method to draw a GR_GeoRender object. Called from render() or
482  /// renderDecoration().
483  void drawGeoRender(RE_Render *r,
484  GR_GeoRender *geo,
487  GR_DrawParms dp);
488  bool checkUserOptions(const GR_DisplayOption &opt) const;
489  void updateUserOptions(const GR_DisplayOption &opt);
490  const GR_UserOption *getUserDecoration(GR_Decoration dec) const;
491  void updateUserDecorations(RE_Render *r,
492  const GT_PrimitiveHandle &primh,
493  const GR_UpdateParms &p,
494  RE_Geometry *for_geo = NULL);
495 
496  GR_DispOptChange checkColorOverride(const GR_DisplayOption &opts,
497  bool first_init);
498 
499  GT_Primitive *createUnitSphere(const GT_RefineParms &parms);
500 
501 
502 
503  /// Return a GEO_Primitive derivative (GeoPrim) from the GT handle. The
504  /// GT handle must be referencing a GT_GEOPrimitive.
505  template <class GeoPrim>
507  const GeoPrim *&prim)
508  {
509  const GT_GEOPrimitive *geo =
510  dynamic_cast<const GT_GEOPrimitive*>(primh.get());
511  prim = dynamic_cast<const GeoPrim *>(geo->getPrimitive(0));
512  }
513 
514  /// Create a pick buffer large enough to hold all picks from 'geo' with
515  /// 'picktype' selection style (GR_PICK_GEOPOINT, PRIMITIVE, etc)
516  /// The required vector size (1 or 2) will be returned in vsize (edges need
517  /// 2) and needs_2pass will be true if some picks require CPU support.
518  int getPickBufferSize(RE_Geometry *geo,
519  unsigned int picktype,
520  int &vector_size,
521  bool &needs_2pass,
522  int start_group = 4,
523  int end_group = -1,
524  GR_PickStyle pickstyle
525  = GR_PICK_NONE) const;
526 
527  /// creates a ivec4 pick buffer with a pickID attribute with buffer_size
528  /// points. This primitive owns the buffer, and there is only one.
529  RE_Geometry *createPickBuffer(RE_Render *r, int buffer_size,
530  int vector_size = 1,
531  bool inconclusive_stream_too = false);
532 
533  /// accumulate picks into the myInfo.myPicks array so that it can be passed
534  /// up to higher level code. Some effort is made to remove duplicate pickIDs,
535  /// mostly from neighbouring picks. If 'pick_buffer' is NULL, myPickBuffer
536  /// is used.
537  int accumulatePickIDs(RE_Render *r, int npicks,
538  RE_Geometry *pick_buffer = NULL);
539 
540  GR_PickCompMode setupPrimPickMode(RE_Render *r,GR_GeoRender *geo) const;
541 
542 
544  { myGAPrimMask = m; }
545 
547  { myDecorMask = mask; }
548 
552 
553  // For deferred rendering
558 
559 private:
560  UT_String myCacheName;
561  UT_Int64Array myUserDispOptions;
562  int32 myDispOptVersion;
563  GEO_PrimTypeCompat::TypeMask myGAPrimMask;
564  UT_String myColorOverrideOpt;
565  unsigned myPrimUsed : 1,
566  myUserDecorationsProcessed : 1,
567  myDispOptInit : 1;
568  GR_BasePrimType myParentPrimType;
569 
570  // for cache access only; do not dereference.
571  GT_PrimitiveHandle myCachedPrim;
572 
573  int myMarkerState[GR_MAX_DECORATIONS];//0=off,1=on,-1=undef
574  int64 myDecorMask;
575  SYS_AtomicInt32 myRef;
576  int myAlphaPassMask;
577 
578  // uncached buffer for doing transform feedback picking
579  RE_Geometry *myPickBuffer;
580 
581 };
582 
584 static inline void intrusive_ptr_add_ref(GR_Primitive *pr) { pr->incref(); }
585 static inline void intrusive_ptr_release(GR_Primitive *pr) { pr->decref(); }
586 
589 {
590  GR_DispOptChange changed = displayOptionChange(opts, !myDispOptInit);
591 
592  myDispOptInit = true;
593 
594  return changed;
595 }
596 
597 inline void
599  const GT_PrimitiveHandle &primh,
600  const GR_UpdateParms &p)
601 {
603  myCachedPrim = primh;
605  rlock.isValid() ? rlock->findPointAttribute("N") != NULL : false;
606  myUserDecorationsProcessed = false;
607 
608  if(!myDispOptInit)
609  {
610  displayOptionChange(p.dopts, true);
611  myDispOptInit = true;
612  }
613 
614  update(r, primh, p);
615 
617  myAlphaPassMask = GR_ALPHA_PASS_OPAQUE;
618  else
619  myAlphaPassMask = 0;
620 
622  myAlphaPassMask |= GR_ALPHA_PASS_NORMAL;
623 
624  updateUserDecorations(r, primh, p);
625 }
626 
627 inline void
629  GR_Decoration dec,
630  const GR_UpdateParms &p,
631  const GT_PrimitiveHandle &prim,
632  RE_Geometry *geo)
633 {
634  // Don't draw decorations for packed primitives
638  return;
639 
640  myDecorRender->updateDecoration(r, dec, *prim.get(), p, *geo);
641 }
642 
643 #endif
Base class for many of the GEO_Primitive objects.
virtual bool inViewFrustum(const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr)
Definition: GR_Primitive.h:191
UT_Matrix4D myLocal
Definition: GR_Primitive.h:555
void updatePrim(RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &parms)
called every time the metacount version is bumped on the GU_Detail.
Definition: GR_Primitive.h:598
virtual bool updateOnViewChange(const GR_DisplayOption &) const
If this primitive requires an update when the view changes, return true.
Definition: GR_Primitive.h:119
bool typeMask(GEO_PrimTypeCompat::TypeMask mask) const
returns true if this primitive's type mask is part of "mask".
Definition: GR_Primitive.h:89
int32 getDisplayOptionVersion() const
Definition: GR_Primitive.h:261
virtual bool requiresAlphaPass() const
Return true if this primitive requires an alpha pass.
Definition: GR_Primitive.h:210
GLclampf GLclampf GLclampf alpha
Definition: glew.h:1520
GR_DecorRenderFlags
Definition: GR_Defines.h:209
GR_DecorationRender * myDecorRender
Definition: GR_Primitive.h:550
Set of parameters sent to GR_Primitive::viewUpdate().
GLenum mode
Definition: glew.h:2163
GU_ConstDetailHandle geometry
GR_ErrorCode
Definition: GR_Error.h:16
GR_DispOptChange checkDisplayOptionChange(const GR_DisplayOption &opts)
Definition: GR_Primitive.h:588
const GEO_Primitive * getPrimitive(int seg) const
virtual void resetPrimitives()
Definition: GR_Primitive.h:77
bool myHasDetailPointNormal
Definition: GR_Primitive.h:549
virtual void cleanup(RE_Render *r)
Definition: GR_Primitive.h:184
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2864
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition: RE_Geometry.h:53
GT_API const UT_StringHolder cache_name
void getGEOPrimFromGT(const GT_PrimitiveHandle &primh, const GeoPrim *&prim)
Definition: GR_Primitive.h:506
int32 bumpDisplayOptionVersion()
Definition: GR_Primitive.h:264
const GLdouble * m
Definition: glew.h:9124
virtual bool checkGLState(RE_Render *r, const GR_DisplayOption &opts)
Definition: GR_Primitive.h:150
GLenum GLint GLuint mask
Definition: glew.h:1845
bool drawInAlphaPass(GR_AlphaPass alpha) const
Return true if this should be drawn in the given alpha pass.
Definition: GR_Primitive.h:213
GR_Decoration
Definition: GR_Defines.h:141
GR_AlphaPass
Definition: GR_Defines.h:109
GR_PickCompMode
Definition: GR_PickRender.h:28
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
Definition: HDK_Image.dox:266
virtual void getGeoRenders(UT_Array< GR_GeoRender * > &renders)
Definition: GR_Primitive.h:314
void cacheGTPrimitive(const GT_PrimitiveHandle &prim)
Definition: GR_Primitive.h:273
const char * getCacheName() const
The base GL cache name assigned to this primitive.
Definition: GR_Primitive.h:351
set of parameters sent to GR_Primitive::update()
RE_GenericAttribID
Definition: RE_Types.h:323
long long int64
Definition: SYS_Types.h:111
GR_BasePrimType getParentPrimType() const
Definition: GR_Primitive.h:309
virtual bool isHighlighted() const
Only for the Scene Graph view: highlighted prims.
Definition: GR_Primitive.h:294
GR_RenderMode
Definition: GR_Defines.h:44
const GR_DisplayOption & dopts
GR_BasePrimType
Definition: GR_Defines.h:338
virtual bool needsGLStateCheck(const GR_DisplayOption &opts) const
Definition: GR_Primitive.h:148
void setSupportedDecorations(int64 mask)
Definition: GR_Primitive.h:546
virtual bool renderInAlphaPass(GR_AlphaPass a)
Return true if this primitive renders in the specified alpha pass.
int64 exint
Definition: SYS_Types.h:120
GT_API const UT_StringHolder primitive_id
virtual RE_Geometry * getDecorationGeometry()
Definition: GR_Primitive.h:291
const GR_RenderInfo * getRenderInfo() const
Definition: GR_Primitive.h:312
#define GR_API
Definition: GR_API.h:10
virtual GT_PrimitiveHandle getInstancePrim() const
Definition: GR_Primitive.h:85
const GR_RenderInfo * myInfo
Definition: GR_Primitive.h:551
void setParentPrimType(GR_BasePrimType type)
set for those primitives that are within packed primitives
Definition: GR_Primitive.h:307
virtual bool getBoundingBox(UT_BoundingBoxD &bbox) const
Returns the bounding box of this primitive if it can be determined.
Definition: GR_Primitive.h:220
virtual bool setup(const GR_DisplayOption *)
Definition: GR_Primitive.h:182
GR_PrimAcceptResult
Definition: GR_Defines.h:331
virtual void viewUpdate(RE_Render *r, const GR_ViewUpdateParms &parms)
Definition: GR_Primitive.h:129
int int32
Definition: SYS_Types.h:39
GR_RenderFlags
Definition: GR_Defines.h:80
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
GT_PrimitiveHandle getCachedGTPrimitive()
Definition: GR_Primitive.h:272
GR_RenderVersion
Definition: GR_Defines.h:21
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
void updateDecoration(RE_Render *r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RE_Geometry *geo)
Definition: GR_Primitive.h:628
GT_PrimitiveType
Contains transitional objects to provide some backward compatibility for code that references old GEO...
GLfloat GLfloat p
Definition: glew.h:16321
int getAlphaPassMask() const
Definition: GR_Primitive.h:226
bool updateDecoration(RE_Render *r, GR_Decoration dec, const GT_Primitive &prim, const GR_UpdateParms &p, RE_Geometry &geo)
virtual void update(RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p)=0
bool isPrimUsed() const
Definition: GR_Primitive.h:304
int64 supportedDecorations()
Definition: GR_Primitive.h:204
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
void setPrimUsed(bool used)
Definition: GR_Primitive.h:303
UT_BoundingBoxF myBBox
Definition: GR_Primitive.h:554
GLenum array
Definition: glew.h:9066
UT_IntrusivePtr< GT_Primitive > GT_PrimitiveHandle
Definition: GT_Handles.h:33
UT_IntrusivePtr< GR_Primitive > GR_PrimitivePtr
Definition: GR_Primitive.h:583
void updateUserDecorations(RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, RE_Geometry *for_geo=NULL)
void setPrimTypeMask(GEO_PrimTypeCompat::TypeMask m)
Definition: GR_Primitive.h:543
SYS_FORCE_INLINE const GA_Attribute * findPointAttribute(GA_AttributeScope s, const UT_StringRef &name) const
Definition: GA_Detail.h:977
GT_API const UT_StringHolder vertex_id
virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init)
GLdouble GLdouble t
Definition: glew.h:1398
type
Definition: core.h:528
GR_SelectMode
Definition: GR_Defines.h:219
virtual GR_BasePrimType getBasePrimType() const
The base primitive type is usually NORMAL unless this is a packed type.
Definition: GR_Primitive.h:80
void setAlphaPassMask(int mask)
Definition: GR_Primitive.h:224
GR_PickStyle
Definition: GR_Defines.h:230