12 #ifndef GR_PRIMITIVE_H
13 #define GR_PRIMITIVE_H
57 virtual const char *className()
const = 0;
90 {
return bool(mask & myGAPrimMask); }
93 virtual void checkForDeferredDraw(
const RE_Render *
r,
107 DISPLAY_VERSION_CHANGED
138 int instance_group = -1,
139 const char *attrib_name = NULL,
166 unsigned int pick_type,
171 virtual void setupDrawDecorations(
RE_Render *
r);
197 virtual bool isRasterizedInView(
const UT_Matrix4F &objviewproj,
207 virtual bool supportsRenderUV();
214 {
return myAlphaPassMask &
alpha; }
225 { myAlphaPassMask =
mask; }
227 {
return myAlphaPassMask; }
250 bool showSelections()
const;
253 bool canDoInstancing()
const;
256 bool isObjectSelection()
const;
261 {
return mySupportsDynamicCulling; }
263 { mySupportsDynamicCulling = dc; }
269 {
return myDispOptVersion; }
274 return myDispOptVersion;
284 if(prim != myCachedPrim)
294 virtual void retirePrimitive();
308 const char *cache_name);
315 { myParentPrimType =
type; }
317 {
return myParentPrimType; }
364 if( myRef.add(-1) == 0)
374 const char *cache_name,
413 unsigned int pick_type,
415 bool has_pick_map) = 0;
450 int instance_group = -1,
512 template <
class GeoPrim>
514 const GeoPrim *&prim)
518 prim =
dynamic_cast<const GeoPrim *
>(geo->
getPrimitive(0));
526 unsigned int picktype,
538 bool inconclusive_stream_too =
false);
544 int accumulatePickIDs(
RE_Render *
r,
int npicks,
551 { myGAPrimMask =
m; }
554 { myDecorMask =
mask; }
570 int32 myDispOptVersion;
573 unsigned myPrimUsed : 1,
574 myUserDecorationsProcessed : 1,
600 myDispOptInit =
true;
611 myCachedPrim = primh;
614 myUserDecorationsProcessed =
false;
619 myDispOptInit =
true;
Base class for many of the GEO_Primitive objects.
virtual bool inViewFrustum(const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr)
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.
virtual bool updateOnViewChange(const GR_DisplayOption &) const
If this primitive requires an update when the view changes, return true.
bool typeMask(GEO_PrimTypeCompat::TypeMask mask) const
returns true if this primitive's type mask is part of "mask".
int32 getDisplayOptionVersion() const
virtual bool requiresAlphaPass() const
Return true if this primitive requires an alpha pass.
GR_DecorationRender * myDecorRender
Set of parameters sent to GR_Primitive::viewUpdate().
GU_ConstDetailHandle geometry
GR_DispOptChange checkDisplayOptionChange(const GR_DisplayOption &opts)
const GEO_Primitive * getPrimitive(int seg) const
virtual void resetPrimitives()
bool myHasDetailPointNormal
virtual void cleanup(RE_Render *r)
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
GT_API const UT_StringHolder cache_name
void getGEOPrimFromGT(const GT_PrimitiveHandle &primh, const GeoPrim *&prim)
int32 bumpDisplayOptionVersion()
virtual bool checkGLState(RE_Render *r, const GR_DisplayOption &opts)
bool drawInAlphaPass(GR_AlphaPass alpha) const
Return true if this should be drawn in the given alpha pass.
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
virtual void getGeoRenders(UT_Array< GR_GeoRender * > &renders)
void cacheGTPrimitive(const GT_PrimitiveHandle &prim)
const char * getCacheName() const
The base GL cache name assigned to this primitive.
set of parameters sent to GR_Primitive::update()
GR_BasePrimType getParentPrimType() const
virtual bool isHighlighted() const
Only for the Scene Graph view: highlighted prims.
const GR_DisplayOption & dopts
virtual bool needsGLStateCheck(const GR_DisplayOption &opts) const
void setSupportedDecorations(int64 mask)
virtual bool renderInAlphaPass(GR_AlphaPass a)
Return true if this primitive renders in the specified alpha pass.
GT_API const UT_StringHolder primitive_id
GLboolean GLboolean GLboolean GLboolean a
virtual RE_Geometry * getDecorationGeometry()
const GR_RenderInfo * getRenderInfo() const
virtual GT_PrimitiveHandle getInstancePrim() const
const GR_RenderInfo * myInfo
void setParentPrimType(GR_BasePrimType type)
set for those primitives that are within packed primitives
virtual bool getBoundingBox(UT_BoundingBoxD &bbox) const
Returns the bounding box of this primitive if it can be determined.
virtual bool setup(const GR_DisplayOption *)
virtual void viewUpdate(RE_Render *r, const GR_ViewUpdateParms &parms)
The base class for all GT primitive types.
GT_PrimitiveHandle getCachedGTPrimitive()
void updateDecoration(RE_Render *r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RE_Geometry *geo)
Contains transitional objects to provide some backward compatibility for code that references old GEO...
bool supportsDynamicCulling() const
int getAlphaPassMask() const
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
int64 supportedDecorations()
void setPrimUsed(bool used)
void supportsDynamicCulling(bool dc)
UT_IntrusivePtr< GT_Primitive > GT_PrimitiveHandle
UT_IntrusivePtr< GR_Primitive > GR_PrimitivePtr
void updateUserDecorations(RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, RE_Geometry *for_geo=NULL)
void setPrimTypeMask(GEO_PrimTypeCompat::TypeMask m)
SYS_FORCE_INLINE const GA_Attribute * findPointAttribute(GA_AttributeScope s, const UT_StringRef &name) const
GLfloat GLfloat GLfloat alpha
GT_API const UT_StringHolder vertex_id
virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init)
bool mySupportsDynamicCulling
virtual GR_BasePrimType getBasePrimType() const
The base primitive type is usually NORMAL unless this is a packed type.
void setAlphaPassMask(int mask)