10 #ifndef __GR_PrimPacked__
11 #define __GR_PrimPacked__
37 const char *
className()
const override {
return "GR_PrimPacked"; }
42 {
return myInstancedPrim; }
51 { myPrimIndex = pindex; }
70 bool &defer)
override;
82 unsigned int pick_type,
84 bool has_pick_map)
override;
86 bool checkForTransformChange();
91 bool first_init)
override;
132 {
return myPrimVisible; }
134 { myPrimVisible =
v; }
142 {
return myInstancePrimTransform; }
145 { mat = myInstancePrimTransform;
return true; }
163 void buildInstPrimTransform();
171 void updateLightLinking();
178 int &prev_mask)
const;
181 int prev_mask)
const;
205 GR_InstanceBufferPtr myColorBuf;
229 GR_InstanceBufferPtr mySelectionBuf;
273 :
GR_PrimPacked(info, cache_name,packed_prim,instanced_prim,instanced_gdp)
277 const char *
className()
const override {
return "GR_PrimPackedMesh"; }
289 return myInstance->checkDisplayOptionChange(opts);
353 return myInstance->getGAPrimitive(gdp, primitive_id);
362 return myInstance->getGAVertex(gdp, vertex_id);
385 return myInstance->inViewFrustum(objviewproj, bbox);
396 return myInstance->isRasterizedInView(objviewproj, min_proj_size,bbox);
GT_API const UT_StringHolder selection
virtual bool inViewFrustum(const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr)
virtual bool getSingleTransform(UT_Matrix4D &mat) const
virtual void render(RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp)=0
bool isRasterizedInView(const UT_Matrix4F &objviewproj, const UT_Vector2F &min_proj_size, const UT_BoundingBoxF *bbox) override
void cleanup(RE_RenderContext r) override
virtual bool updateOnViewChange(const GR_DisplayOption &) const
If this primitive requires an update when the view changes, return true.
virtual exint getNumGLPrimitives(const GR_DisplayOption *)
virtual bool requiresAlphaPass() const
Return true if this primitive requires an alpha pass.
UT_IntArray myBBoxInstances
RE_VertexArray * myColorVA
int64 myInstancedDetailID
int64 myInstancedDetailCacheCount
const GA_Primitive * getGAPrimitive(const GU_Detail *gdp, exint primitive_id) const override
bool needsGLStateCheck(const GR_DisplayOption &opts) const override
Set of parameters sent to GR_Primitive::viewUpdate().
RE_VertexArray * mySelectionVA
GR_PrimitivePtr myInstance
GT_DataArrayHandle myPointIDs
virtual bool supportsParallelDraw() const
RE_VertexArrayRef myCenterPointP
bool myIsConsolidatedMesh
void viewUpdate(RE_RenderContext r, const GR_ViewUpdateParms &parms) override
GT_PrimitiveHandle myPackedPrim
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
UT_Vector3F myInstancePoint
GT_API const UT_StringHolder cache_name
exint getNumGLPrimitives(const GR_DisplayOption *) override
GR_SelectMode myPointSelectMode
GLboolean GLboolean GLboolean GLboolean a
UT_UniquePtr< GR_GeoRender > myCenterPrimsGeo
GR_PrimPackedMesh(const GR_RenderInfo *info, const char *cache_name, const GT_PrimitiveHandle &packed_prim, const GT_PrimitiveHandle &instanced_prim, const GU_ConstDetailHandle &instanced_gdp)
A class that manages material assignments to different groups of primitives.
RE_CacheVersion myCenterPointCacheVersion
Temporary container for either a RV_Render and an RE_Render.
bool setup(const GR_DisplayOption *) override
virtual void viewUpdate(RE_RenderContext r, const GR_ViewUpdateParms &parms)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
void setPrimVisible(bool v)
set of parameters sent to GR_Primitive::update()
GT_DataArrayHandle myPrimIDs
UT_BoundingBox * myAssignedBBox
GT_PrimitiveHandle getInstancePrim() const override
GT_API const UT_StringHolder point_id
virtual int renderPick(RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map)=0
UT_StringArray myShadowMasks
virtual void checkForDeferredDraw(RE_RenderContext r, GR_RenderMode mode, GR_RenderFlags flags, const GR_DrawParms &dp, const UT_Matrix4D &proj_view, const UT_Matrix4D &object, const UT_Vector2F &min_proj_size, bool &visible, bool &defer)
bool requiresAlphaPass() const override
Return true if this primitive requires an alpha pass.
virtual const GA_Primitive * getGAPrimitive(const GU_Detail *gdp, exint primitive_id) const
bool isPrimVisible() const override
UT_Map< int, UT_IntArray > myMaterialGroups
RE_VertexArrayRef myCenterPrimP
const char * className() const override
Return a string version of this class's name.
virtual UT_Matrix4D getTransform(int) const
RE_VertexArrayRef myCenterPrimInstMat
virtual bool needsGLStateCheck(const GR_DisplayOption &opts) const
virtual bool renderInAlphaPass(GR_AlphaPass a)
Return true if this primitive renders in the specified alpha pass.
virtual void retirePrimitive()
Called when a node is no longer actively displayed, but still cached.
UT_StringMap< int > myShadowMaskMap
GT_API const UT_StringHolder primitive_id
bool updateOnViewChange(const GR_DisplayOption &) const override
If this primitive requires an update when the view changes, return true.
bool checkGLState(RE_RenderContext r, const GR_DisplayOption &opt) override
GR_BasePrimType getBasePrimType() const override
The base primitive type is usually NORMAL unless this is a packed type.
RE_Geometry * myCenterPrims
virtual RE_Geometry * getDecorationGeometry()
UT_StringArray myLightLinks
virtual bool getBoundingBox(UT_BoundingBoxD &bbox) const
Returns the bounding box of this primitive if it can be determined.
GA_Index myOverridePrimID
virtual void cleanup(RE_RenderContext r)
UT_Matrix4D myInstancePrimTransform
virtual void renderDecoration(RE_RenderContext r, GR_Decoration decor, const GR_DecorationParms &parms)
virtual bool setup(const GR_DisplayOption *)
UT_StringMap< int > myLightLinkMap
virtual bool isRasterizedInView(const UT_Matrix4F &objviewproj, const UT_Vector2F &min_proj_size, const UT_BoundingBoxF *bbox=nullptr)
UT_Matrix4D myBBoxTransform
RE_VertexArrayRef myCenterPointInstMat
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
UT_SharedPtr< GU_Selection > GU_SelectionHandle
UT_BoundingBoxD myCachedBBox
GA_Index myOverridePointID
GT_PrimitiveType myInstancedPrimType
GU_ConstDetailHandle myInstancedDetail
GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init) override
virtual GR_PrimAcceptResult acceptPrimitive(GT_PrimitiveType t, int geo_type, const GT_PrimitiveHandle &ph, const GEO_Primitive *prim)=0
GT_DataArrayHandle myLODMask
virtual int getNumInstances() const
UT_IntArray myPointInstances
virtual bool isFragment() const
virtual bool checkGLState(RE_RenderContext r, const GR_DisplayOption &opts)
virtual void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p)=0
const GT_PrimitiveHandle & instancePrim() const
GR_SelectMode mySelectMode
UT_UniquePtr< GR_GeoRender > myCenterPointsGeo
RE_Geometry * getDecorationGeometry() override
Simple class for a mutli-integer cache tag.
bool getBoundingBox(UT_BoundingBoxD &bbox) const override
Returns the bounding box of this primitive if it can be determined.
exint getGAVertex(const GU_Detail *gdp, exint vertex_id) const override
GT_PrimitiveHandle myInstancedPrim
const GT_PrimitiveHandle & packedPrim() const
GT_DataArrayHandle myPickIDs
const char * className() const override
Return a string version of this class's name.
bool renderInAlphaPass(GR_AlphaPass a) override
Return true if this primitive renders in the specified alpha pass.
GT_API const UT_StringHolder vertex_id
virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init)
GR_MaterialGroups myMatGroups
bool inViewFrustum(const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr) override
void setPrimIndex(int pindex)
RE_Geometry * myCenterPoints
virtual exint getGAVertex(const GU_Detail *gdp, exint vertex_id) const
GR_BasePrimType getBasePrimType() const override
The base primitive type is usually NORMAL unless this is a packed type.