HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_GeoRender Class Referenceabstract

#include <GR_GeoRender.h>

+ Inheritance diagram for GR_GeoRender:

Public Member Functions

 GR_GeoRender (GR_Primitive *parent_prim)
 
virtual ~GR_GeoRender ()
 
virtual const char * className () const =0
 
virtual void update (RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, const char *cache_name)=0
 
virtual void updateInstanceGroupArray (const RE_VertexArray *array, int instance_group=-1, const char *attrib_name=NULL, RE_GenericAttribID id=RE_GENATTRIB_NONE)
 
virtual void viewUpdate (RE_Render *r, const GR_DisplayOption &opts, const char *cache_name, RE_CacheVersion geo_version, RE_CacheVersion select_version)
 
virtual void draw (RE_Render *r, GR_RenderMode mode, GR_RenderFlags flags, GR_DrawParms draw_parms)=0
 Normal drawing method. Only issue rendering commands. More...
 
virtual bool supportsInstances () const
 By default, no instanced drawing support. More...
 
RE_GeometrycreateGeometry (int npoints=0)
 
RE_GeometrygetGeometry ()
 
virtual bool isConvexed () const
 
virtual void geometryUpdated (RE_Render *)
 
virtual bool hasTransparency () const
 returns true if this drawable renders some transparent elements More...
 
virtual exint getNumGLPrimitives () const =0
 
bool showSelections () const
 
GR_RenderVersion getRenderVersion () const
 
virtual bool canFrustumCull ()
 
bool inViewFrustum (const UT_Matrix4D &objviewproj)
 
GR_BasePrimType getParentType () const
 
void buildInformation (bool prim_id, bool point_id)
 
bool shouldBuildPrimID () const
 
bool shouldBuildPointID () const
 
void setSelectionMask (GR_AttribMask selection_mask)
 
GR_AttribMask getSelectionMask () const
 
void setSelectionDisplayMode (GR_SelectMode m)
 
GR_SelectMode getSelectionDisplayMode () const
 
void setSelectionInstance (int i)
 
int getSelectionInstance () const
 
void setMaterialOverride (int mat_index)
 
void clearMaterialOverride ()
 
bool getDetailPrimID (int &id) const
 
virtual void retireGeometry ()
 
void setupGeoOverride (RE_Render *r, const GR_DisplayOption *opt, RE_Geometry *geo, UT_UniquePtr< RE_OverrideList > &override_list)
 
void cleanupGeoOverride (RE_Render *r, const GR_DisplayOption *opt, RE_Geometry *geo)
 
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())
 
GT_DataArrayHandle buildPointIDData (const GT_Primitive &prim, const GU_ConstDetailHandle &geo, int npoints)
 
GT_DataArrayHandle buildPrimitiveIDData (const GT_Primitive &prim, const GU_ConstDetailHandle &geo)
 
void setGeoBounds (const UT_BoundingBox &b)
 
const UT_BoundingBoxDgetGeoBounds () const
 

Static Public Member Functions

static RE_VertexArraygetDirtyAttribArray (RE_Render *r, RE_Geometry *geo, const char *attrib_name, const GT_DataArrayHandle &h, const GR_DisplayOption &opts, RE_ArrayType atype, RE_CacheVersion attr_version)
 
static void fillGeoAttribs (RE_Render *r, const GT_Primitive *prim, const GR_UpdateParms &p, RE_Geometry *geo, bool needs_nml, bool needs_uv, bool need_prim_vert_info, const GT_DataArrayHandle &point_norm, GR_BasePrimType packed_type, bool build_point_id, bool build_prim_id, GR_GeoRender *geo_ren=nullptr, bool *has_detail_prim_id=nullptr, int *detail_prim_id=nullptr, int *num_bone_deform=nullptr)
 

Protected Member Functions

void initLights (RE_Render *r, RE_Shader *sh, GR_RenderMode mode, GR_RenderFlags flags, const GR_DisplayOption *opt)
 
GR_AttribMask hasAttribute (const GT_Primitive *prim, const char *name, GT_DataArrayHandle &h) const
 
void buildPointID (RE_Render *r, const GT_Primitive &prim, const GU_ConstDetailHandle &geo, RE_CacheVersion geo_version)
 
void buildPrimitiveID (RE_Render *r, const GT_Primitive &primh, const GU_ConstDetailHandle &geo, RE_CacheVersion geo_version)
 
GR_SelectMode buildSelection (RE_Render *r, const GR_UpdateParms &parms, RE_Geometry &obj, const GT_PrimitiveHandle &primh, const GT_DataArrayHandle &vertexlist)
 
GR_SelectMode addToPointSelection (RE_Render *r, RE_VertexArray *select_array, int length, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GT_DataArrayHandle &vl, const GA_PointGroup *pntsel, bool use_vertex_for_point_select, bool &init)
 
GR_SelectMode addToVertexSelection (RE_Render *r, RE_VertexArray *select_array, int length, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GA_VertexGroup *vertsel, bool &init)
 
GR_SelectMode addToEdgeSelection (RE_Render *r, RE_VertexArray *select_array, int length, const GU_Detail &geo, const GT_DataArrayHandle &vt, const GT_DataArrayHandle &vert_list, const GA_EdgeGroup *edgesel, bool &init)
 
GR_SelectMode addToPrimSelection (RE_Render *r, RE_VertexArray *sel_array, const GT_DataArrayHandle &vh, const GA_PrimitiveGroup *primsel, bool &init)
 
virtual GR_SelectMode addToBreakpointSelection (RE_Render *r, RE_VertexArray *select, int bpnt_len, const GA_BreakpointGroup *bps, bool &init)
 
GR_SelectMode buildInstanceSelection (RE_Render *r, const GR_UpdateParms &p, RE_Geometry &obj)
 
void fillAttributesGL3 (RE_Render *r, const GT_Primitive *prim, const GR_UpdateParms &p, RE_Geometry *geo, bool needs_nml, bool needs_uv, bool need_prim_vert_info, const GT_DataArrayHandle &point_norm)
 
virtual int setupSelection (RE_Render *r, const GR_DisplayOption *opt, GR_RenderFlags flags) const
 
virtual void cleanupSelection (RE_Render *r, int key) const
 Clean up selection uniforms; much be paired with a setupSelection(). More...
 
GT_PrimitiveHandle getCachedGTPrimitive ()
 
void cacheGTPrimitive (GT_PrimitiveHandle &primh)
 
void updateWireColor (RE_Render *r, RE_Geometry *geo, const GR_DisplayOption *opt, int start_draw_idx, int num_draw_idx=1) const
 
int getCurrentLayer () const
 

Protected Attributes

RE_GeometrymyGeometry
 
const GR_RenderInfomyInfo
 
GR_MaterialGroups myMatGroups
 
UT_BoundingBoxD myBounds
 
unsigned myBuildPointInfo: 1
 
unsigned myBuildPrimInfo: 1
 
unsigned myHasDetailPrimID: 1
 
unsigned myHasInstancedTransform: 1
 
unsigned myHasIdentityTransform: 1
 
unsigned myUseBoneDeform: 1
 
unsigned myNumBoneDeform: 2
 
UT_Matrix4D myPrimitiveTransform
 
GR_AttribMask mySelectionMask
 
GR_SelectMode myCurrentSelection
 
int myCurrentPointSelectInstance
 
int myMaterialOverride
 
int myConvexFlag
 
int myDetailPrimID
 

Detailed Description

Definition at line 43 of file GR_GeoRender.h.

Constructor & Destructor Documentation

GR_GeoRender::GR_GeoRender ( GR_Primitive parent_prim)
virtual GR_GeoRender::~GR_GeoRender ( )
virtual

Member Function Documentation

void GR_GeoRender::addRedrawError ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::addRedrawFatal ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::addRedrawMessage ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::addRedrawWarning ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
virtual GR_SelectMode GR_GeoRender::addToBreakpointSelection ( RE_Render r,
RE_VertexArray select,
int  bpnt_len,
const GA_BreakpointGroup bps,
bool &  init 
)
protectedvirtual
GR_SelectMode GR_GeoRender::addToEdgeSelection ( RE_Render r,
RE_VertexArray select_array,
int  length,
const GU_Detail geo,
const GT_DataArrayHandle vt,
const GT_DataArrayHandle vert_list,
const GA_EdgeGroup edgesel,
bool &  init 
)
protected
GR_SelectMode GR_GeoRender::addToPointSelection ( RE_Render r,
RE_VertexArray select_array,
int  length,
const GU_Detail geo,
const GT_DataArrayHandle vh,
const GT_DataArrayHandle vl,
const GA_PointGroup pntsel,
bool  use_vertex_for_point_select,
bool &  init 
)
protected
GR_SelectMode GR_GeoRender::addToPrimSelection ( RE_Render r,
RE_VertexArray sel_array,
const GT_DataArrayHandle vh,
const GA_PrimitiveGroup primsel,
bool &  init 
)
protected
GR_SelectMode GR_GeoRender::addToVertexSelection ( RE_Render r,
RE_VertexArray select_array,
int  length,
const GU_Detail geo,
const GT_DataArrayHandle vh,
const GA_VertexGroup vertsel,
bool &  init 
)
protected
void GR_GeoRender::addUpdateError ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::addUpdateFatal ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::addUpdateMessage ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::addUpdateWarning ( GR_ErrorManager::Source  err_source,
GR_ErrorCode  gr_code,
UT_StringHolder  extra_text = UT_StringHolder(),
UT_StringHolder  src_name = UT_StringHolder() 
)
void GR_GeoRender::buildInformation ( bool  prim_id,
bool  point_id 
)
inline

Definition at line 110 of file GR_GeoRender.h.

GR_SelectMode GR_GeoRender::buildInstanceSelection ( RE_Render r,
const GR_UpdateParms p,
RE_Geometry obj 
)
protected
void GR_GeoRender::buildPointID ( RE_Render r,
const GT_Primitive prim,
const GU_ConstDetailHandle geo,
RE_CacheVersion  geo_version 
)
protected
GT_DataArrayHandle GR_GeoRender::buildPointIDData ( const GT_Primitive prim,
const GU_ConstDetailHandle geo,
int  npoints 
)
void GR_GeoRender::buildPrimitiveID ( RE_Render r,
const GT_Primitive primh,
const GU_ConstDetailHandle geo,
RE_CacheVersion  geo_version 
)
protected
GT_DataArrayHandle GR_GeoRender::buildPrimitiveIDData ( const GT_Primitive prim,
const GU_ConstDetailHandle geo 
)
GR_SelectMode GR_GeoRender::buildSelection ( RE_Render r,
const GR_UpdateParms parms,
RE_Geometry obj,
const GT_PrimitiveHandle primh,
const GT_DataArrayHandle vertexlist 
)
protected
void GR_GeoRender::cacheGTPrimitive ( GT_PrimitiveHandle primh)
protected
virtual bool GR_GeoRender::canFrustumCull ( )
inlinevirtual

Reimplemented in GR_PolySurfaceGL3.

Definition at line 105 of file GR_GeoRender.h.

virtual const char* GR_GeoRender::className ( ) const
pure virtual
void GR_GeoRender::cleanupGeoOverride ( RE_Render r,
const GR_DisplayOption opt,
RE_Geometry geo 
)
virtual void GR_GeoRender::cleanupSelection ( RE_Render r,
int  key 
) const
protectedvirtual

Clean up selection uniforms; much be paired with a setupSelection().

void GR_GeoRender::clearMaterialOverride ( )
inline

Definition at line 138 of file GR_GeoRender.h.

RE_Geometry* GR_GeoRender::createGeometry ( int  npoints = 0)
virtual void GR_GeoRender::draw ( RE_Render r,
GR_RenderMode  mode,
GR_RenderFlags  flags,
GR_DrawParms  draw_parms 
)
pure virtual

Normal drawing method. Only issue rendering commands.

Implemented in GR_VolumeGL3, GR_PolyCurveGL3, GR_OSDSubdSurfaceGL4, GR_PointGL3, and GR_PolySurfaceGL3.

void GR_GeoRender::fillAttributesGL3 ( RE_Render r,
const GT_Primitive prim,
const GR_UpdateParms p,
RE_Geometry geo,
bool  needs_nml,
bool  needs_uv,
bool  need_prim_vert_info,
const GT_DataArrayHandle point_norm 
)
protected
static void GR_GeoRender::fillGeoAttribs ( RE_Render r,
const GT_Primitive prim,
const GR_UpdateParms p,
RE_Geometry geo,
bool  needs_nml,
bool  needs_uv,
bool  need_prim_vert_info,
const GT_DataArrayHandle point_norm,
GR_BasePrimType  packed_type,
bool  build_point_id,
bool  build_prim_id,
GR_GeoRender geo_ren = nullptr,
bool *  has_detail_prim_id = nullptr,
int detail_prim_id = nullptr,
int num_bone_deform = nullptr 
)
static
virtual void GR_GeoRender::geometryUpdated ( RE_Render )
inlinevirtual

Called if another entity makes changes to the RE_Geometry after update() is called (usually the entity is a GR_Primitive object).

Reimplemented in GR_PolyCurveGL3.

Definition at line 91 of file GR_GeoRender.h.

GT_PrimitiveHandle GR_GeoRender::getCachedGTPrimitive ( )
protected
int GR_GeoRender::getCurrentLayer ( ) const
inlineprotected

Definition at line 324 of file GR_GeoRender.h.

bool GR_GeoRender::getDetailPrimID ( int id) const
inline

Definition at line 141 of file GR_GeoRender.h.

static RE_VertexArray* GR_GeoRender::getDirtyAttribArray ( RE_Render r,
RE_Geometry geo,
const char *  attrib_name,
const GT_DataArrayHandle h,
const GR_DisplayOption opts,
RE_ArrayType  atype,
RE_CacheVersion  attr_version 
)
static
const UT_BoundingBoxD& GR_GeoRender::getGeoBounds ( ) const
inline

Definition at line 344 of file GR_GeoRender.h.

RE_Geometry* GR_GeoRender::getGeometry ( )
inline

Definition at line 86 of file GR_GeoRender.h.

virtual exint GR_GeoRender::getNumGLPrimitives ( ) const
pure virtual

return the number of GL primitives that this renderer produces. May be roughly estimated.

Implemented in GR_PolyCurveGL3, GR_VolumeGL3, GR_PolySurface, and GR_PointGL3.

GR_BasePrimType GR_GeoRender::getParentType ( ) const
GR_RenderVersion GR_GeoRender::getRenderVersion ( ) const
GR_SelectMode GR_GeoRender::getSelectionDisplayMode ( ) const
inline

Definition at line 128 of file GR_GeoRender.h.

int GR_GeoRender::getSelectionInstance ( ) const
inline

Definition at line 133 of file GR_GeoRender.h.

GR_AttribMask GR_GeoRender::getSelectionMask ( ) const
inline

Definition at line 123 of file GR_GeoRender.h.

GR_AttribMask GR_GeoRender::hasAttribute ( const GT_Primitive prim,
const char *  name,
GT_DataArrayHandle h 
) const
protected
virtual bool GR_GeoRender::hasTransparency ( ) const
inlinevirtual

returns true if this drawable renders some transparent elements

Reimplemented in GR_PolySurface, and GR_PointGL3.

Definition at line 94 of file GR_GeoRender.h.

void GR_GeoRender::initLights ( RE_Render r,
RE_Shader sh,
GR_RenderMode  mode,
GR_RenderFlags  flags,
const GR_DisplayOption opt 
)
protected
bool GR_GeoRender::inViewFrustum ( const UT_Matrix4D objviewproj)
virtual bool GR_GeoRender::isConvexed ( ) const
inlinevirtual

Reimplemented in GR_PolySurfaceGL3.

Definition at line 87 of file GR_GeoRender.h.

virtual void GR_GeoRender::retireGeometry ( )
virtual

Reimplemented in GR_PolySurface.

void GR_GeoRender::setGeoBounds ( const UT_BoundingBox b)
inline

Definition at line 343 of file GR_GeoRender.h.

void GR_GeoRender::setMaterialOverride ( int  mat_index)
inline

Definition at line 136 of file GR_GeoRender.h.

void GR_GeoRender::setSelectionDisplayMode ( GR_SelectMode  m)
inline

Definition at line 126 of file GR_GeoRender.h.

void GR_GeoRender::setSelectionInstance ( int  i)
inline

Definition at line 131 of file GR_GeoRender.h.

void GR_GeoRender::setSelectionMask ( GR_AttribMask  selection_mask)
inline

Definition at line 121 of file GR_GeoRender.h.

void GR_GeoRender::setupGeoOverride ( RE_Render r,
const GR_DisplayOption opt,
RE_Geometry geo,
UT_UniquePtr< RE_OverrideList > &  override_list 
)
virtual int GR_GeoRender::setupSelection ( RE_Render r,
const GR_DisplayOption opt,
GR_RenderFlags  flags 
) const
protectedvirtual

Set selection uniforms SELECT_MODE and SELECT_INSTANCE. Returns an int which should be passed to cleanup selection.

bool GR_GeoRender::shouldBuildPointID ( ) const
inline

Definition at line 118 of file GR_GeoRender.h.

bool GR_GeoRender::shouldBuildPrimID ( ) const
inline

Definition at line 116 of file GR_GeoRender.h.

bool GR_GeoRender::showSelections ( ) const
virtual bool GR_GeoRender::supportsInstances ( ) const
inlinevirtual

By default, no instanced drawing support.

Reimplemented in GR_PolyCurveGL3, and GR_PolySurfaceGL3.

Definition at line 83 of file GR_GeoRender.h.

virtual void GR_GeoRender::update ( RE_Render r,
const GT_PrimitiveHandle primh,
const GR_UpdateParms p,
const char *  cache_name 
)
pure virtual

Update the geometry of this render object using the GT primitive. No rendering commands should be issued.

Implemented in GR_VolumeGL3, GR_PolyCurveGL3, GR_PolySurface, GR_OSDSubdSurfaceGL4, GR_OSDSubdSurfaceGL3, and GR_PointGL3.

virtual void GR_GeoRender::updateInstanceGroupArray ( const RE_VertexArray array,
int  instance_group = -1,
const char *  attrib_name = NULL,
RE_GenericAttribID  id = RE_GENATTRIB_NONE 
)
virtual

add an array to, or update an array in, an instance group. If 'instance_group' is -1, RE_VertexArray must specify an instance group via setInstanceGroup().

void GR_GeoRender::updateWireColor ( RE_Render r,
RE_Geometry geo,
const GR_DisplayOption opt,
int  start_draw_idx,
int  num_draw_idx = 1 
) const
protected
virtual void GR_GeoRender::viewUpdate ( RE_Render r,
const GR_DisplayOption opts,
const char *  cache_name,
RE_CacheVersion  geo_version,
RE_CacheVersion  select_version 
)
inlinevirtual

Called when the view changes, if the parent primitive requested view changes

Reimplemented in GR_VolumeGL3.

Definition at line 69 of file GR_GeoRender.h.

Member Data Documentation

UT_BoundingBoxD GR_GeoRender::myBounds
protected

Definition at line 350 of file GR_GeoRender.h.

unsigned GR_GeoRender::myBuildPointInfo
protected

Definition at line 351 of file GR_GeoRender.h.

unsigned GR_GeoRender::myBuildPrimInfo
protected

Definition at line 351 of file GR_GeoRender.h.

int GR_GeoRender::myConvexFlag
protected

Definition at line 364 of file GR_GeoRender.h.

int GR_GeoRender::myCurrentPointSelectInstance
protected

Definition at line 362 of file GR_GeoRender.h.

GR_SelectMode GR_GeoRender::myCurrentSelection
protected

Definition at line 361 of file GR_GeoRender.h.

int GR_GeoRender::myDetailPrimID
protected

Definition at line 365 of file GR_GeoRender.h.

RE_Geometry* GR_GeoRender::myGeometry
protected

Definition at line 347 of file GR_GeoRender.h.

unsigned GR_GeoRender::myHasDetailPrimID
protected

Definition at line 351 of file GR_GeoRender.h.

unsigned GR_GeoRender::myHasIdentityTransform
protected

Definition at line 351 of file GR_GeoRender.h.

unsigned GR_GeoRender::myHasInstancedTransform
protected

Definition at line 351 of file GR_GeoRender.h.

const GR_RenderInfo* GR_GeoRender::myInfo
protected

Definition at line 348 of file GR_GeoRender.h.

int GR_GeoRender::myMaterialOverride
protected

Definition at line 363 of file GR_GeoRender.h.

GR_MaterialGroups GR_GeoRender::myMatGroups
protected

Definition at line 349 of file GR_GeoRender.h.

unsigned GR_GeoRender::myNumBoneDeform
protected

Definition at line 351 of file GR_GeoRender.h.

UT_Matrix4D GR_GeoRender::myPrimitiveTransform
protected

Definition at line 359 of file GR_GeoRender.h.

GR_AttribMask GR_GeoRender::mySelectionMask
protected

Definition at line 360 of file GR_GeoRender.h.

unsigned GR_GeoRender::myUseBoneDeform
protected

Definition at line 351 of file GR_GeoRender.h.


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