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

#include <GR_PrimTetra.h>

+ Inheritance diagram for HDK_Sample::GR_PrimTetra:

Public Member Functions

 GR_PrimTetra (const GR_RenderInfo *info, const char *cache_name, const GEO_Primitive *prim)
 
 ~GR_PrimTetra () override
 
const char * className () const override
 Return a string version of this class's name. More...
 
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 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
 
- Public Member Functions inherited from GR_Primitive
bool setCacheName (const char *cache_name)
 
virtual void resetPrimitives ()
 
virtual GR_BasePrimType getBasePrimType () const
 The base primitive type is usually NORMAL unless this is a packed type. More...
 
virtual GT_PrimitiveHandle getInstancePrim () const
 
bool typeMask (GEO_PrimTypeCompat::TypeMask mask) const
 returns true if this primitive's type mask is part of "mask". More...
 
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)
 
virtual bool isPrimVisible () const
 
GR_DispOptChange checkDisplayOptionChange (const GR_DisplayOption &opts)
 
virtual bool updateOnViewChange (const GR_DisplayOption &) const
 If this primitive requires an update when the view changes, return true. More...
 
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 viewUpdate (RE_RenderContext r, const GR_ViewUpdateParms &parms)
 
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)
 
virtual bool inViewFrustum (const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox=nullptr)
 
virtual bool isRasterizedInView (const UT_Matrix4F &objviewproj, const UT_Vector2F &min_proj_size, const UT_BoundingBoxF *bbox=nullptr)
 
int64 supportedDecorations ()
 
virtual bool supportsRenderUV ()
 Return true if this primitive supports drawing into a UV viewport. More...
 
virtual bool requiresAlphaPass () const
 Return true if this primitive requires an alpha pass. More...
 
bool drawInAlphaPass (GR_AlphaPass alpha) const
 Return true if this should be drawn in the given alpha pass. More...
 
virtual bool renderInAlphaPass (GR_AlphaPass a)
 Return true if this primitive renders in the specified alpha pass. More...
 
virtual bool getBoundingBox (UT_BoundingBoxD &bbox) const
 Returns the bounding box of this primitive if it can be determined. More...
 
void setAlphaPassMask (int mask)
 
int getAlphaPassMask () const
 
virtual const GA_PrimitivegetGAPrimitive (const GU_Detail *gdp, exint primitive_id) const
 
virtual exint getGAVertex (const GU_Detail *gdp, exint vertex_id) const
 
virtual exint getNumGLPrimitives (const GR_DisplayOption *)
 
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 void retirePrimitive ()
 Called when a node is no longer actively displayed, but still cached. More...
 
virtual RE_GeometrygetDecorationGeometry ()
 
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 ()
 
virtual bool needsGLStateCheck (const GR_DisplayOption &opts) const
 
virtual bool checkGLState (RE_RenderContext r, const GR_DisplayOption &opts)
 
virtual bool setup (const GR_DisplayOption *)
 
virtual void cleanup (RE_RenderContext r)
 
GT_PrimitiveHandle getCachedGTPrimitive ()
 
void cacheGTPrimitive (const GT_PrimitiveHandle &prim)
 

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)
 
- Protected Member Functions inherited from GR_Primitive
 GR_Primitive (const GR_RenderInfo *info, const char *cache_name, GEO_PrimTypeCompat::TypeMask gaprimtype)
 
virtual ~GR_Primitive ()
 
virtual GR_DispOptChange displayOptionChange (const GR_DisplayOption &opts, bool first_init)
 
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)
 
- 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
 

Detailed Description

Primitive object that is created by GR_PrimTetraHook whenever a tetrahedron primitive is found. This object can be persistent between renders, though display flag changes or navigating though SOPs can cause it to be deleted and recreated later.

Examples:
tetprim/GR_PrimTetra.C.

Definition at line 65 of file GR_PrimTetra.h.

Constructor & Destructor Documentation

GR_PrimTetra::GR_PrimTetra ( const GR_RenderInfo info,
const char *  cache_name,
const GEO_Primitive prim 
)
Examples:
tetprim/GR_PrimTetra.C, and tetprim/GR_PrimTetra.h.

Definition at line 63 of file GR_PrimTetra.C.

GR_PrimTetra::~GR_PrimTetra ( )
override
Examples:
tetprim/GR_PrimTetra.h.

Definition at line 73 of file GR_PrimTetra.C.

Member Function Documentation

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

See if the tetra primitive can be consumed by this primitive. Only tetra from the same detail will ever be passed in.

Implements GR_Primitive.

Examples:
tetprim/GR_PrimTetra.C, and tetprim/GR_PrimTetra.h.

Definition at line 80 of file GR_PrimTetra.C.

const char* HDK_Sample::GR_PrimTetra::className ( ) const
inlineoverridevirtual

Return a string version of this class's name.

Implements GR_Primitive.

Examples:
tetprim/GR_PrimTetra.h.

Definition at line 73 of file GR_PrimTetra.h.

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

Called whenever the primitive is required to render, which may be more than one time per viewport redraw (beauty, shadow passes, wireframe-over) It also may be called outside of a viewport redraw to do picking of the geometry.

Implements GR_Primitive.

Examples:
tetprim/GR_PrimTetra.C, and tetprim/GR_PrimTetra.h.

Definition at line 275 of file GR_PrimTetra.C.

void GR_PrimTetra::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.

Examples:
tetprim/GR_PrimTetra.C, and tetprim/GR_PrimTetra.h.

Definition at line 398 of file GR_PrimTetra.C.

int GR_PrimTetra::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.

Examples:
tetprim/GR_PrimTetra.C, and tetprim/GR_PrimTetra.h.

Definition at line 409 of file GR_PrimTetra.C.

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

Called whenever the parent detail is changed, draw modes are changed, selection is changed, or certain volatile display options are changed (such as level of detail).

Implements GR_Primitive.

Examples:
tetprim/GR_PrimTetra.C, and tetprim/GR_PrimTetra.h.

Definition at line 93 of file GR_PrimTetra.C.


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