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; }
267 bool showSelections()
const;
270 bool canDoInstancing()
const;
273 bool isObjectSelection()
const;
278 {
return mySupportsDynamicCulling; }
280 { mySupportsDynamicCulling = dc; }
286 {
return myDispOptVersion; }
291 return myDispOptVersion;
301 if(prim != myCachedPrim)
311 virtual void retirePrimitive();
325 const char *cache_name);
332 { myParentPrimType =
type; }
334 {
return myParentPrimType; }
381 if( myRef.add(-1) == 0)
391 const char *cache_name,
430 unsigned int pick_type,
432 bool has_pick_map) = 0;
479 int instance_group = -1,
564 template <
class GeoPrim>
566 const GeoPrim *&prim)
570 prim =
dynamic_cast<const GeoPrim *
>(geo->
getPrimitive(0));
586 int real_connect_start,
587 int real_connect_num);
598 int real_connect_start,
599 int real_connect_num);
608 int real_connect_start,
609 int real_connect_num);
616 unsigned int picktype,
630 unsigned int picktype,
642 bool inconclusive_stream_too =
false,
650 unsigned int picktype);
663 { myGAPrimMask = m; }
666 { myDecorMask =
mask; }
690 int real_connect_start,
691 int real_connect_num);
695 int32 myDispOptVersion;
698 unsigned myPrimUsed : 1,
699 myUserDecorationsProcessed : 1,
724 myDispOptInit =
true;
735 myCachedPrim = primh;
738 myUserDecorationsProcessed =
false;
743 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)
virtual bool supportsParallelDraw() const
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)