HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_StencilUtils.h File Reference
#include <SIM/SIM_RawField.h>
+ Include dependency graph for GAS_StencilUtils.h:

Go to the source code of this file.

Classes

class  gasFieldSampler
 

Macros

#define DECLARE_STENCIL_VARIABLES(dst)
 
#define REFRESH_STENCIL_TILE(iterator)
 
#define CHECK_STENCIL_VOXEL(iterator)
 

Macro Definition Documentation

#define CHECK_STENCIL_VOXEL (   iterator)
Value:
if (alignedstencil) \
{ \
if (!conststencil && \
(*stenciltile)(iterator.myTileLocalPos[0], \
iterator.myTileLocalPos[1], \
iterator.myTileLocalPos[2]) <= 0.5) \
continue; \
} \
else if (stencil) \
{ \
if (stencilsampler.getValue(iterator.x(), iterator.y(), \
iterator.z()) <= 0.5) \
continue; \
}
if(rank==1) return rank
GLint GLfloat GLint stencil
Definition: glcorearb.h:1277

This macro will check the stencil value for the current voxel and skip if it's not active.

Definition at line 113 of file GAS_StencilUtils.h.

#define DECLARE_STENCIL_VARIABLES (   dst)
Value:
bool alignedstencil = (stencil && stencil->isAligned(dst)); \
gasFieldSampler stencilsampler; \
if (stencil && !alignedstencil) \
stencilsampler.init(*dst, *stencil); \
const UT_VoxelTile<float>* stenciltile; \
bool conststencil;
if(rank==1) return rank
#define const
Definition: zconf.h:214
GLint GLfloat GLint stencil
Definition: glcorearb.h:1277
GLenum GLenum dst
Definition: glcorearb.h:1792

Declares the variables needed to check stencil values. These variables are updated and used by the subsequent macros.

Definition at line 86 of file GAS_StencilUtils.h.

#define REFRESH_STENCIL_TILE (   iterator)
Value:
if (alignedstencil) \
{ \
stenciltile \
= stencil->field()->getLinearTile(iterator.getLinearTileNum()); \
conststencil = stenciltile->isConstant(); \
if (conststencil && (*stenciltile)(0, 0, 0) <= 0.5) \
{ \
iterator.skipToEndOfTile(); \
continue; \
} \
}
if(rank==1) return rank
GLint GLfloat GLint stencil
Definition: glcorearb.h:1277

This macro refreshes the stencil tile and shoule be used when a new tile is encountered. The macro is meant to be in a loop walking over the iterator. The whole tile will be skipped as required.

Definition at line 98 of file GAS_StencilUtils.h.