12 #ifndef GR_PRIMITIVE_H
13 #define GR_PRIMITIVE_H
59 virtual const char *className()
const = 0;
92 {
return bool(mask & myGAPrimMask); }
112 DISPLAY_VERSION_CHANGED
143 int instance_group = -1,
144 const char *attrib_name = NULL,
153 int instance_group = -1);
179 unsigned int pick_type,
210 virtual bool isRasterizedInView(
const UT_Matrix4F &objviewproj,
220 virtual bool supportsRenderUV();
227 {
return myAlphaPassMask &
alpha; }
238 { myAlphaPassMask =
mask; }
240 {
return myAlphaPassMask; }
263 bool showSelections()
const;
266 bool canDoInstancing()
const;
269 bool isObjectSelection()
const;
274 {
return mySupportsDynamicCulling; }
276 { mySupportsDynamicCulling = dc; }
282 {
return myDispOptVersion; }
287 return myDispOptVersion;
297 if(prim != myCachedPrim)
307 virtual void retirePrimitive();
321 const char *cache_name);
328 { myParentPrimType =
type; }
330 {
return myParentPrimType; }
377 if( myRef.add(-1) == 0)
387 const char *cache_name,
426 unsigned int pick_type,
428 bool has_pick_map) = 0;
475 int instance_group = -1,
560 template <
class GeoPrim>
562 const GeoPrim *&prim)
566 prim =
dynamic_cast<const GeoPrim *
>(geo->
getPrimitive(0));
582 int real_connect_start,
583 int real_connect_num);
594 int real_connect_start,
595 int real_connect_num);
604 int real_connect_start,
605 int real_connect_num);
612 unsigned int picktype,
626 unsigned int picktype,
638 bool inconclusive_stream_too =
false,
646 unsigned int picktype);
659 { myGAPrimMask = m; }
662 { myDecorMask =
mask; }
683 int real_connect_start,
684 int real_connect_num);
688 int32 myDispOptVersion;
691 unsigned myPrimUsed : 1,
692 myUserDecorationsProcessed : 1,
717 myDispOptInit =
true;
728 myCachedPrim = primh;
731 myUserDecorationsProcessed =
false;
736 myDispOptInit =
true;
Base class for many of the GEO_Primitive objects.
virtual bool isPrimVisible() const
virtual bool inViewFrustum(const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr)
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.
void updateDecoration(RE_RenderContext r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RE_Geometry *geo)
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
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
GT_API const UT_StringHolder cache_name
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
GLboolean GLboolean GLboolean GLboolean a
void getGEOPrimFromGT(const GT_PrimitiveHandle &primh, const GeoPrim *&prim)
int32 bumpDisplayOptionVersion()
bool drawInAlphaPass(GR_AlphaPass alpha) const
Return true if this should be drawn in the given alpha pass.
Temporary container for either a RV_Render and an RE_Render.
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
virtual void getGeoRenders(UT_Array< GR_GeoRender * > &renders)
virtual void viewUpdate(RE_RenderContext r, const GR_ViewUpdateParms &parms)
void cacheGTPrimitive(const GT_PrimitiveHandle &prim)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
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
void updatePrim(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &parms)
called every time the metacount version is bumped on the GU_Detail.
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
void updateUserDecorations(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, RE_Geometry *for_geo=NULL)
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.
GLfloat GLfloat GLfloat alpha
virtual void cleanup(RE_RenderContext r)
virtual bool setup(const GR_DisplayOption *)
The base class for all GT primitive types.
GT_PrimitiveHandle getCachedGTPrimitive()
Contains transitional objects to provide some backward compatibility for code that references old GEO...
bool supportsDynamicCulling() const
int getAlphaPassMask() const
virtual bool checkGLState(RE_RenderContext r, const GR_DisplayOption &opts)
bool updateDecoration(RE_Render *r, GR_Decoration dec, const GT_Primitive &prim, const GR_UpdateParms &p, RE_Geometry &geo)
int64 supportedDecorations()
void setPrimUsed(bool used)
void supportsDynamicCulling(bool dc)
virtual void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p)=0
UT_IntrusivePtr< GT_Primitive > GT_PrimitiveHandle
UT_IntrusivePtr< GR_Primitive > GR_PrimitivePtr
void setPrimTypeMask(GEO_PrimTypeCompat::TypeMask m)
SYS_FORCE_INLINE const GA_Attribute * findPointAttribute(GA_AttributeScope s, const UT_StringRef &name) const
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)