12 #ifndef GR_PRIMITIVE_H
13 #define GR_PRIMITIVE_H
58 virtual const char *className()
const = 0;
91 {
return bool(mask & myGAPrimMask); }
111 DISPLAY_VERSION_CHANGED
142 int instance_group = -1);
168 unsigned int pick_type,
204 virtual bool isRasterizedInView(
const UT_Matrix4F &objviewproj,
214 virtual bool supportsRenderUV();
221 {
return myAlphaPassMask &
alpha; }
226 return myOnionSkinInfo.has_value()
227 == is_onion_skin_pass;
241 { myAlphaPassMask =
mask; }
244 { myOnionSkinInfo = info; }
248 {
return myAlphaPassMask; }
251 {
return myOnionSkinInfo; }
253 {
return myLatestOnionSkinGroup; }
256 return myOnionSkinInfo &&
257 myOnionSkinInfo->myRenderMode ==
290 bool showSelections()
const;
293 bool canDoInstancing()
const;
296 bool isObjectSelection()
const;
301 {
return mySupportsDynamicCulling; }
303 { mySupportsDynamicCulling = dc; }
309 {
return myDispOptVersion; }
314 return myDispOptVersion;
324 if(prim != myCachedPrim)
334 virtual void retirePrimitive();
344 const char *cache_name);
351 { myParentPrimType =
type; }
353 {
return myParentPrimType; }
359 { getGeoRenders(renders); }
402 if( myRef.add(-1) == 0)
408 { mySelectedEdges = selected_edge; }
416 const char *cache_name,
455 unsigned int pick_type,
457 bool has_pick_map) = 0;
496 int instance_group = -1,
554 template <
class GeoPrim>
556 const GeoPrim *&prim)
560 prim =
dynamic_cast<const GeoPrim *
>(geo->
getPrimitive(0));
576 int real_connect_start,
577 int real_connect_num);
586 int real_connect_start,
587 int real_connect_num);
594 unsigned int picktype,
606 bool inconclusive_stream_too =
false,
614 unsigned int picktype);
627 { myGAPrimMask = m; }
630 { myDecorMask =
mask; }
657 int real_connect_start,
658 int real_connect_num);
662 int32 myDispOptVersion;
665 unsigned myPrimUsed : 1,
666 myUserDecorationsProcessed : 1,
696 myDispOptInit =
true;
707 myCachedPrim = primh;
710 myUserDecorationsProcessed =
false;
718 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.
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
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
UT_Optional< int > getOnionSkinGroup() const
std::optional< T > UT_Optional
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
const GR_RenderInfo * getRenderInfo() const
virtual GT_PrimitiveHandle getInstancePrim() const
const GR_RenderInfo * myInfo
#define utZoneScopedFlag(F)
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()
void setOnionSkinInfo(UT_Optional< GU_OnionSkinPrimRenderInfo > info)
Contains transitional objects to provide some backward compatibility for code that references old GEO...
void setSelectedEdgeGroup(const GA_EdgeGroup *selected_edge)
pass highlighted edge groups from GUI to GR
GA_API const UT_StringHolder parms
bool supportsDynamicCulling() const
UT_Optional< GU_OnionSkinPrimRenderInfo > getOnionSkinInfo() 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()
bool isOutlineOnionSkin() const
void setPrimUsed(bool used)
void supportsDynamicCulling(bool dc)
virtual void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p)=0
bool drawInOnionSkinPass(bool is_onion_skin_pass) const
Returns true if this should be drawn in the given onion skin pass.
void updateDecoration(RE_RenderContext r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RV_Geometry *geo)
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)