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,
217 virtual bool isRasterizedInView(
const UT_Matrix4F &objviewproj,
227 virtual bool supportsRenderUV();
234 {
return myAlphaPassMask &
alpha; }
245 { myAlphaPassMask =
mask; }
247 {
return myAlphaPassMask; }
278 bool showSelections()
const;
281 bool canDoInstancing()
const;
284 bool isObjectSelection()
const;
289 {
return mySupportsDynamicCulling; }
291 { mySupportsDynamicCulling = dc; }
297 {
return myDispOptVersion; }
302 return myDispOptVersion;
312 if(prim != myCachedPrim)
322 virtual void retirePrimitive();
336 const char *cache_name);
343 { myParentPrimType =
type; }
345 {
return myParentPrimType; }
351 { getGeoRenders(renders); }
394 if( myRef.add(-1) == 0)
404 const char *cache_name,
443 unsigned int pick_type,
445 bool has_pick_map) = 0;
492 int instance_group = -1,
577 template <
class GeoPrim>
579 const GeoPrim *&prim)
583 prim =
dynamic_cast<const GeoPrim *
>(geo->
getPrimitive(0));
599 int real_connect_start,
600 int real_connect_num);
611 int real_connect_start,
612 int real_connect_num);
621 int real_connect_start,
622 int real_connect_num);
629 unsigned int picktype,
643 unsigned int picktype,
655 bool inconclusive_stream_too =
false,
663 unsigned int picktype);
676 { myGAPrimMask = m; }
679 { myDecorMask =
mask; }
703 int real_connect_start,
704 int real_connect_num);
708 int32 myDispOptVersion;
711 unsigned myPrimUsed : 1,
712 myUserDecorationsProcessed : 1,
737 myDispOptInit =
true;
748 myCachedPrim = primh;
751 myUserDecorationsProcessed =
false;
756 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 void getBeautyGeoRenders(UT_Array< GR_GeoRender * > &renders)
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
GLint GLint GLsizei GLint GLenum GLenum type
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...
GA_API const UT_StringHolder parms
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
virtual bool supportsParallelUpdate() const
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)