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

#include <TIL_CopResolver.h>

Classes

class  autoEvaluateTime
 

Public Member Functions

 TIL_CopResolver ()
 
virtual ~TIL_CopResolver ()
 
virtual int resolveId (const char *fullpath)=0
 
virtual TIL_RasterresolveRaster (int id)=0
 
virtual TIL_RasterresolveRasterFrame (int id, fpreal frame, int xres=0, int yres=0)=0
 
virtual TIL_RasterresolveRasterPlane (int id, fpreal frame, const char *color, int cindex, const char *alpha, int aindex, int xres=0, int yres=0, TIL_DataFormat f=TILE_MAX_DATA_FORMAT)=0
 
virtual UT_SharedPtr< const
IMX_Layer
resolveLayer (int id)=0
 
virtual UT_SharedPtr< const
IMX_Layer
resolveLayerFrame (int id, fpreal frame)=0
 
virtual UT_SharedPtr< const
IMX_Layer
resolveLayerPlane (int id, fpreal frame, const char *color)=0
 
virtual bool resolveIsPossible (const char *fullpath)=0
 
virtual TIL_RastergetFileRaster (const char *file, IMG_DataType type=IMG_DT_ANY, int xres=0, int yres=0)
 You gain ownership of a FileRaster and must delete it: More...
 
virtual TIL_RastergetNodeRaster (const char *fullpath, const char *cmenu, const char *amenu, bool override_frame=false, fpreal frame=1.0, TIL_DataFormat f=TILE_MAX_DATA_FORMAT)
 
virtual void getRes (int id, int &xres, int &yres)
 
virtual TIL_SequencegetSequence (int id)
 
virtual bool resolveRasters (int id, const UT_StringArray &plane_names, fpreal t, UT_ValArray< TIL_Raster * > &new_rasters, TIL_DataFormat format=TILE_MAX_DATA_FORMAT)
 
virtual void buildPlaneMenu (const char *net, const char *node, UT_ValArray< char * > &items)
 
virtual TIL_ImageSourceresolveImageSource (int id)
 
virtual bool returnRaster (const TIL_Raster *raster)
 
virtual int isOpBased ()
 
virtual fpreal getTimeForRaster (int id)
 
virtual size_t getVersionForRaster (int id)
 

Static Public Member Functions

static void setResolver (TIL_CopResolver *resolver)
 
static TIL_CopResolvergetResolver ()
 
static bool enableThreadResolverCache (bool enable)
 
static bool threadResolverCacheEnabled ()
 Returns true if this thread has the resolver enabled. More...
 
static exint threadResolverCacheWatermark ()
 
static void clearResolverCache (bool force_full_clear)
 
static void getResolverCacheNodeIds (UT_IntArray &ids)
 Gets node ids of any COPs with textures in the resolver cache. More...
 
static TIL_RastergetRaster (const char *fullpath, int &opid, bool *specific_frame=nullptr)
 
static fpreal getRasterTime (int opid)
 
static size_t getRasterVersion (int opid)
 
static fpreal getTimeFromFrame (fpreal frame)
 
static bool doneWithRaster (const TIL_Raster *r)
 
static UT_SharedPtr< const
IMX_Layer
getLayer (const char *fullpath, int &opid, bool *specific_frame=nullptr)
 
static int getIdFrame (const char *fullpath, int &id, fpreal &frame)
 
static void splitFile (const char *fullpath, UT_String &name, int &xres, int &yres, float &quality)
 
static int getNodeId (const char *net, const char *node)
 
static void getNodeRes (const char *net, const char *node, int &xres, int &yres)
 
static int getNodeId (const char *fullpath)
 
static void getNodeRes (const char *fullpath, int &xres, int &yres)
 
static void getFileRes (const char *file, int &xres, int &yres)
 
static int splitPath (const char *cpath, int &id, fpreal &frame, UT_WorkBuffer &color, int &cindex, UT_WorkBuffer &alpha, int &aindex, int &xres, int &yres)
 
static void buildColorMenu (const char *net, const char *node, UT_ValArray< char * > &items)
 
static void buildAlphaMenu (const char *net, const char *node, UT_ValArray< char * > &items)
 
static bool canResolve (const char *fullpath)
 

Protected Member Functions

int splitPath (const char *fullpath, UT_String &name, fpreal &frame)
 
virtual fpreal timeFromFrame (fpreal frame)
 
virtual fpreal getGlobalTime ()
 
virtual void setGlobalTime (fpreal time)
 

Detailed Description

Examples:
SOP/SOP_CopRaster.C.

Definition at line 42 of file TIL_CopResolver.h.

Constructor & Destructor Documentation

TIL_CopResolver::TIL_CopResolver ( )
virtual TIL_CopResolver::~TIL_CopResolver ( )
virtual

Member Function Documentation

static void TIL_CopResolver::buildAlphaMenu ( const char *  net,
const char *  node,
UT_ValArray< char * > &  items 
)
static
static void TIL_CopResolver::buildColorMenu ( const char *  net,
const char *  node,
UT_ValArray< char * > &  items 
)
static
Examples:
SOP/SOP_CopRaster.C.
virtual void TIL_CopResolver::buildPlaneMenu ( const char *  net,
const char *  node,
UT_ValArray< char * > &  items 
)
virtual
static bool TIL_CopResolver::canResolve ( const char *  fullpath)
static
static void TIL_CopResolver::clearResolverCache ( bool  force_full_clear)
static

Clears any out of date resolver cache, ie, where cop version doesn't match the stashed version. The force_full_clear flag can be set to true to clear everything out of the cache. This is necessary if a time change happens and a time dependent COP texture is in the cache. The "version" will be unchanged, but we need to clear anyway.

static bool TIL_CopResolver::doneWithRaster ( const TIL_Raster r)
static

Tell the resolver we're done with the raster. Some resolvers will delete rasters, others will hold onto them. If the raster actually dirties/deletes the raster, doneWithRaster() will return true.

static bool TIL_CopResolver::enableThreadResolverCache ( bool  enable)
static

Turns on resolver cache for THIS thread. This allows in process renders to only hit op: once per render. Returns old value.

virtual TIL_Raster* TIL_CopResolver::getFileRaster ( const char *  file,
IMG_DataType  type = IMG_DT_ANY,
int  xres = 0,
int  yres = 0 
)
virtual

You gain ownership of a FileRaster and must delete it:

static void TIL_CopResolver::getFileRes ( const char *  file,
int xres,
int yres 
)
static
virtual fpreal TIL_CopResolver::getGlobalTime ( )
protectedvirtual
static int TIL_CopResolver::getIdFrame ( const char *  fullpath,
int id,
fpreal frame 
)
static
static UT_SharedPtr<const IMX_Layer> TIL_CopResolver::getLayer ( const char *  fullpath,
int opid,
bool *  specific_frame = nullptr 
)
static

Returns shared IMX_Layer with COW semantics. Only works for copernicus, will need getRaster for Images or COP2.

static int TIL_CopResolver::getNodeId ( const char *  net,
const char *  node 
)
static
Examples:
SOP/SOP_CopRaster.C.
static int TIL_CopResolver::getNodeId ( const char *  fullpath)
static
virtual TIL_Raster* TIL_CopResolver::getNodeRaster ( const char *  fullpath,
const char *  cmenu,
const char *  amenu,
bool  override_frame = false,
fpreal  frame = 1.0,
TIL_DataFormat  f = TILE_MAX_DATA_FORMAT 
)
virtual

You do not gain ownershipo of a node raster, and must call returnRaster or doneWithRaster on it.

Examples:
SOP/SOP_CopRaster.C.
static void TIL_CopResolver::getNodeRes ( const char *  net,
const char *  node,
int xres,
int yres 
)
static
static void TIL_CopResolver::getNodeRes ( const char *  fullpath,
int xres,
int yres 
)
static
static TIL_Raster* TIL_CopResolver::getRaster ( const char *  fullpath,
int opid,
bool *  specific_frame = nullptr 
)
static
static fpreal TIL_CopResolver::getRasterTime ( int  opid)
static
static size_t TIL_CopResolver::getRasterVersion ( int  opid)
static
virtual void TIL_CopResolver::getRes ( int  id,
int xres,
int yres 
)
virtual
static TIL_CopResolver* TIL_CopResolver::getResolver ( )
static
Examples:
SOP/SOP_CopRaster.C.
static void TIL_CopResolver::getResolverCacheNodeIds ( UT_IntArray ids)
static

Gets node ids of any COPs with textures in the resolver cache.

virtual TIL_Sequence* TIL_CopResolver::getSequence ( int  id)
virtual
virtual fpreal TIL_CopResolver::getTimeForRaster ( int  id)
virtual
static fpreal TIL_CopResolver::getTimeFromFrame ( fpreal  frame)
static
virtual size_t TIL_CopResolver::getVersionForRaster ( int  id)
virtual
virtual int TIL_CopResolver::isOpBased ( )
virtual
virtual int TIL_CopResolver::resolveId ( const char *  fullpath)
pure virtual
virtual TIL_ImageSource* TIL_CopResolver::resolveImageSource ( int  id)
virtual
virtual bool TIL_CopResolver::resolveIsPossible ( const char *  fullpath)
pure virtual
virtual UT_SharedPtr<const IMX_Layer> TIL_CopResolver::resolveLayer ( int  id)
pure virtual
virtual UT_SharedPtr<const IMX_Layer> TIL_CopResolver::resolveLayerFrame ( int  id,
fpreal  frame 
)
pure virtual
virtual UT_SharedPtr<const IMX_Layer> TIL_CopResolver::resolveLayerPlane ( int  id,
fpreal  frame,
const char *  color 
)
pure virtual
virtual TIL_Raster* TIL_CopResolver::resolveRaster ( int  id)
pure virtual
virtual TIL_Raster* TIL_CopResolver::resolveRasterFrame ( int  id,
fpreal  frame,
int  xres = 0,
int  yres = 0 
)
pure virtual
virtual TIL_Raster* TIL_CopResolver::resolveRasterPlane ( int  id,
fpreal  frame,
const char *  color,
int  cindex,
const char *  alpha,
int  aindex,
int  xres = 0,
int  yres = 0,
TIL_DataFormat  f = TILE_MAX_DATA_FORMAT 
)
pure virtual
virtual bool TIL_CopResolver::resolveRasters ( int  id,
const UT_StringArray plane_names,
fpreal  t,
UT_ValArray< TIL_Raster * > &  new_rasters,
TIL_DataFormat  format = TILE_MAX_DATA_FORMAT 
)
virtual

This cooks a bunch of planes simulataneously, and adds the created rasters to 'new_rasters'. You are responsible for deleting them.

virtual bool TIL_CopResolver::returnRaster ( const TIL_Raster raster)
virtual

Caller is finished with the raster for now, so delete memory if possible. Returns true if the raster is no longer valid, but false if the raster hasn't been touched (and is still valid). This is implementation dependent.

virtual void TIL_CopResolver::setGlobalTime ( fpreal  time)
protectedvirtual
static void TIL_CopResolver::setResolver ( TIL_CopResolver resolver)
static
static void TIL_CopResolver::splitFile ( const char *  fullpath,
UT_String name,
int xres,
int yres,
float quality 
)
static
static int TIL_CopResolver::splitPath ( const char *  cpath,
int id,
fpreal frame,
UT_WorkBuffer color,
int cindex,
UT_WorkBuffer alpha,
int aindex,
int xres,
int yres 
)
static
int TIL_CopResolver::splitPath ( const char *  fullpath,
UT_String name,
fpreal frame 
)
protected
static bool TIL_CopResolver::threadResolverCacheEnabled ( )
static

Returns true if this thread has the resolver enabled.

static exint TIL_CopResolver::threadResolverCacheWatermark ( )
static

Provides a watermark for the resolver cache, bumped on every clear. So if you acquired with a similar water mark you don't need to check for dirty.

virtual fpreal TIL_CopResolver::timeFromFrame ( fpreal  frame)
protectedvirtual

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