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