10 #ifndef __GR_PrimInstance__
11 #define __GR_PrimInstance__
30 const char *
className()
const override {
return "GR_PrimInstance"; }
39 myNestLevel = nest_level;
41 myTopLevelTransforms.entries(0);
47 { myTopLevelTransforms = top_xforms; }
52 (myInstance?myInstance->updateOnViewChange(dopts):
false)); }
65 bool &defer)
override;
86 mat = myInstancedTransforms(0);
94 if(myTopLevelTransforms.entries())
95 return myTopLevelTransforms.entries();
96 return myInstancedTransforms.entries();
100 return myInstancedTransforms.entries();
108 {
return myExtractTransfomCache; }
111 {
return myInstancedTransforms; }
116 {
return myInstancedTransforms(instance_index); }
125 bool check_lod_centroid);
131 bool has_partial_vis,
132 bool has_culled_instances,
157 void buildNestedInstancing();
163 void determineNestedVisibility(
int offset,
181 ExtractTransformCache myExtractTransfomCache;
184 int myInstancesPerPrim;
185 bool myHasObjectInstancing;
186 bool myHasCentroidLOD;
190 bool myIsInstanceFile;
191 bool myQueuedPointIDValid;
192 bool myRenderFullLOD;
194 bool myHasPartialVisibility;
195 bool myHasPartialBBoxVisibility;
196 bool myVisArraysDirty;
ExtractTransformCache & getExtractTransformCache()
bool getSingleTransform(UT_Matrix4D &mat) const override
void render(RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp) override
Set of parameters sent to GR_Primitive::viewUpdate().
const char * className() const override
Return a string version of this class's name.
void viewUpdate(RE_RenderContext r, const GR_ViewUpdateParms &parms) override
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
GT_API const UT_StringHolder cache_name
exint getNumGLPrimitives(const GR_DisplayOption *) override
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
void setNestLevel(int nest_level)
bool updateOnViewChange(const GR_DisplayOption &dopts) const override
If this primitive requires an update when the view changes, return true.
Temporary container for either a RV_Render and an RE_Render.
GT_PrimInstance::ExtractTransformEntry ExtractTransformEntry
set of parameters sent to GR_Primitive::update()
virtual UT_Matrix4D getTransform(int) const
GT_PrimInstance::ExtractTransformCache ExtractTransformCache
GR_BasePrimType getBasePrimType() const override
The base primitive type is usually NORMAL unless this is a packed type.
void setTopTransforms(const UT_Matrix4DArray &top_xforms)
void checkForDeferredDraw(const 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) override
UT_Matrix4DArray & getInstancedTransforms()
virtual int getNumInstances() const
int getNumTransforms() const
void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p) override
int getNumTopTransforms() const
bool inViewFrustum(const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr) override