BRL-CAD
ShadingContext Class Reference

#include <oslexec_pvt.h>

Public Member Functions

 ShadingContext (ShadingSystemImpl &shadingsys)
 
 ~ShadingContext ()
 
ShadingSystemImplshadingsys () const
 
RendererServices * renderer () const
 
void execute (ShaderUse use, ShadingAttribState &sas, ShaderGlobals &ssg)
 
ShaderUse use () const
 
ClosureComponent * closure_component_allot (int id, size_t prim_size, int nattrs)
 
ClosureMul * closure_mul_allot (const Color3 &w, const ClosureColor *c)
 
ClosureMul * closure_mul_allot (float w, const ClosureColor *c)
 
ClosureAdd * closure_add_allot (const ClosureColor *a, const ClosureColor *b)
 
Symbol * symbol (ShaderUse use, ustring name)
 
void * symbol_data (Symbol &sym, int gridpoint)
 
const boost::regex & find_regex (ustring r)
 
ShadingAttribStateattribs ()
 
ParamValueList & messages ()
 
int dict_find (ustring dictionaryname, ustring query)
 
int dict_find (int nodeID, ustring query)
 
int dict_next (int nodeID)
 Return the next match of the same query that gave the nodeID. More...
 
int dict_value (int nodeID, ustring attribname, TypeDesc type, void *data)
 
bool prepare_execution (ShaderUse use, ShadingAttribState &sas)
 

Detailed Description

The full context for executing a shader group.

Definition at line 870 of file oslexec_pvt.h.

Constructor & Destructor Documentation

ShadingContext ( ShadingSystemImpl shadingsys)

Member Function Documentation

ShadingSystemImpl& shadingsys ( ) const
inline

Return a reference to the shading system for this context.

Definition at line 877 of file oslexec_pvt.h.

RendererServices* renderer ( ) const
inline

Get a pointer to the RendererServices for this execution.

Definition at line 881 of file oslexec_pvt.h.

void execute ( ShaderUse  use,
ShadingAttribState sas,
ShaderGlobals &  ssg 
)

Execute the shaders for the given use (for example, ShadUseSurface). If runflags are not supplied, they will be auto-generated with all points turned on.

ShaderUse use ( ) const
inline

Return the current shader use being executed.

Definition at line 891 of file oslexec_pvt.h.

ClosureComponent* closure_component_allot ( int  id,
size_t  prim_size,
int  nattrs 
)
inline

Definition at line 893 of file oslexec_pvt.h.

ClosureMul* closure_mul_allot ( const Color3 &  w,
const ClosureColor *  c 
)
inline

Definition at line 904 of file oslexec_pvt.h.

ClosureMul* closure_mul_allot ( float  w,
const ClosureColor *  c 
)
inline

Definition at line 912 of file oslexec_pvt.h.

ClosureAdd* closure_add_allot ( const ClosureColor *  a,
const ClosureColor *  b 
)
inline

Definition at line 920 of file oslexec_pvt.h.

References add().

Here is the call graph for this function:

Symbol* symbol ( ShaderUse  use,
ustring  name 
)

Find the named symbol in the (already-executed!) stack of shaders of the given use, with priority given to later layers over earlier layers (if they name the same symbol). Return NULL if no such symbol is found.

void* symbol_data ( Symbol &  sym,
int  gridpoint 
)

Return a pointer to where the symbol's data lives for the given grid point.

const boost::regex& find_regex ( ustring  r)

Return a reference to a compiled regular expression for the given string, being careful to cache already-created ones so we aren't constantly compiling new ones.

ShadingAttribState* attribs ( )
inline

Return a pointer to the shading attribs for this context.

Definition at line 946 of file oslexec_pvt.h.

ParamValueList& messages ( )
inline

Return a reference to the ParamValueList containing messages.

Definition at line 950 of file oslexec_pvt.h.

int dict_find ( ustring  dictionaryname,
ustring  query 
)

Look up a query from a dictionary (typically XML), staring the search from the root of the dictionary, and returning ID of the first matching node.

int dict_find ( int  nodeID,
ustring  query 
)

Look up a query from a dictionary (typically XML), staring the search from the given nodeID within the dictionary, and returning ID of the first matching node.

int dict_next ( int  nodeID)

Return the next match of the same query that gave the nodeID.

int dict_value ( int  nodeID,
ustring  attribname,
TypeDesc  type,
void *  data 
)

Look up an attribute of the given dictionary node. If attribname is "", return the value of the node itself.

bool prepare_execution ( ShaderUse  use,
ShadingAttribState sas 
)

Various setup of the context done by execute(). Return true if the function should be executed, otherwise false.


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