HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_PrimPacked Class Reference

#include <GR_PrimPacked.h>

+ Inheritance diagram for GR_PrimPacked:

Public Member Functions

 GR_PrimPacked (const GR_RenderInfo *info, const char *cache_name, const GT_PrimitiveHandle &packed_prim, const GT_PrimitiveHandle &instanced_prim, const GU_ConstDetailHandle &instanced_gdp, int prim_index=-1)
 
 ~GR_PrimPacked () override
 
const char * className () const override
 Return a string version of this class's name. More...
 
GR_BasePrimType getBasePrimType () const override
 The base primitive type is usually NORMAL unless this is a packed type. More...
 
GT_PrimitiveHandle getInstancePrim () const override
 
const GT_PrimitiveHandleinstancePrim () const
 
const GT_PrimitiveHandlepackedPrim () const
 
void setPackedPrim (const GT_PrimitiveHandle &packed_prim)
 
void setInstancedPrim (const GT_PrimitiveHandle &instance, const GU_ConstDetailHandle &inst_gdp)
 
void setPrimIndex (int pindex)
 
GR_PrimAcceptResult acceptPrimitive (GT_PrimitiveType t, int geo_type, const GT_PrimitiveHandle &ph, const GEO_Primitive *prim) override
 
void update (RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p) override
 
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
 
void render (RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp) override
 
void renderDecoration (RE_RenderContext r, GR_Decoration decor, const GR_DecorationParms &parms) override
 
int renderPick (RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map) override
 
bool checkForTransformChange ()
 
GR_DispOptChange displayOptionChange (const GR_DisplayOption &opts, bool first_init) override
 
bool updateOnViewChange (const GR_DisplayOption &) const override
 If this primitive requires an update when the view changes, return true. More...
 
void viewUpdate (RE_RenderContext r, const GR_ViewUpdateParms &parms) override
 
bool needsGLStateCheck (const GR_DisplayOption &opts) const override
 
bool checkGLState (RE_RenderContext r, const GR_DisplayOption &opt) override
 
bool setup (const GR_DisplayOption *) override
 
void cleanup (RE_RenderContext r) override
 
bool requiresAlphaPass () const override
 Return true if this primitive requires an alpha pass. More...
 
const GA_PrimitivegetGAPrimitive (const GU_Detail *gdp, exint primitive_id) const override
 
exint getGAVertex (const GU_Detail *gdp, exint vertex_id) const override
 
RE_GeometrygetDecorationGeometry () override
 
bool renderInAlphaPass (GR_AlphaPass a) override
 Return true if this primitive renders in the specified alpha pass. More...
 
bool inViewFrustum (const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr) override
 
bool isRasterizedInView (const UT_Matrix4F &objviewproj, const UT_Vector2F &min_proj_size, const UT_BoundingBoxF *bbox) override
 
bool getBoundingBox (UT_BoundingBoxD &bbox) const override
 Returns the bounding box of this primitive if it can be determined. More...
 
exint getNumGLPrimitives (const GR_DisplayOption *) override
 
void retirePrimitive () override
 Called when a node is no longer actively displayed, but still cached. More...
 
GR_SelectMode getSelectionMode (const GU_Detail &gdp, GU_SelectionHandle &selection) const
 
void setPickID (GA_Index prim_id, GA_Index point_id)
 
void setInstanceHookPrim (GR_Primitive *prim)
 
bool isPrimVisible () const override
 
void setPrimVisible (bool v)
 
bool supportsParallelDraw () const override
 
- Public Member Functions inherited from GR_Primitive
bool setCacheName (const char *cache_name)
 
virtual void resetPrimitives ()
 
bool typeMask (GEO_PrimTypeCompat::TypeMask mask) const
 returns true if this primitive's type mask is part of "mask". More...
 
GR_DispOptChange checkDisplayOptionChange (const GR_DisplayOption &opts)
 
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. More...
 
virtual void updateInstanceGroupGL (const RE_VertexArray *array, int instance_group=-1, const char *attrib_name=NULL, RE_GenericAttribID id=RE_GENATTRIB_NONE)
 
virtual void updateInstanceGroup (const GR_InstanceBuffer *buffer, int instance_group=-1)
 
void draw (RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags render_flags, GR_DrawParms parms)
 
int drawPick (RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map)
 
virtual void setupDrawDecorations (RE_RenderContext r)
 Called just before drawing our first decoration. More...
 
void drawDecoration (RE_RenderContext r, GR_Decoration decor, const GR_DecorationParms &parms)
 
int64 supportedDecorations ()
 
virtual bool supportsRenderUV ()
 Return true if this primitive supports drawing into a UV viewport. More...
 
bool drawInAlphaPass (GR_AlphaPass alpha) const
 Return true if this should be drawn in the given alpha pass. More...
 
void setAlphaPassMask (int mask)
 
int getAlphaPassMask () const
 
GR_RenderVersion getRenderVersion () const
 The GL render version to use for this primitive. More...
 
bool showSelections () const
 whether to display component selections or not. More...
 
bool canDoInstancing () const
 Instancing matrix list and version (for the vertex array) More...
 
bool isObjectSelection () const
 Returns true if the full object is selected at the scene level. More...
 
bool supportsDynamicCulling () const
 
void supportsDynamicCulling (bool dc)
 
int32 getDisplayOptionVersion () const
 
int32 bumpDisplayOptionVersion ()
 
virtual bool isHighlighted () const
 Only for the Scene Graph view: highlighted prims. More...
 
void setPrimUsed (bool used)
 
bool isPrimUsed () const
 
void setParentPrimType (GR_BasePrimType type)
 set for those primitives that are within packed primitives More...
 
GR_BasePrimType getParentPrimType () const
 
const GR_RenderInfogetRenderInfo () const
 
virtual void getGeoRenders (UT_Array< GR_GeoRender * > &renders)
 
void addUpdateMessage (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addUpdateWarning (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addUpdateError (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addUpdateFatal (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawMessage (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawWarning (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawError (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawFatal (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
const char * getCacheName () const
 The base GL cache name assigned to this primitive. More...
 
void incref ()
 
void decref ()
 
GT_PrimitiveHandle getCachedGTPrimitive ()
 
void cacheGTPrimitive (const GT_PrimitiveHandle &prim)
 

Protected Member Functions

virtual int getNumInstances () const
 
virtual UT_Matrix4D getTransform (int) const
 
virtual bool isFragment () const
 
virtual bool getSingleTransform (UT_Matrix4D &mat) const
 
bool updateCacheName (const GT_PrimitiveHandle &iph, const GR_UpdateParms &p, bool fallback)
 
void updateInstanceGeometry (RE_RenderContext r, const GT_PrimitiveHandle &container_prim, const GR_UpdateParms &p, bool build_anchors, GR_UpdateReason full_update)
 
bool fetchBoundingBox (UT_BoundingBoxD &bbox) const
 
virtual void buildAnchorsGL3 (RE_RenderContext r, const GR_UpdateParms &p, GR_UpdateReason full_reason, const GT_PrimitiveHandle &xforms)
 
void buildPickID (const GT_PrimitiveHandle &pid)
 
RE_GeometrybuildPickBBox (RE_RenderContext r) const
 
void buildInstPrimTransform ()
 
GR_UpdateReason checkForPackedGeoChanges (const GT_PrimitiveHandle &ph, GR_UpdateReason reason)
 
GR_UpdateParms checkForPackedMaterialAssignment (const GR_UpdateParms &p)
 
void updateLightLinking ()
 
void updateLinkMap (const UT_StringRef &attrib_name, UT_StringMap< int > &link_map, UT_StringArray &list, bool &has_link)
 
bool setLightLinkMask (RE_RenderContext rc, GR_DrawParms &dp, int &prev_mask) const
 
void restoreLightLinkMask (RE_RenderContext rc, GR_DrawParms &dp, int prev_mask) const
 
- Protected Member Functions inherited from GR_Primitive
 GR_Primitive (const GR_RenderInfo *info, const char *cache_name, GEO_PrimTypeCompat::TypeMask gaprimtype)
 
virtual ~GR_Primitive ()
 
bool standardMarkersChanged (const GR_DisplayOption &opts, const GR_Decoration *markers, bool first_init)
 
void updateDecoration (RE_RenderContext r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RE_Geometry *geo)
 
void updateDecoration (RE_RenderContext r, GR_Decoration dec, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, RV_Geometry *geo)
 
void updateDecorationList (RE_RenderContext r, const GR_Decoration *pdecs, const GR_UpdateParms &p, const GT_PrimitiveHandle &prim, GR_GeoRender *geo)
 
void drawDecoration (RE_RenderContext r, GR_GeoRender *geo, GR_Decoration dec, const GR_DisplayOption *opts, GR_DecorRenderFlags flags, bool overlay, bool override_vis, int instance_group=-1, GR_SelectMode *select_override=NULL, GR_DecorationRender::PrimitiveType t=GR_DecorationRender::PRIM_TRIANGLE)
 
void drawVisualizer (RE_RenderContext r, GR_GeoRender *geo, const GR_VisualizerInfo *dec_info, const GR_DisplayOption *opts, GR_DecorRenderFlags flags, GR_DecorationRender::PrimitiveType ptype=GR_DecorationRender::PRIM_TRIANGLE)
 
void drawDecorationForGeo (RE_RenderContext r, RE_Geometry *geo, GR_Decoration dec, const GR_DisplayOption *opts, GR_DecorRenderFlags flags, bool overlay, bool override_vis, int instance_group, GR_SelectMode smode, GR_DecorationRender::PrimitiveType t=GR_DecorationRender::PRIM_TRIANGLE, RE_OverrideList *override_list=NULL)
 
void drawVisualizerForGeo (RE_RenderContext r, RE_Geometry *geo, const GR_VisualizerInfo *dec_info, const GR_DisplayOption *opts, GR_DecorRenderFlags flags, GR_DecorationRender::PrimitiveType ptype=GR_DecorationRender::PRIM_TRIANGLE)
 
void drawDecorationForGeo (RE_RenderContext r, RV_Geometry *geo, GR_Decoration dec, const GR_DisplayOption *opts, GR_DecorRenderFlags flags, bool overlay, bool override_vis, int instance_group, GR_SelectMode smode, GR_DecorationRender::PrimitiveType t=GR_DecorationRender::PRIM_TRIANGLE, RE_OverrideList *override_list=NULL)
 
void drawVisualizerForGeo (RE_RenderContext r, RV_Geometry *geo, const GR_VisualizerInfo *dec_info, const GR_DisplayOption *opts, GR_DecorRenderFlags flags, GR_DecorationRender::PrimitiveType ptype=GR_DecorationRender::PRIM_TRIANGLE)
 
void drawGeoRender (RE_RenderContext r, GR_GeoRender *geo, GR_RenderMode mode, GR_RenderFlags flags, GR_DrawParms dp)
 
bool checkUserOptions (const GR_DisplayOption &opt) const
 
void updateUserOptions (const GR_DisplayOption &opt)
 
const GR_UserOptiongetUserDecoration (GR_Decoration dec) const
 
void updateUserDecorations (RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, RE_Geometry *for_geo=NULL)
 
GR_DispOptChange checkColorOverride (const GR_DisplayOption &opts, bool first_init)
 
GT_PrimitivecreateUnitSphere (const GT_RefineParms &parms)
 
template<class GeoPrim >
void getGEOPrimFromGT (const GT_PrimitiveHandle &primh, const GeoPrim *&prim)
 
int doPickPoints (RE_RenderContext r, const GR_DisplayOption *opts, GR_GeoRender *gr, RE_Geometry *geo, GR_SelectMode select_mode, int select_inst, GR_PickStyle pickstyle, bool has_pick_map, RE_PrimType real_prim_type, int real_connect_start, int real_connect_num)
 
int doPickPoints (RE_RenderContext r, const GR_DisplayOption *opts, GR_GeoRender *gr, RV_Geometry *geo, GR_SelectMode select_mode, int select_inst, GR_PickStyle pickstyle, bool has_pick_map, RE_PrimType real_prim_type, int real_connect_start, int real_connect_num)
 
int doPickPoints (RE_RenderContext r, const GR_DisplayOption *opts, GR_GeoRender *gr, GR_PickStyle pickstyle, bool has_pick_map, RE_PrimType real_prim_type, int real_connect_start, int real_connect_num)
 Do picking for point attribute on GeoRender gr More...
 
int getPickBufferSize (RE_Geometry *geo, unsigned int picktype, int &vector_size, bool &needs_2pass, int start_group=4, int end_group=-1, GR_PickStyle pickstyle=GR_PICK_NONE) const
 
int getPickBufferSize (const GR_PickRender *geo, unsigned int picktype, int &vector_size, bool &needs_2pass, int start_group=4, int end_group=-1, GR_PickStyle pickstyle=GR_PICK_NONE) const
 
GR_PickBuffercreatePickBuffer (RE_RenderContext r, int buffer_size, int vector_size=1, bool inconclusive_stream_too=false, const GR_PickRender *geo=nullptr)
 
UT_UniquePtr< GR_PickRendercreatePickRender (RE_RenderContext r, const GR_DisplayOption *opts, GR_GeoRender *gr, unsigned int picktype)
 
int accumulatePickIDs (RE_RenderContext r, int npicks, GR_PickBuffer *pick_buffer=NULL)
 
GR_PickCompMode setupPrimPickMode (RE_RenderContext r, GR_GeoRender *geo) const
 
void setPrimTypeMask (GEO_PrimTypeCompat::TypeMask m)
 
void setSupportedDecorations (int64 mask)
 
bool checkForRibbons (const GR_UpdateParms &p, const GT_PrimitiveHandle &primh) const
 

Protected Attributes

GT_PrimitiveHandle myPackedPrim
 
RE_GeometrymyCenterPoints
 
RE_GeometrymyCenterPrims
 
RE_CacheVersion myCenterPointCacheVersion
 
UT_UniquePtr< GR_GeoRendermyCenterPointsGeo
 
UT_UniquePtr< GR_GeoRendermyCenterPrimsGeo
 
GR_PrimitivePtr myInstance
 
GU_ConstDetailHandle myInstancedDetail
 
GT_PrimitiveHandle myInstancedPrim
 
GT_PrimitiveType myInstancedPrimType
 
int64 myInstancedDetailID
 
int64 myInstancedDetailCacheCount
 
UT_Vector3F myInstancePoint
 
UT_Matrix4D myInstancePrimTransform
 
UT_BoundingBoxmyAssignedBBox
 
UT_Matrix4D myBBoxTransform
 
RE_VertexArraymyColorVA
 
GR_SelectMode mySelectMode
 
GR_SelectMode myPointSelectMode
 
int64 myTopVersion
 
int64 myMatVersion
 
int64 myPrimVersion
 
int64 myPackedPVersion
 
int64 myAlembicVersion
 
GT_DataArrayHandle myPickIDs
 
GT_DataArrayHandle myPrimIDs
 
GT_DataArrayHandle myPointIDs
 
GT_DataArrayHandle myLODMask
 
UT_IntArray myBBoxInstances
 
UT_IntArray myPointInstances
 
RE_VertexArrayRef myCenterPointP
 
RE_VertexArrayRef myCenterPointInstMat
 
RE_VertexArrayRef myCenterPrimP
 
RE_VertexArrayRef myCenterPrimInstMat
 
RE_VertexArraymySelectionVA
 
bool myPrimSwappedFlag
 
bool myPrimTypeChanged
 
int64 myPrimUniqueID
 
GR_MaterialGroups myMatGroups
 
UT_Map< int, UT_IntArraymyMaterialGroups
 
bool myIsVisible
 
bool myPrimVisible
 
bool myQueuedDrawValid
 
bool myIsConsolidatedMesh
 
int myQueuedBBoxID
 
UT_BoundingBoxD myCachedBBox
 
bool myCachedBBoxValid
 
UT_StringArray myLightLinks
 
UT_StringMap< intmyLightLinkMap
 
bool myHasLightLink
 
UT_StringArray myShadowMasks
 
UT_StringMap< intmyShadowMaskMap
 
bool myHasShadowMask
 
GA_Index myPrimID
 
GA_Index myOverridePointID
 
GA_Index myOverridePrimID
 
int myPrimIndex
 
- Protected Attributes inherited from GR_Primitive
bool myHasDetailPointNormal
 
bool mySupportsDynamicCulling
 
GR_DecorationRendermyDecorRender
 
const GR_RenderInfomyInfo
 
UT_BoundingBoxF myBBox
 
UT_Matrix4D myLocal
 
int myQueuedDrawID
 
int myQueuedPointID
 

Additional Inherited Members

- Public Types inherited from GR_Primitive
enum  GR_DispOptChange { DISPLAY_UNCHANGED, DISPLAY_CHANGED, DISPLAY_VERSION_CHANGED }
 
- Static Public Member Functions inherited from GR_Primitive
static GR_PrimitivecreatePrimitive (GT_PrimitiveType ptype, int geo_type, const GR_RenderInfo *info, const char *cache_name)
 

Detailed Description

Definition at line 25 of file GR_PrimPacked.h.

Constructor & Destructor Documentation

GR_PrimPacked::GR_PrimPacked ( const GR_RenderInfo info,
const char *  cache_name,
const GT_PrimitiveHandle packed_prim,
const GT_PrimitiveHandle instanced_prim,
const GU_ConstDetailHandle instanced_gdp,
int  prim_index = -1 
)
GR_PrimPacked::~GR_PrimPacked ( )
override

Member Function Documentation

GR_PrimAcceptResult GR_PrimPacked::acceptPrimitive ( GT_PrimitiveType  t,
int  geo_type,
const GT_PrimitiveHandle ph,
const GEO_Primitive prim 
)
overridevirtual

returns true if the given GT primitive can be rendered by this primitive if t==GT_GEO_PRIMITIVE, geo_type will be the geo type id and prim will be non-NULL. If t is any other type, ph will be a valid GT primitive. The primitives themselves can be used for more sophisticated matching.

Implements GR_Primitive.

virtual void GR_PrimPacked::buildAnchorsGL3 ( RE_RenderContext  r,
const GR_UpdateParms p,
GR_UpdateReason  full_reason,
const GT_PrimitiveHandle xforms 
)
protectedvirtual
void GR_PrimPacked::buildInstPrimTransform ( )
protected
RE_Geometry* GR_PrimPacked::buildPickBBox ( RE_RenderContext  r) const
protected
void GR_PrimPacked::buildPickID ( const GT_PrimitiveHandle pid)
protected
void GR_PrimPacked::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 
)
overridevirtual

Reimplemented from GR_Primitive.

GR_UpdateReason GR_PrimPacked::checkForPackedGeoChanges ( const GT_PrimitiveHandle ph,
GR_UpdateReason  reason 
)
protected
GR_UpdateParms GR_PrimPacked::checkForPackedMaterialAssignment ( const GR_UpdateParms p)
protected
bool GR_PrimPacked::checkForTransformChange ( )
bool GR_PrimPacked::checkGLState ( RE_RenderContext  r,
const GR_DisplayOption opts 
)
inlineoverridevirtual

For primitives that may need updating if the GL state changes, this hook allows you to perform a check if no update is otherwise required. Return true to have checkGLState() called. Returning true from that will trigger an update.

Reimplemented from GR_Primitive.

Definition at line 317 of file GR_PrimPacked.h.

const char* GR_PrimPacked::className ( ) const
inlineoverridevirtual

Return a string version of this class's name.

Implements GR_Primitive.

Reimplemented in GR_PrimPackedMesh.

Definition at line 37 of file GR_PrimPacked.h.

void GR_PrimPacked::cleanup ( RE_RenderContext  r)
inlineoverridevirtual

called once per viewport draw, setup() before any renders are done, and cleanup() after all are complete. There is a possibility that render() may not be called at all.

Reimplemented from GR_Primitive.

Definition at line 333 of file GR_PrimPacked.h.

GR_Primitive::GR_DispOptChange GR_PrimPacked::displayOptionChange ( const GR_DisplayOption opts,
bool  first_init 
)
inlineoverridevirtual

Called when the geometry-related display options change, to determine if an update is required. By default, no update is required. If the options did change, return either DISPLAY_CHANGED, which will call update() without bumping the display option version, or DISPLAY_VERSION_CHANGED, which will bump the version. If 'first_init' is true, this is being called to initialize any cached display options. The return value will be ignored. This will happen just after the primitive is created.

Reimplemented from GR_Primitive.

Definition at line 285 of file GR_PrimPacked.h.

bool GR_PrimPacked::fetchBoundingBox ( UT_BoundingBoxD bbox) const
protected
GR_BasePrimType GR_PrimPacked::getBasePrimType ( ) const
inlineoverridevirtual

The base primitive type is usually NORMAL unless this is a packed type.

Reimplemented from GR_Primitive.

Reimplemented in GR_PrimPackedMesh.

Definition at line 39 of file GR_PrimPacked.h.

bool GR_PrimPacked::getBoundingBox ( UT_BoundingBoxD bbox) const
inlineoverridevirtual

Returns the bounding box of this primitive if it can be determined.

Reimplemented from GR_Primitive.

Definition at line 402 of file GR_PrimPacked.h.

RE_Geometry * GR_PrimPacked::getDecorationGeometry ( )
inlineoverridevirtual

return the RE_Geometry containing the geometry to be decorated by user display options. May return NULL if no user decorations are to be shown.

Reimplemented from GR_Primitive.

Definition at line 367 of file GR_PrimPacked.h.

const GA_Primitive * GR_PrimPacked::getGAPrimitive ( const GU_Detail gdp,
exint  primitive_id 
) const
inlineoverridevirtual

Return the GA_Primitive corresponding to this primitive. Some rendering primitives may be comprised of multiple GA/GU primitives. The id parameter (corresponding to the __primitive_id attribute) can be used to extract a specific primitive.

Reimplemented from GR_Primitive.

Definition at line 349 of file GR_PrimPacked.h.

exint GR_PrimPacked::getGAVertex ( const GU_Detail gdp,
exint  vertex_id 
) const
inlineoverridevirtual

Find the vertex offset for a given vertex id. The integer returned corresponds with the GA_Offset for the given vertex. If the vertex_id is invalid, the method will return -1.

Reimplemented from GR_Primitive.

Definition at line 358 of file GR_PrimPacked.h.

GT_PrimitiveHandle GR_PrimPacked::getInstancePrim ( ) const
inlineoverridevirtual

Returns the contained instance prim. Will only be valid if getBasePrimType() is not GR_BASE_PRIM_NORMAL.

Reimplemented from GR_Primitive.

Definition at line 41 of file GR_PrimPacked.h.

exint GR_PrimPacked::getNumGLPrimitives ( const GR_DisplayOption )
inlineoverridevirtual

Return the actual or estimated number of GL primitive that this primitive will be rendering.

Reimplemented from GR_Primitive.

Definition at line 408 of file GR_PrimPacked.h.

virtual int GR_PrimPacked::getNumInstances ( ) const
inlineprotectedvirtual

Definition at line 140 of file GR_PrimPacked.h.

GR_SelectMode GR_PrimPacked::getSelectionMode ( const GU_Detail gdp,
GU_SelectionHandle selection 
) const
virtual bool GR_PrimPacked::getSingleTransform ( UT_Matrix4D mat) const
inlineprotectedvirtual

Reimplemented in GR_PrimAgentShape, and GR_PrimInstance.

Definition at line 144 of file GR_PrimPacked.h.

virtual UT_Matrix4D GR_PrimPacked::getTransform ( int  ) const
inlineprotectedvirtual

Definition at line 141 of file GR_PrimPacked.h.

const GT_PrimitiveHandle& GR_PrimPacked::instancePrim ( ) const
inline

Definition at line 44 of file GR_PrimPacked.h.

bool GR_PrimPacked::inViewFrustum ( const UT_Matrix4D objviewproj,
const UT_BoundingBoxD bbox = nullptr 
)
inlineoverridevirtual

return true if the primitive is in or overlaps the view frustum. always returning true will effectively disable frustum culling. bbox is an option bounding box which can be used for frustum testing.

Reimplemented from GR_Primitive.

Definition at line 381 of file GR_PrimPacked.h.

virtual bool GR_PrimPacked::isFragment ( ) const
inlineprotectedvirtual

Definition at line 143 of file GR_PrimPacked.h.

bool GR_PrimPacked::isPrimVisible ( ) const
inlineoverridevirtual

Reimplemented from GR_Primitive.

Definition at line 131 of file GR_PrimPacked.h.

bool GR_PrimPacked::isRasterizedInView ( const UT_Matrix4F objviewproj,
const UT_Vector2F min_proj_size,
const UT_BoundingBoxF bbox 
)
inlineoverridevirtual

Similar to inViewFrustum, but also considers if the prim is too small to render in the viewport. Also uses 32b FP precision for speed.

Reimplemented from GR_Primitive.

Definition at line 391 of file GR_PrimPacked.h.

bool GR_PrimPacked::needsGLStateCheck ( const GR_DisplayOption opts) const
inlineoverridevirtual

For primitives that may need updating if the GL state changes, this hook allows you to perform a check if no update is otherwise required. Return true to have checkGLState() called. Returning true from that will trigger an update.

Reimplemented from GR_Primitive.

Definition at line 309 of file GR_PrimPacked.h.

const GT_PrimitiveHandle& GR_PrimPacked::packedPrim ( ) const
inline

Definition at line 45 of file GR_PrimPacked.h.

void GR_PrimPacked::render ( RE_RenderContext  r,
GR_RenderMode  render_mode,
GR_RenderFlags  flags,
GR_DrawParms  dp 
)
overridevirtual

Main drawing method. update() will always be called before render(), but render() may execute multiple times before the next update call. This method should be fairly lightweight; do as much work in update() as possible. There is no access to the GU_Detail from this method.

Implements GR_Primitive.

void GR_PrimPacked::renderDecoration ( RE_RenderContext  r,
GR_Decoration  decor,
const GR_DecorationParms parms 
)
overridevirtual

Render the attributes required for decoration 'decor' (like point markers, uv text, normals, etc). 'overlay' should be set to true if currently rendering in the overlay texture, false if in the main viewport.

Reimplemented from GR_Primitive.

bool GR_PrimPacked::renderInAlphaPass ( GR_AlphaPass  a)
inlineoverridevirtual

Return true if this primitive renders in the specified alpha pass.

Reimplemented from GR_Primitive.

Definition at line 373 of file GR_PrimPacked.h.

int GR_PrimPacked::renderPick ( RE_RenderContext  r,
const GR_DisplayOption opt,
unsigned int  pick_type,
GR_PickStyle  pick_style,
bool  has_pick_map 
)
overridevirtual

Render this primitive for picking, where pick_type is defined as one of the pickable bits in GU_SelectType.h (like GR_PICK_GEOPOINT) return the number of picks

Implements GR_Primitive.

bool GR_PrimPacked::requiresAlphaPass ( ) const
inlineoverridevirtual

Return true if this primitive requires an alpha pass.

Reimplemented from GR_Primitive.

Definition at line 341 of file GR_PrimPacked.h.

void GR_PrimPacked::restoreLightLinkMask ( RE_RenderContext  rc,
GR_DrawParms dp,
int  prev_mask 
) const
protected
void GR_PrimPacked::retirePrimitive ( )
overridevirtual

Called when a node is no longer actively displayed, but still cached.

Reimplemented from GR_Primitive.

void GR_PrimPacked::setInstancedPrim ( const GT_PrimitiveHandle instance,
const GU_ConstDetailHandle inst_gdp 
)
void GR_PrimPacked::setInstanceHookPrim ( GR_Primitive prim)
bool GR_PrimPacked::setLightLinkMask ( RE_RenderContext  rc,
GR_DrawParms dp,
int prev_mask 
) const
protected
void GR_PrimPacked::setPackedPrim ( const GT_PrimitiveHandle packed_prim)
void GR_PrimPacked::setPickID ( GA_Index  prim_id,
GA_Index  point_id 
)
void GR_PrimPacked::setPrimIndex ( int  pindex)
inline

Definition at line 50 of file GR_PrimPacked.h.

void GR_PrimPacked::setPrimVisible ( bool  v)
inline

Definition at line 133 of file GR_PrimPacked.h.

bool GR_PrimPacked::setup ( const GR_DisplayOption )
inlineoverridevirtual

called once per viewport draw, setup() before any renders are done, and cleanup() after all are complete. There is a possibility that render() may not be called at all.

Reimplemented from GR_Primitive.

Definition at line 325 of file GR_PrimPacked.h.

bool GR_PrimPacked::supportsParallelDraw ( ) const
overridevirtual

Whether this primitive can have it's render function called from a thread other then the main thread

Reimplemented from GR_Primitive.

void GR_PrimPacked::update ( RE_RenderContext  r,
const GT_PrimitiveHandle primh,
const GR_UpdateParms p 
)
overridevirtual

Main update method, called when conditions change which may require the geometry to be updated. These include geometry changes, selections, volatile display options (level of detail), instancing updates, and some GL state changes (if needsGLStateCheck returns true)

Implements GR_Primitive.

bool GR_PrimPacked::updateCacheName ( const GT_PrimitiveHandle iph,
const GR_UpdateParms p,
bool  fallback 
)
protected
void GR_PrimPacked::updateInstanceGeometry ( RE_RenderContext  r,
const GT_PrimitiveHandle container_prim,
const GR_UpdateParms p,
bool  build_anchors,
GR_UpdateReason  full_update 
)
protected
void GR_PrimPacked::updateLightLinking ( )
protected
void GR_PrimPacked::updateLinkMap ( const UT_StringRef attrib_name,
UT_StringMap< int > &  link_map,
UT_StringArray list,
bool &  has_link 
)
protected
bool GR_PrimPacked::updateOnViewChange ( const GR_DisplayOption ) const
inlineoverridevirtual

If this primitive requires an update when the view changes, return true.

Reimplemented from GR_Primitive.

Definition at line 294 of file GR_PrimPacked.h.

void GR_PrimPacked::viewUpdate ( RE_RenderContext  r,
const GR_ViewUpdateParms parms 
)
inlineoverridevirtual

If updateOnViewChange() returns true, this is called when the view changes.

Reimplemented from GR_Primitive.

Definition at line 302 of file GR_PrimPacked.h.

Member Data Documentation

int64 GR_PrimPacked::myAlembicVersion
protected

Definition at line 214 of file GR_PrimPacked.h.

UT_BoundingBox* GR_PrimPacked::myAssignedBBox
protected

Definition at line 201 of file GR_PrimPacked.h.

UT_IntArray GR_PrimPacked::myBBoxInstances
protected

Definition at line 220 of file GR_PrimPacked.h.

UT_Matrix4D GR_PrimPacked::myBBoxTransform
protected

Definition at line 202 of file GR_PrimPacked.h.

UT_BoundingBoxD GR_PrimPacked::myCachedBBox
mutableprotected

Definition at line 244 of file GR_PrimPacked.h.

bool GR_PrimPacked::myCachedBBoxValid
mutableprotected

Definition at line 245 of file GR_PrimPacked.h.

RE_CacheVersion GR_PrimPacked::myCenterPointCacheVersion
protected

Definition at line 188 of file GR_PrimPacked.h.

RE_VertexArrayRef GR_PrimPacked::myCenterPointInstMat
protected

Definition at line 224 of file GR_PrimPacked.h.

RE_VertexArrayRef GR_PrimPacked::myCenterPointP
protected

Definition at line 223 of file GR_PrimPacked.h.

RE_Geometry* GR_PrimPacked::myCenterPoints
protected

Definition at line 186 of file GR_PrimPacked.h.

UT_UniquePtr<GR_GeoRender> GR_PrimPacked::myCenterPointsGeo
protected

Definition at line 189 of file GR_PrimPacked.h.

RE_VertexArrayRef GR_PrimPacked::myCenterPrimInstMat
protected

Definition at line 226 of file GR_PrimPacked.h.

RE_VertexArrayRef GR_PrimPacked::myCenterPrimP
protected

Definition at line 225 of file GR_PrimPacked.h.

RE_Geometry* GR_PrimPacked::myCenterPrims
protected

Definition at line 187 of file GR_PrimPacked.h.

UT_UniquePtr<GR_GeoRender> GR_PrimPacked::myCenterPrimsGeo
protected

Definition at line 190 of file GR_PrimPacked.h.

RE_VertexArray* GR_PrimPacked::myColorVA
protected

Definition at line 203 of file GR_PrimPacked.h.

bool GR_PrimPacked::myHasLightLink
protected

Definition at line 250 of file GR_PrimPacked.h.

bool GR_PrimPacked::myHasShadowMask
protected

Definition at line 253 of file GR_PrimPacked.h.

GR_PrimitivePtr GR_PrimPacked::myInstance
protected

Definition at line 193 of file GR_PrimPacked.h.

GU_ConstDetailHandle GR_PrimPacked::myInstancedDetail
protected

Definition at line 194 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myInstancedDetailCacheCount
protected

Definition at line 198 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myInstancedDetailID
protected

Definition at line 197 of file GR_PrimPacked.h.

GT_PrimitiveHandle GR_PrimPacked::myInstancedPrim
protected

Definition at line 195 of file GR_PrimPacked.h.

GT_PrimitiveType GR_PrimPacked::myInstancedPrimType
protected

Definition at line 196 of file GR_PrimPacked.h.

UT_Vector3F GR_PrimPacked::myInstancePoint
protected

Definition at line 199 of file GR_PrimPacked.h.

UT_Matrix4D GR_PrimPacked::myInstancePrimTransform
protected

Definition at line 200 of file GR_PrimPacked.h.

bool GR_PrimPacked::myIsConsolidatedMesh
protected

Definition at line 241 of file GR_PrimPacked.h.

bool GR_PrimPacked::myIsVisible
protected

Definition at line 238 of file GR_PrimPacked.h.

UT_StringMap<int> GR_PrimPacked::myLightLinkMap
protected

Definition at line 249 of file GR_PrimPacked.h.

UT_StringArray GR_PrimPacked::myLightLinks
protected

Definition at line 248 of file GR_PrimPacked.h.

GT_DataArrayHandle GR_PrimPacked::myLODMask
protected

Definition at line 219 of file GR_PrimPacked.h.

UT_Map<int, UT_IntArray> GR_PrimPacked::myMaterialGroups
protected

Definition at line 236 of file GR_PrimPacked.h.

GR_MaterialGroups GR_PrimPacked::myMatGroups
protected

Definition at line 235 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myMatVersion
protected

Definition at line 211 of file GR_PrimPacked.h.

GA_Index GR_PrimPacked::myOverridePointID
protected

Definition at line 258 of file GR_PrimPacked.h.

GA_Index GR_PrimPacked::myOverridePrimID
protected

Definition at line 259 of file GR_PrimPacked.h.

GT_PrimitiveHandle GR_PrimPacked::myPackedPrim
protected

Definition at line 185 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myPackedPVersion
protected

Definition at line 213 of file GR_PrimPacked.h.

GT_DataArrayHandle GR_PrimPacked::myPickIDs
protected

Definition at line 216 of file GR_PrimPacked.h.

GT_DataArrayHandle GR_PrimPacked::myPointIDs
protected

Definition at line 218 of file GR_PrimPacked.h.

UT_IntArray GR_PrimPacked::myPointInstances
protected

Definition at line 221 of file GR_PrimPacked.h.

GR_SelectMode GR_PrimPacked::myPointSelectMode
protected

Definition at line 209 of file GR_PrimPacked.h.

GA_Index GR_PrimPacked::myPrimID
protected

Definition at line 256 of file GR_PrimPacked.h.

GT_DataArrayHandle GR_PrimPacked::myPrimIDs
protected

Definition at line 217 of file GR_PrimPacked.h.

int GR_PrimPacked::myPrimIndex
protected

Definition at line 261 of file GR_PrimPacked.h.

bool GR_PrimPacked::myPrimSwappedFlag
protected

Definition at line 231 of file GR_PrimPacked.h.

bool GR_PrimPacked::myPrimTypeChanged
protected

Definition at line 232 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myPrimUniqueID
protected

Definition at line 233 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myPrimVersion
protected

Definition at line 212 of file GR_PrimPacked.h.

bool GR_PrimPacked::myPrimVisible
protected

Definition at line 239 of file GR_PrimPacked.h.

int GR_PrimPacked::myQueuedBBoxID
protected

Definition at line 242 of file GR_PrimPacked.h.

bool GR_PrimPacked::myQueuedDrawValid
protected

Definition at line 240 of file GR_PrimPacked.h.

RE_VertexArray* GR_PrimPacked::mySelectionVA
protected

Definition at line 227 of file GR_PrimPacked.h.

GR_SelectMode GR_PrimPacked::mySelectMode
protected

Definition at line 208 of file GR_PrimPacked.h.

UT_StringMap<int> GR_PrimPacked::myShadowMaskMap
protected

Definition at line 252 of file GR_PrimPacked.h.

UT_StringArray GR_PrimPacked::myShadowMasks
protected

Definition at line 251 of file GR_PrimPacked.h.

int64 GR_PrimPacked::myTopVersion
protected

Definition at line 210 of file GR_PrimPacked.h.


The documentation for this class was generated from the following file: