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 <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  /// Only for the Scene Graph view: highlighted prims.
278  virtual bool isHighlighted() const { return false; }
279 
280  /// create a primitive for the given GT type, with appropriate cache name
281  /// and GL render level
282  static GR_Primitive *createPrimitive(GT_PrimitiveType ptype,
283  int geo_type,
284  const GR_RenderInfo *info,
285  const char *cache_name);
286 
287  void setPrimUsed(bool used) { myPrimUsed = used; }
288  bool isPrimUsed() const { return myPrimUsed; }
289 
290  /// set for those primitives that are within packed primitives
292  { myParentPrimType = type; }
294  { return myParentPrimType; }
295 
296  const GR_RenderInfo *getRenderInfo() const { return myInfo; }
297 
298  virtual void getGeoRenders(UT_Array<GR_GeoRender *> &renders) {}
299 
300  void addUpdateMessage(GR_ErrorManager::Source err_source,
301  GR_ErrorCode gr_code,
302  UT_StringHolder extra_text=UT_StringHolder(),
303  UT_StringHolder src_name=UT_StringHolder());
304  void addUpdateWarning(GR_ErrorManager::Source err_source,
305  GR_ErrorCode gr_code,
306  UT_StringHolder extra_text=UT_StringHolder(),
307  UT_StringHolder src_name=UT_StringHolder());
308  void addUpdateError (GR_ErrorManager::Source err_source,
309  GR_ErrorCode gr_code,
310  UT_StringHolder extra_text=UT_StringHolder(),
311  UT_StringHolder src_name=UT_StringHolder());
312  void addUpdateFatal (GR_ErrorManager::Source err_source,
313  GR_ErrorCode gr_code,
314  UT_StringHolder extra_text=UT_StringHolder(),
315  UT_StringHolder src_name=UT_StringHolder());
316 
317  void addRedrawMessage(GR_ErrorManager::Source err_source,
318  GR_ErrorCode gr_code,
319  UT_StringHolder extra_text=UT_StringHolder(),
320  UT_StringHolder src_name=UT_StringHolder());
321  void addRedrawWarning(GR_ErrorManager::Source err_source,
322  GR_ErrorCode gr_code,
323  UT_StringHolder extra_text=UT_StringHolder(),
324  UT_StringHolder src_name=UT_StringHolder());
325  void addRedrawError (GR_ErrorManager::Source err_source,
326  GR_ErrorCode gr_code,
327  UT_StringHolder extra_text=UT_StringHolder(),
328  UT_StringHolder src_name=UT_StringHolder());
329  void addRedrawFatal (GR_ErrorManager::Source err_source,
330  GR_ErrorCode gr_code,
331  UT_StringHolder extra_text=UT_StringHolder(),
332  UT_StringHolder src_name=UT_StringHolder());
333 
334  /// The base GL cache name assigned to this primitive.
335  const char * getCacheName() const { return myCacheName; }
336 
337 protected:
338  /// Primitive constructor. info and cache_name are assigned by the viewport.
339  /// GR_Primitive subclasses can assign a typemask which is used to determine
340  /// if the primitive is rendered in instances where only a subset of
341  /// primitive types is requested.
342  GR_Primitive(const GR_RenderInfo *info,
343  const char *cache_name,
344  GEO_PrimTypeCompat::TypeMask gaprimtype);
345 
346 
347  /// Called when the geometry-related display options change, to determine if
348  /// an update is required. By default, no update is required. If the options
349  /// did change, return either DISPLAY_CHANGED, which will call update()
350  /// without bumping the display option version, or DISPLAY_VERSION_CHANGED,
351  /// which will bump the version.
352  /// If 'first_init' is true, this is being called to initialize any cached
353  /// display options. The return value will be ignored. This will happen
354  /// just after the primitive is created.
355  virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts,
356  bool first_init);
357 
358  /// Main update method, called when conditions change which may require the
359  /// geometry to be updated. These include geometry changes, selections,
360  /// volatile display options (level of detail), instancing updates,
361  /// and some GL state changes (if needsGLStateCheck returns true)
362  virtual void update(RE_Render *r,
363  const GT_PrimitiveHandle &primh,
364  const GR_UpdateParms &p) = 0;
365 
366  /// Main drawing method. update() will always be called before render(), but
367  /// render() may execute multiple times before the next update call. This
368  /// method should be fairly lightweight; do as much work in update() as
369  /// possible. There is no access to the GU_Detail from this method.
370  virtual void render(RE_Render *r,
371  GR_RenderMode render_mode,
373  GR_DrawParms dp) = 0;
374 
375  /// Render this primitive for picking, where pick_type is defined as one of
376  /// the pickable bits in GU_SelectType.h (like GR_PICK_GEOPOINT)
377  /// return the number of picks
378  virtual int renderPick(RE_Render *r,
379  const GR_DisplayOption *opt,
380  unsigned int pick_type,
381  GR_PickStyle pick_style,
382  bool has_pick_map) = 0;
383 
384  /// Render the attributes required for decoration 'decor' (like point
385  /// markers, uv text, normals, etc). 'overlay' should be set to true if
386  /// currently rendering in the overlay texture, false if in the main
387  /// viewport.
388  virtual void renderDecoration(RE_Render *r,
389  GR_Decoration decor,
390  const GR_DecorationParms &parms);
391 
392  /// Check if the builtin Houdini markers (point numbers, profile curves,
393  /// prim normals, etc) have changed since the last redraw, and return true
394  /// if at least one did. 'markers' is a list of markers to check that must
395  /// be terminated by GR_NO_DECORATION.
396  bool standardMarkersChanged(const GR_DisplayOption &opts,
397  const GR_Decoration *markers,
398  bool first_init);
399 
400  /// Updates a decoration for the pass RE_Geometry object. Called from
401  /// update().
402  void updateDecoration(RE_Render *r,
403  GR_Decoration dec,
404  const GR_UpdateParms &p,
405  const GT_PrimitiveHandle &prim,
406  RE_Geometry *geo);
407 
408  /// Helper mother to draw a decoration on a given GR_GeoRender object.
409  /// Called from renderDecoration() or render().
410  void drawDecoration(RE_Render *r,
411  GR_GeoRender *geo,
412  GR_Decoration dec,
413  const GR_DisplayOption *opts,
415  bool overlay,
416  bool override_vis,
417  int instance_group = -1,
418  GR_SelectMode *select_override = NULL,
421 
422  void drawVisualizer(RE_Render *r,
423  GR_GeoRender *geo,
424  const GR_VisualizerInfo *dec_info,
425  const GR_DisplayOption *opts,
429 
430 
431  /// Helper method to draw a decoration on a given RE_Geometry object.
432  /// Called from renderDeocration() or render().
433  void drawDecorationForGeo(RE_Render *r,
434  RE_Geometry *geo,
435  GR_Decoration dec,
436  const GR_DisplayOption *opts,
438  bool overlay,
439  bool override_vis,
440  int instance_group,
441  GR_SelectMode smode,
444  RE_OverrideList *override_list = NULL);
445 
446  void drawVisualizerForGeo(RE_Render *r,
447  RE_Geometry *geo,
448  const GR_VisualizerInfo *dec_info,
449  const GR_DisplayOption *opts,
453 
454 
455  /// Helper method to draw a GR_GeoRender object. Called from render() or
456  /// renderDecoration().
457  void drawGeoRender(RE_Render *r,
458  GR_GeoRender *geo,
461  GR_DrawParms dp);
462  bool checkUserOptions(const GR_DisplayOption &opt) const;
463  void updateUserOptions(const GR_DisplayOption &opt);
464  const GR_UserOption *getUserDecoration(GR_Decoration dec) const;
465  void updateUserDecorations(RE_Render *r,
466  const GT_PrimitiveHandle &primh,
467  const GR_UpdateParms &p,
468  RE_Geometry *for_geo = NULL);
469 
470  GR_DispOptChange checkColorOverride(const GR_DisplayOption &opts,
471  bool first_init);
472 
473  GT_Primitive *createUnitSphere(const GT_RefineParms &parms);
474 
475 
476 
477  /// Return a GEO_Primitive derivative (GeoPrim) from the GT handle. The
478  /// GT handle must be referencing a GT_GEOPrimitive.
479  template <class GeoPrim>
481  const GeoPrim *&prim)
482  {
483  const GT_GEOPrimitive *geo =
484  dynamic_cast<const GT_GEOPrimitive*>(primh.get());
485  prim = dynamic_cast<const GeoPrim *>(geo->getPrimitive(0));
486  }
487 
488  /// Create a pick buffer large enough to hold all picks from 'geo' with
489  /// 'picktype' selection style (GR_PICK_GEOPOINT, PRIMITIVE, etc)
490  /// The required vector size (1 or 2) will be returned in vsize (edges need
491  /// 2) and needs_2pass will be true if some picks require CPU support.
492  int getPickBufferSize(RE_Geometry *geo,
493  unsigned int picktype,
494  int &vector_size,
495  bool &needs_2pass,
496  int start_group = 4,
497  int end_group = -1,
498  GR_PickStyle pickstyle
499  = GR_PICK_NONE) const;
500 
501  /// creates a ivec4 pick buffer with a pickID attribute with buffer_size
502  /// points. This primitive owns the buffer, and there is only one.
503  RE_Geometry *createPickBuffer(RE_Render *r, int buffer_size,
504  int vector_size = 1,
505  bool inconclusive_stream_too = false);
506 
507  /// accumulate picks into the myInfo.myPicks array so that it can be passed
508  /// up to higher level code. Some effort is made to remove duplicate pickIDs,
509  /// mostly from neighbouring picks. If 'pick_buffer' is NULL, myPickBuffer
510  /// is used.
511  int accumulatePickIDs(RE_Render *r, int npicks,
512  RE_Geometry *pick_buffer = NULL);
513 
514  GR_PickCompMode setupPrimPickMode(RE_Render *r,GR_GeoRender *geo) const;
515 
516 
518  { myGAPrimMask = m; }
519 
521  { myDecorMask = mask; }
522 
526 
527  // For deferred rendering
532 
533 private:
534  UT_String myCacheName;
535  UT_Int64Array myUserDispOptions;
536  int32 myDispOptVersion;
537  GEO_PrimTypeCompat::TypeMask myGAPrimMask;
538  UT_String myColorOverrideOpt;
539  unsigned myPrimUsed : 1,
540  myUserDecorationsProcessed : 1,
541  myDispOptInit : 1;
542  GR_BasePrimType myParentPrimType;
543 
544  // for cache access only; do not dereference.
545  GT_PrimitiveHandle myCachedPrim;
546 
547  int myMarkerState[GR_MAX_DECORATIONS];//0=off,1=on,-1=undef
548  int64 myDecorMask;
549 
550  // uncached buffer for doing transform feedback picking
551  RE_Geometry *myPickBuffer;
552 
553 };
554 
557 {
558  GR_DispOptChange changed = displayOptionChange(opts, !myDispOptInit);
559 
560  myDispOptInit = true;
561 
562  return changed;
563 }
564 
565 inline void
567  const GT_PrimitiveHandle &primh,
568  const GR_UpdateParms &p)
569 {
571  myCachedPrim = primh;
573  rlock.isValid() ? rlock->findPointAttribute("N") != NULL : false;
574  myUserDecorationsProcessed = false;
575 
576  if(!myDispOptInit)
577  {
578  displayOptionChange(p.dopts, true);
579  myDispOptInit = true;
580  }
581 
582  update(r, primh, p);
583  updateUserDecorations(r, primh, p);
584 }
585 
586 inline bool
588 {
589  if(alpha == GR_ALPHA_PASS_ALL)
590  return true;
591 
592  return renderInAlphaPass(alpha);
593 }
594 
595 inline void
597  GR_Decoration dec,
598  const GR_UpdateParms &p,
599  const GT_PrimitiveHandle &prim,
600  RE_Geometry *geo)
601 {
602  // Don't draw decorations for packed primitives
606  return;
607 
608  myDecorRender->updateDecoration(r, dec, *prim.get(), p, *geo);
609 }
610 
611 #endif
Base class for many of the GEO_Primitive objects.
UT_Matrix4D myLocal
Definition: GR_Primitive.h:529
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:566
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:207
GR_DecorationRender * myDecorRender
Definition: GR_Primitive.h:524
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:556
const GEO_Primitive * getPrimitive(int seg) const
virtual void resetPrimitives()
Definition: GR_Primitive.h:77
bool myHasDetailPointNormal
Definition: GR_Primitive.h:523
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
GT_API const UT_StringHolder cache_name
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:480
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:139
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:298
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:335
set of parameters sent to GR_Primitive::update()
RE_GenericAttribID
Definition: RE_Types.h:323
long long int64
Definition: SYS_Types.h:107
GR_BasePrimType getParentPrimType() const
Definition: GR_Primitive.h:293
virtual bool isHighlighted() const
Only for the Scene Graph view: highlighted prims.
Definition: GR_Primitive.h:278
GR_RenderMode
Definition: GR_Defines.h:44
const GR_DisplayOption & dopts
GR_BasePrimType
Definition: GR_Defines.h:335
virtual bool needsGLStateCheck(const GR_DisplayOption &opts) const
Definition: GR_Primitive.h:147
void setSupportedDecorations(int64 mask)
Definition: GR_Primitive.h:520
virtual bool renderInAlphaPass(GR_AlphaPass a)
Return true if this primitive renders in the specified alpha pass.
int64 exint
Definition: SYS_Types.h:116
GT_API const UT_StringHolder primitive_id
virtual RE_Geometry * getDecorationGeometry()
Definition: GR_Primitive.h:275
const GR_RenderInfo * getRenderInfo() const
Definition: GR_Primitive.h:296
#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:525
void setParentPrimType(GR_BasePrimType type)
set for those primitives that are within packed primitives
Definition: GR_Primitive.h:291
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:328
virtual void viewUpdate(RE_Render *r, const GR_ViewUpdateParms &parms)
Definition: GR_Primitive.h:128
int int32
Definition: SYS_Types.h:35
GR_RenderFlags
Definition: GR_Defines.h:79
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
GT_PrimitiveHandle getCachedGTPrimitive()
Definition: GR_Primitive.h:256
GR_RenderVersion
Definition: GR_Defines.h:21
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:596
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:288
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:287
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:587
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:517
SYS_FORCE_INLINE const GA_Attribute * findPointAttribute(GA_AttributeScope s, const UT_StringRef &name) const
Definition: GA_Detail.h:970
GT_API const UT_StringHolder vertex_id
virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init)
GR_SelectMode
Definition: GR_Defines.h:217
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:528
GR_PickStyle
Definition: GR_Defines.h:228