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 true if the primitive supports packed prim culling when its
259  /// parent is a packed prim. On by default.
261  { return mySupportsDynamicCulling; }
263  { mySupportsDynamicCulling = dc; }
264 
265  /// Returns the current display option version for this primitive.
266  /// It will only be non-zero if the primitive responds to display option
267  /// changes and bumps the display option version.
269  { return myDispOptVersion; }
270 
272  {
273  myDispOptVersion++;
274  return myDispOptVersion;
275  }
276 
277  /// GT Primitive caching. This is handled by updatePrim()
278  /// @{
279  GT_PrimitiveHandle getCachedGTPrimitive() { return myCachedPrim; }
281  {
282  if(prim)
283  {
284  if(prim != myCachedPrim)
285  myCachedPrim = prim;
286  }
287  else
288  myCachedPrim = NULL;
289  }
290 
291  /// @}
292 
293  /// Called when a node is no longer actively displayed, but still cached
294  virtual void retirePrimitive();
295 
296  /// return the RE_Geometry containing the geometry to be decorated by user
297  /// display options. May return NULL if no user decorations are to be shown.
298  virtual RE_Geometry *getDecorationGeometry() { return NULL; }
299 
300  /// Only for the Scene Graph view: highlighted prims.
301  virtual bool isHighlighted() const { return false; }
302 
303  /// create a primitive for the given GT type, with appropriate cache name
304  /// and GL render level
305  static GR_Primitive *createPrimitive(GT_PrimitiveType ptype,
306  int geo_type,
307  const GR_RenderInfo *info,
308  const char *cache_name);
309 
310  void setPrimUsed(bool used) { myPrimUsed = used; }
311  bool isPrimUsed() const { return myPrimUsed; }
312 
313  /// set for those primitives that are within packed primitives
315  { myParentPrimType = type; }
317  { return myParentPrimType; }
318 
319  const GR_RenderInfo *getRenderInfo() const { return myInfo; }
320 
321  virtual void getGeoRenders(UT_Array<GR_GeoRender *> &renders) {}
322 
323  void addUpdateMessage(GR_ErrorManager::Source err_source,
324  GR_ErrorCode gr_code,
325  UT_StringHolder extra_text=UT_StringHolder(),
326  UT_StringHolder src_name=UT_StringHolder());
327  void addUpdateWarning(GR_ErrorManager::Source err_source,
328  GR_ErrorCode gr_code,
329  UT_StringHolder extra_text=UT_StringHolder(),
330  UT_StringHolder src_name=UT_StringHolder());
331  void addUpdateError (GR_ErrorManager::Source err_source,
332  GR_ErrorCode gr_code,
333  UT_StringHolder extra_text=UT_StringHolder(),
334  UT_StringHolder src_name=UT_StringHolder());
335  void addUpdateFatal (GR_ErrorManager::Source err_source,
336  GR_ErrorCode gr_code,
337  UT_StringHolder extra_text=UT_StringHolder(),
338  UT_StringHolder src_name=UT_StringHolder());
339 
340  void addRedrawMessage(GR_ErrorManager::Source err_source,
341  GR_ErrorCode gr_code,
342  UT_StringHolder extra_text=UT_StringHolder(),
343  UT_StringHolder src_name=UT_StringHolder());
344  void addRedrawWarning(GR_ErrorManager::Source err_source,
345  GR_ErrorCode gr_code,
346  UT_StringHolder extra_text=UT_StringHolder(),
347  UT_StringHolder src_name=UT_StringHolder());
348  void addRedrawError (GR_ErrorManager::Source err_source,
349  GR_ErrorCode gr_code,
350  UT_StringHolder extra_text=UT_StringHolder(),
351  UT_StringHolder src_name=UT_StringHolder());
352  void addRedrawFatal (GR_ErrorManager::Source err_source,
353  GR_ErrorCode gr_code,
354  UT_StringHolder extra_text=UT_StringHolder(),
355  UT_StringHolder src_name=UT_StringHolder());
356 
357  /// The base GL cache name assigned to this primitive.
358  const char * getCacheName() const { return myCacheName; }
359 
360  // For reference counted GR prims only
361  void incref() { myRef.add(1); }
362  void decref()
363  {
364  if( myRef.add(-1) == 0)
365  delete this;
366  }
367 
368 protected:
369  /// Primitive constructor. info and cache_name are assigned by the viewport.
370  /// GR_Primitive subclasses can assign a typemask which is used to determine
371  /// if the primitive is rendered in instances where only a subset of
372  /// primitive types is requested.
373  GR_Primitive(const GR_RenderInfo *info,
374  const char *cache_name,
375  GEO_PrimTypeCompat::TypeMask gaprimtype);
376 
377  virtual ~GR_Primitive();
378 
379 
380  /// Called when the geometry-related display options change, to determine if
381  /// an update is required. By default, no update is required. If the options
382  /// did change, return either DISPLAY_CHANGED, which will call update()
383  /// without bumping the display option version, or DISPLAY_VERSION_CHANGED,
384  /// which will bump the version.
385  /// If 'first_init' is true, this is being called to initialize any cached
386  /// display options. The return value will be ignored. This will happen
387  /// just after the primitive is created.
388  virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts,
389  bool first_init);
390 
391  /// Main update method, called when conditions change which may require the
392  /// geometry to be updated. These include geometry changes, selections,
393  /// volatile display options (level of detail), instancing updates,
394  /// and some GL state changes (if needsGLStateCheck returns true)
395  virtual void update(RE_Render *r,
396  const GT_PrimitiveHandle &primh,
397  const GR_UpdateParms &p) = 0;
398 
399  /// Main drawing method. update() will always be called before render(), but
400  /// render() may execute multiple times before the next update call. This
401  /// method should be fairly lightweight; do as much work in update() as
402  /// possible. There is no access to the GU_Detail from this method.
403  virtual void render(RE_Render *r,
404  GR_RenderMode render_mode,
406  GR_DrawParms dp) = 0;
407 
408  /// Render this primitive for picking, where pick_type is defined as one of
409  /// the pickable bits in GU_SelectType.h (like GR_PICK_GEOPOINT)
410  /// return the number of picks
411  virtual int renderPick(RE_Render *r,
412  const GR_DisplayOption *opt,
413  unsigned int pick_type,
414  GR_PickStyle pick_style,
415  bool has_pick_map) = 0;
416 
417  /// Render the attributes required for decoration 'decor' (like point
418  /// markers, uv text, normals, etc). 'overlay' should be set to true if
419  /// currently rendering in the overlay texture, false if in the main
420  /// viewport.
421  virtual void renderDecoration(RE_Render *r,
422  GR_Decoration decor,
423  const GR_DecorationParms &parms);
424 
425  /// Check if the builtin Houdini markers (point numbers, profile curves,
426  /// prim normals, etc) have changed since the last redraw, and return true
427  /// if at least one did. 'markers' is a list of markers to check that must
428  /// be terminated by GR_NO_DECORATION.
429  bool standardMarkersChanged(const GR_DisplayOption &opts,
430  const GR_Decoration *markers,
431  bool first_init);
432 
433  /// Updates a decoration for the pass RE_Geometry object. Called from
434  /// update().
435  void updateDecoration(RE_Render *r,
436  GR_Decoration dec,
437  const GR_UpdateParms &p,
438  const GT_PrimitiveHandle &prim,
439  RE_Geometry *geo);
440 
441  /// Helper mother to draw a decoration on a given GR_GeoRender object.
442  /// Called from renderDecoration() or render().
443  void drawDecoration(RE_Render *r,
444  GR_GeoRender *geo,
445  GR_Decoration dec,
446  const GR_DisplayOption *opts,
448  bool overlay,
449  bool override_vis,
450  int instance_group = -1,
451  GR_SelectMode *select_override = NULL,
454 
455  void drawVisualizer(RE_Render *r,
456  GR_GeoRender *geo,
457  const GR_VisualizerInfo *dec_info,
458  const GR_DisplayOption *opts,
462 
463 
464  /// Helper method to draw a decoration on a given RE_Geometry object.
465  /// Called from renderDeocration() or render().
466  void drawDecorationForGeo(RE_Render *r,
467  RE_Geometry *geo,
468  GR_Decoration dec,
469  const GR_DisplayOption *opts,
471  bool overlay,
472  bool override_vis,
473  int instance_group,
474  GR_SelectMode smode,
477  RE_OverrideList *override_list = NULL);
478 
479  void drawVisualizerForGeo(RE_Render *r,
480  RE_Geometry *geo,
481  const GR_VisualizerInfo *dec_info,
482  const GR_DisplayOption *opts,
486 
487 
488  /// Helper method to draw a GR_GeoRender object. Called from render() or
489  /// renderDecoration().
490  void drawGeoRender(RE_Render *r,
491  GR_GeoRender *geo,
494  GR_DrawParms dp);
495  bool checkUserOptions(const GR_DisplayOption &opt) const;
496  void updateUserOptions(const GR_DisplayOption &opt);
497  const GR_UserOption *getUserDecoration(GR_Decoration dec) const;
498  void updateUserDecorations(RE_Render *r,
499  const GT_PrimitiveHandle &primh,
500  const GR_UpdateParms &p,
501  RE_Geometry *for_geo = NULL);
502 
503  GR_DispOptChange checkColorOverride(const GR_DisplayOption &opts,
504  bool first_init);
505 
506  GT_Primitive *createUnitSphere(const GT_RefineParms &parms);
507 
508 
509 
510  /// Return a GEO_Primitive derivative (GeoPrim) from the GT handle. The
511  /// GT handle must be referencing a GT_GEOPrimitive.
512  template <class GeoPrim>
514  const GeoPrim *&prim)
515  {
516  const GT_GEOPrimitive *geo =
517  dynamic_cast<const GT_GEOPrimitive*>(primh.get());
518  prim = dynamic_cast<const GeoPrim *>(geo->getPrimitive(0));
519  }
520 
521  /// Create a pick buffer large enough to hold all picks from 'geo' with
522  /// 'picktype' selection style (GR_PICK_GEOPOINT, PRIMITIVE, etc)
523  /// The required vector size (1 or 2) will be returned in vsize (edges need
524  /// 2) and needs_2pass will be true if some picks require CPU support.
525  int getPickBufferSize(RE_Geometry *geo,
526  unsigned int picktype,
527  int &vector_size,
528  bool &needs_2pass,
529  int start_group = 4,
530  int end_group = -1,
531  GR_PickStyle pickstyle
532  = GR_PICK_NONE) const;
533 
534  /// creates a ivec4 pick buffer with a pickID attribute with buffer_size
535  /// points. This primitive owns the buffer, and there is only one.
536  RE_Geometry *createPickBuffer(RE_Render *r, int buffer_size,
537  int vector_size = 1,
538  bool inconclusive_stream_too = false);
539 
540  /// accumulate picks into the myInfo.myPicks array so that it can be passed
541  /// up to higher level code. Some effort is made to remove duplicate pickIDs,
542  /// mostly from neighbouring picks. If 'pick_buffer' is NULL, myPickBuffer
543  /// is used.
544  int accumulatePickIDs(RE_Render *r, int npicks,
545  RE_Geometry *pick_buffer = NULL);
546 
547  GR_PickCompMode setupPrimPickMode(RE_Render *r,GR_GeoRender *geo) const;
548 
549 
551  { myGAPrimMask = m; }
552 
554  { myDecorMask = mask; }
555 
560 
561  // For deferred rendering
566 
567 private:
568  UT_String myCacheName;
569  UT_Int64Array myUserDispOptions;
570  int32 myDispOptVersion;
571  GEO_PrimTypeCompat::TypeMask myGAPrimMask;
572  UT_String myColorOverrideOpt;
573  unsigned myPrimUsed : 1,
574  myUserDecorationsProcessed : 1,
575  myDispOptInit : 1;
576  GR_BasePrimType myParentPrimType;
577 
578  // for cache access only; do not dereference.
579  GT_PrimitiveHandle myCachedPrim;
580 
581  int myMarkerState[GR_MAX_DECORATIONS];//0=off,1=on,-1=undef
582  int64 myDecorMask;
583  SYS_AtomicInt32 myRef;
584  int myAlphaPassMask;
585 
586  // uncached buffer for doing transform feedback picking
587  RE_Geometry *myPickBuffer;
588 
589 };
590 
592 static inline void intrusive_ptr_add_ref(GR_Primitive *pr) { pr->incref(); }
593 static inline void intrusive_ptr_release(GR_Primitive *pr) { pr->decref(); }
594 
597 {
598  GR_DispOptChange changed = displayOptionChange(opts, !myDispOptInit);
599 
600  myDispOptInit = true;
601 
602  return changed;
603 }
604 
605 inline void
607  const GT_PrimitiveHandle &primh,
608  const GR_UpdateParms &p)
609 {
611  myCachedPrim = primh;
613  rlock.isValid() ? rlock->findPointAttribute("N") != NULL : false;
614  myUserDecorationsProcessed = false;
615 
616  if(!myDispOptInit)
617  {
618  displayOptionChange(p.dopts, true);
619  myDispOptInit = true;
620  }
621 
622  update(r, primh, p);
623 
625  myAlphaPassMask = GR_ALPHA_PASS_OPAQUE;
626  else
627  myAlphaPassMask = 0;
628 
630  myAlphaPassMask |= GR_ALPHA_PASS_NORMAL;
631 
632  updateUserDecorations(r, primh, p);
633 }
634 
635 inline void
637  GR_Decoration dec,
638  const GR_UpdateParms &p,
639  const GT_PrimitiveHandle &prim,
640  RE_Geometry *geo)
641 {
642  // Don't draw decorations for packed primitives
646  return;
647 
648  myDecorRender->updateDecoration(r, dec, *prim.get(), p, *geo);
649 }
650 
651 #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:563
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:606
int int32
Definition: SYS_Types.h:39
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:268
virtual bool requiresAlphaPass() const
Return true if this primitive requires an alpha pass.
Definition: GR_Primitive.h:210
GR_DecorRenderFlags
Definition: GR_Defines.h:214
GR_DecorationRender * myDecorRender
Definition: GR_Primitive.h:558
Set of parameters sent to GR_Primitive::viewUpdate().
GU_ConstDetailHandle geometry
GR_ErrorCode
Definition: GR_Error.h:16
GR_DispOptChange checkDisplayOptionChange(const GR_DisplayOption &opts)
Definition: GR_Primitive.h:596
const GEO_Primitive * getPrimitive(int seg) const
virtual void resetPrimitives()
Definition: GR_Primitive.h:77
bool myHasDetailPointNormal
Definition: GR_Primitive.h:556
virtual void cleanup(RE_Render *r)
Definition: GR_Primitive.h:184
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition: RE_Geometry.h:53
int64 exint
Definition: SYS_Types.h:125
GT_API const UT_StringHolder cache_name
void getGEOPrimFromGT(const GT_PrimitiveHandle &primh, const GeoPrim *&prim)
Definition: GR_Primitive.h:513
int32 bumpDisplayOptionVersion()
Definition: GR_Primitive.h:271
virtual bool checkGLState(RE_Render *r, const GR_DisplayOption &opts)
Definition: GR_Primitive.h:150
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:146
GR_AlphaPass
Definition: GR_Defines.h:113
GLdouble GLdouble t
Definition: glew.h:1403
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:321
void cacheGTPrimitive(const GT_PrimitiveHandle &prim)
Definition: GR_Primitive.h:280
const char * getCacheName() const
The base GL cache name assigned to this primitive.
Definition: GR_Primitive.h:358
set of parameters sent to GR_Primitive::update()
RE_GenericAttribID
Definition: RE_Types.h:329
GR_BasePrimType getParentPrimType() const
Definition: GR_Primitive.h:316
GLenum array
Definition: glew.h:9108
virtual bool isHighlighted() const
Only for the Scene Graph view: highlighted prims.
Definition: GR_Primitive.h:301
GR_RenderMode
Definition: GR_Defines.h:46
const GR_DisplayOption & dopts
GR_BasePrimType
Definition: GR_Defines.h:346
virtual bool needsGLStateCheck(const GR_DisplayOption &opts) const
Definition: GR_Primitive.h:148
void setSupportedDecorations(int64 mask)
Definition: GR_Primitive.h:553
virtual bool renderInAlphaPass(GR_AlphaPass a)
Return true if this primitive renders in the specified alpha pass.
GLint GLuint mask
Definition: glcorearb.h:124
GT_API const UT_StringHolder primitive_id
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
virtual RE_Geometry * getDecorationGeometry()
Definition: GR_Primitive.h:298
const GR_RenderInfo * getRenderInfo() const
Definition: GR_Primitive.h:319
#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:559
void setParentPrimType(GR_BasePrimType type)
set for those primitives that are within packed primitives
Definition: GR_Primitive.h:314
long long int64
Definition: SYS_Types.h:116
virtual bool getBoundingBox(UT_BoundingBoxD &bbox) const
Returns the bounding box of this primitive if it can be determined.
Definition: GR_Primitive.h:220
GLfloat GLfloat p
Definition: glew.h:16656
virtual bool setup(const GR_DisplayOption *)
Definition: GR_Primitive.h:182
GR_PrimAcceptResult
Definition: GR_Defines.h:339
virtual void viewUpdate(RE_Render *r, const GR_ViewUpdateParms &parms)
Definition: GR_Primitive.h:129
GR_RenderFlags
Definition: GR_Defines.h:84
GLbitfield flags
Definition: glcorearb.h:1596
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
GT_PrimitiveHandle getCachedGTPrimitive()
Definition: GR_Primitive.h:279
GR_RenderVersion
Definition: GR_Defines.h:21
GLenum mode
Definition: glcorearb.h:99
void updateDecoration(RE_Render *r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RE_Geometry *geo)
Definition: GR_Primitive.h:636
GT_PrimitiveType
Contains transitional objects to provide some backward compatibility for code that references old GEO...
bool supportsDynamicCulling() const
Definition: GR_Primitive.h:260
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:311
int64 supportedDecorations()
Definition: GR_Primitive.h:204
void setPrimUsed(bool used)
Definition: GR_Primitive.h:310
UT_BoundingBoxF myBBox
Definition: GR_Primitive.h:562
void supportsDynamicCulling(bool dc)
Definition: GR_Primitive.h:262
const GLdouble * m
Definition: glew.h:9166
UT_IntrusivePtr< GT_Primitive > GT_PrimitiveHandle
Definition: GT_Handles.h:33
UT_IntrusivePtr< GR_Primitive > GR_PrimitivePtr
Definition: GR_Primitive.h:591
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:550
type
Definition: core.h:1059
SYS_FORCE_INLINE const GA_Attribute * findPointAttribute(GA_AttributeScope s, const UT_StringRef &name) const
Definition: GA_Detail.h:1033
GLboolean r
Definition: glcorearb.h:1222
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
GT_API const UT_StringHolder vertex_id
virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init)
bool mySupportsDynamicCulling
Definition: GR_Primitive.h:557
GR_SelectMode
Definition: GR_Defines.h:224
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:235