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 Types

enum  RenderType { OPENGL, VULKAN }
 

Public Member Functions

 GR_GeoRender (GR_Primitive *parent_prim, RenderType type)
 
virtual ~GR_GeoRender ()
 
virtual const char * className () const =0
 
bool isGL () const
 
bool isVulkan () const
 
virtual void update (RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, const char *cache_name)=0
 
virtual void viewUpdate (RE_RenderContext r, const GR_DisplayOption &opts, const char *cache_name, RE_CacheVersion geo_version, RE_CacheVersion select_version)
 
virtual void draw (RE_RenderContext 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...
 
virtual bool isConvexed () const
 
virtual void geometryUpdated (RE_RenderContext)
 
virtual void retireGeometry ()
 
virtual bool hasTransparency () const
 returns true if this drawable renders some transparent elements More...
 
virtual exint getNumGLPrimitives () const =0
 
virtual RE_GeometrygetGeometry ()
 
virtual RV_GeometrygetVkGeometry ()
 
virtual void getPickConnectGroup (unsigned int pick_mode, GR_PickGeometry pick_geo, int &out_connect_start, int &out_connect_num)
 
void getPickConnectGroup (unsigned int pick_mode, GR_PickGeometry pick_geo, int &out_connect_start, int &out_connect_num, int &out_connect_end)
 
virtual RV_GeometrygetVkPickGeometry (unsigned int pick_mode)
 
bool showSelections () const
 
GR_RenderVersion getRenderVersion () const
 
void allowGeoOverride (bool allow_overrides)
 
virtual bool canFrustumCull ()
 
bool inViewFrustum (const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox)
 
bool isRasterizedInView (const UT_Matrix4F &objviewproj, const UT_Vector2F &min_proj_size, const UT_BoundingBoxF *bbox=nullptr)
 
GR_BasePrimType getParentType () const
 
RenderType getRenderType () 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
 
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 bool createTanAttrib (UT_Vector4F *tan_data, const GT_DataArray *nml, const GT_DataArray *tanu, const GT_DataArray *tanv, const GT_DataArray *vlist)
 

Protected Member Functions

GR_AttribMask hasAttribute (const GT_Primitive *prim, const char *name, GT_DataArrayHandle &h) const
 
GT_PrimitiveHandle getCachedGTPrimitive ()
 
void cacheGTPrimitive (GT_PrimitiveHandle &primh)
 
int getCurrentLayer () const
 
template<typename T >
GR_SelectMode addToPointSelection (const UT_Span< T > &out_select, 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 (const UT_Span< uint8 > &out_select, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GA_VertexGroup *vertsel, bool &init)
 
template<typename T >
GR_SelectMode addToEdgeSelection (const UT_Span< T > &out_select, const GU_Detail &geo, const GT_DataArrayHandle &vt, const GT_DataArrayHandle &vert_list, const GA_EdgeGroup *edgesel, bool &init)
 
GR_SelectMode addToPrimSelection (const UT_Span< uint8 > &out_select, const GT_DataArrayHandle &vh, const GA_PrimitiveGroup *primsel, bool &init)
 

Protected Attributes

RenderType myRenderer
 
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
 
unsigned myAllowGeoOverride: 1
 
UT_Matrix4D myPrimitiveTransform
 
GR_AttribMask mySelectionMask
 
GR_SelectMode myCurrentSelection
 
int myCurrentPointSelectInstance
 
int myMaterialOverride
 
int myConvexFlag
 
int myDetailPrimID
 
GR_PrimitivemyParentPrim
 
int myCurrentLayer
 

Detailed Description

Definition at line 42 of file GR_GeoRender.h.

Member Enumeration Documentation

Enumerator
OPENGL 
VULKAN 

Definition at line 45 of file GR_GeoRender.h.

Constructor & Destructor Documentation

GR_GeoRender::GR_GeoRender ( GR_Primitive parent_prim,
RenderType  type 
)
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() 
)
template<typename T >
GR_SelectMode GR_GeoRender::addToEdgeSelection ( const UT_Span< T > &  out_select,
const GU_Detail geo,
const GT_DataArrayHandle vt,
const GT_DataArrayHandle vert_list,
const GA_EdgeGroup edgesel,
bool &  init 
)
protected
template<typename T >
GR_SelectMode GR_GeoRender::addToPointSelection ( const UT_Span< T > &  out_select,
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 ( const UT_Span< uint8 > &  out_select,
const GT_DataArrayHandle vh,
const GA_PrimitiveGroup primsel,
bool &  init 
)
protected
GR_SelectMode GR_GeoRender::addToVertexSelection ( const UT_Span< uint8 > &  out_select,
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::allowGeoOverride ( bool  allow_overrides)
void GR_GeoRender::buildInformation ( bool  prim_id,
bool  point_id 
)
inline

Definition at line 151 of file GR_GeoRender.h.

GT_DataArrayHandle GR_GeoRender::buildPointIDData ( const GT_Primitive prim,
const GU_ConstDetailHandle geo,
int  npoints 
)
GT_DataArrayHandle GR_GeoRender::buildPrimitiveIDData ( const GT_Primitive prim,
const GU_ConstDetailHandle geo 
)
void GR_GeoRender::cacheGTPrimitive ( GT_PrimitiveHandle primh)
protected
virtual bool GR_GeoRender::canFrustumCull ( )
inlinevirtual

Reimplemented in GR_PolySurfaceGL3.

Definition at line 139 of file GR_GeoRender.h.

void GR_GeoRender::clearMaterialOverride ( )
inline

Definition at line 179 of file GR_GeoRender.h.

static bool GR_GeoRender::createTanAttrib ( UT_Vector4F tan_data,
const GT_DataArray nml,
const GT_DataArray tanu,
const GT_DataArray tanv,
const GT_DataArray vlist 
)
static
virtual void GR_GeoRender::draw ( RE_RenderContext  r,
GR_RenderMode  mode,
GR_RenderFlags  flags,
GR_DrawParms  draw_parms 
)
pure virtual
virtual void GR_GeoRender::geometryUpdated ( RE_RenderContext  )
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 84 of file GR_GeoRender.h.

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

Definition at line 236 of file GR_GeoRender.h.

bool GR_GeoRender::getDetailPrimID ( int id) const
inline

Definition at line 182 of file GR_GeoRender.h.

const UT_BoundingBoxD& GR_GeoRender::getGeoBounds ( ) const
inline

Definition at line 296 of file GR_GeoRender.h.

virtual RE_Geometry* GR_GeoRender::getGeometry ( )
inlinevirtual

Reimplemented in GR_GeoRenderVK, and GR_GeoRenderGL.

Definition at line 96 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_VolumeGL3, GR_VolumeVK, GR_PolyCurveGL3, GR_PolySurfaceVK, GR_PolyCurveVK, GR_PolyRibbonVK, GR_PolySurface, GR_HeightFieldVK, GR_ImageVK, GR_PointVK, GR_PointGL3, GR_PointSplatVK, and GR_SpriteVK.

GR_BasePrimType GR_GeoRender::getParentType ( ) const
virtual void GR_GeoRender::getPickConnectGroup ( unsigned int  pick_mode,
GR_PickGeometry  pick_geo,
int out_connect_start,
int out_connect_num 
)
inlinevirtual

Reimplemented in GR_GeoRenderGL, GR_PolyCurveVK, GR_PolyRibbonVK, GR_SpriteVK, and GR_PolySurfaceVK.

Definition at line 100 of file GR_GeoRender.h.

void GR_GeoRender::getPickConnectGroup ( unsigned int  pick_mode,
GR_PickGeometry  pick_geo,
int out_connect_start,
int out_connect_num,
int out_connect_end 
)
inline

Definition at line 107 of file GR_GeoRender.h.

RenderType GR_GeoRender::getRenderType ( ) const
inline

Definition at line 149 of file GR_GeoRender.h.

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

Definition at line 169 of file GR_GeoRender.h.

int GR_GeoRender::getSelectionInstance ( ) const
inline

Definition at line 174 of file GR_GeoRender.h.

GR_AttribMask GR_GeoRender::getSelectionMask ( ) const
inline

Definition at line 164 of file GR_GeoRender.h.

virtual RV_Geometry* GR_GeoRender::getVkGeometry ( )
inlinevirtual

Reimplemented in GR_GeoRenderVK.

Definition at line 98 of file GR_GeoRender.h.

virtual RV_Geometry* GR_GeoRender::getVkPickGeometry ( unsigned int  pick_mode)
inlinevirtual

check if there is a specifc geometry and connect group that should be used for pick rendering

Reimplemented in GR_PolySurfaceVK, GR_HeightFieldVK, and GR_ImageVK.

Definition at line 128 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_PolySurfaceVK, GR_PolyRibbonVK, GR_PolyCurveVK, GR_HeightFieldVK, GR_ImageVK, GR_PointVK, GR_PolySurface, GR_PointGL3, GR_PointSplatVK, and GR_SpriteVK.

Definition at line 89 of file GR_GeoRender.h.

bool GR_GeoRender::inViewFrustum ( const UT_Matrix4D objviewproj,
const UT_BoundingBoxD bbox 
)
virtual bool GR_GeoRender::isConvexed ( ) const
inlinevirtual

Reimplemented in GR_PolySurfaceGL3.

Definition at line 80 of file GR_GeoRender.h.

bool GR_GeoRender::isGL ( ) const
inline

Definition at line 52 of file GR_GeoRender.h.

bool GR_GeoRender::isRasterizedInView ( const UT_Matrix4F objviewproj,
const UT_Vector2F min_proj_size,
const UT_BoundingBoxF bbox = nullptr 
)
bool GR_GeoRender::isVulkan ( ) const
inline

Definition at line 53 of file GR_GeoRender.h.

virtual void GR_GeoRender::retireGeometry ( )
inlinevirtual

Reimplemented in GR_PolySurface, and GR_GeoRenderGL.

Definition at line 86 of file GR_GeoRender.h.

void GR_GeoRender::setGeoBounds ( const UT_BoundingBox b)
inline

Definition at line 295 of file GR_GeoRender.h.

void GR_GeoRender::setMaterialOverride ( int  mat_index)
inline

Definition at line 177 of file GR_GeoRender.h.

void GR_GeoRender::setSelectionDisplayMode ( GR_SelectMode  m)
inline

Definition at line 167 of file GR_GeoRender.h.

void GR_GeoRender::setSelectionInstance ( int  i)
inline

Definition at line 172 of file GR_GeoRender.h.

void GR_GeoRender::setSelectionMask ( GR_AttribMask  selection_mask)
inline

Definition at line 162 of file GR_GeoRender.h.

bool GR_GeoRender::shouldBuildPointID ( ) const
inline

Definition at line 159 of file GR_GeoRender.h.

bool GR_GeoRender::shouldBuildPrimID ( ) const
inline

Definition at line 157 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 78 of file GR_GeoRender.h.

virtual void GR_GeoRender::update ( RE_RenderContext  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_VolumeVK, GR_PolySurfaceVK, GR_PolySurface, GR_HeightFieldVK, GR_ImageVK, GR_PolyCurveGL3, GR_PolyCurveVK, GR_PointVK, GR_PolyRibbonVK, GR_OSDSubdSurfaceGL4, GR_OSDSubdSurfaceGL3, GR_PointGL3, GR_PointSplatVK, and GR_SpriteVK.

virtual void GR_GeoRender::viewUpdate ( RE_RenderContext  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, and GR_VolumeVK.

Definition at line 64 of file GR_GeoRender.h.

Member Data Documentation

unsigned GR_GeoRender::myAllowGeoOverride
protected

Definition at line 303 of file GR_GeoRender.h.

UT_BoundingBoxD GR_GeoRender::myBounds
protected

Definition at line 302 of file GR_GeoRender.h.

unsigned GR_GeoRender::myBuildPointInfo
protected

Definition at line 303 of file GR_GeoRender.h.

unsigned GR_GeoRender::myBuildPrimInfo
protected

Definition at line 303 of file GR_GeoRender.h.

int GR_GeoRender::myConvexFlag
protected

Definition at line 317 of file GR_GeoRender.h.

int GR_GeoRender::myCurrentLayer
protected

Definition at line 321 of file GR_GeoRender.h.

int GR_GeoRender::myCurrentPointSelectInstance
protected

Definition at line 315 of file GR_GeoRender.h.

GR_SelectMode GR_GeoRender::myCurrentSelection
protected

Definition at line 314 of file GR_GeoRender.h.

int GR_GeoRender::myDetailPrimID
protected

Definition at line 318 of file GR_GeoRender.h.

unsigned GR_GeoRender::myHasDetailPrimID
protected

Definition at line 303 of file GR_GeoRender.h.

unsigned GR_GeoRender::myHasIdentityTransform
protected

Definition at line 303 of file GR_GeoRender.h.

unsigned GR_GeoRender::myHasInstancedTransform
protected

Definition at line 303 of file GR_GeoRender.h.

const GR_RenderInfo* GR_GeoRender::myInfo
protected

Definition at line 300 of file GR_GeoRender.h.

int GR_GeoRender::myMaterialOverride
protected

Definition at line 316 of file GR_GeoRender.h.

GR_MaterialGroups GR_GeoRender::myMatGroups
protected

Definition at line 301 of file GR_GeoRender.h.

unsigned GR_GeoRender::myNumBoneDeform
protected

Definition at line 303 of file GR_GeoRender.h.

GR_Primitive* GR_GeoRender::myParentPrim
protected

Definition at line 320 of file GR_GeoRender.h.

UT_Matrix4D GR_GeoRender::myPrimitiveTransform
protected

Definition at line 312 of file GR_GeoRender.h.

RenderType GR_GeoRender::myRenderer
protected

Definition at line 299 of file GR_GeoRender.h.

GR_AttribMask GR_GeoRender::mySelectionMask
protected

Definition at line 313 of file GR_GeoRender.h.

unsigned GR_GeoRender::myUseBoneDeform
protected

Definition at line 303 of file GR_GeoRender.h.


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