HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_MetaExpression Class Reference

#include <GEO_MetaExpr.h>

Public Member Functions

 GEO_MetaExpression ()
 
 GEO_MetaExpression (const GEO_Detail *gdp, const GA_PrimitiveGroup *primgroup=NULL)
 
 GEO_MetaExpression (const GEO_Detail *gdp, const GA_Range &prim_range)
 
 ~GEO_MetaExpression ()
 
int64 getMemoryUsage (bool inclusive) const
 Compute memory usage (includes all shared memory) More...
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const
 
TS_MetaExpressionPtr preCompute (const GEO_Detail *gdp, const GA_PrimitiveGroup *prims=nullptr)
 
TS_MetaExpressionPtr preCompute (const GEO_Detail *gdp, const GA_Range &prim_range)
 
const TS_MetaExpressionPtrgetTSExpression () const
 
void computeAttributes (const UT_Vector3 &pos, GA_Offset result, const GA_AttributeRefMap &map) const
 
void sumPointAttributes (const UT_Vector3 &pos, GA_Offset resultptoff, const GA_AttributeRefMap &map, GA_WeightedSum &sum) const
 
void computeNormalizedAttributes (const UT_Vector3 &pos, GA_Offset result, const GA_AttributeRefMap &map) const
 
void computeAttribute (const UT_Vector3 &pos, float *data, const GA_ROAttributeRef &ref, int size) const
 
UT_Array< const GEO_Primitive * > & getList ()
 
const UT_Array< const
GEO_Primitive * > & 
getList () const
 

Static Public Member Functions

static TS_MetaExpressionPtr getExpression (const GEO_Detail *gdp)
 
static TS_MetaExpressionPtr getExpression (const GEO_Detail *gdp, const GA_Range &prim_range, UT_Array< const GEO_Primitive * > *p=nullptr)
 
static void serialize (const TS_MetaExpression *expr, UT_Int32Array &opcodes, exint nprimitives)
 
static void serialize (const TS_MetaExpression *expr, UT_Int64Array &opcodes, exint nprimitives)
 
static bool unserialize (UT_WorkBuffer &expr, const UT_Int32Array &opcodes)
 
static bool unserialize (UT_WorkBuffer &expr, const UT_Int64Array &opcodes)
 
static bool unserialize (UT_WorkBuffer &expr, const int32 *array, exint size)
 
static bool unserialize (UT_WorkBuffer &expr, const int64 *array, exint size)
 

Detailed Description

Definition at line 33 of file GEO_MetaExpr.h.

Constructor & Destructor Documentation

GEO_MetaExpression::GEO_MetaExpression ( )
inline

Definition at line 36 of file GEO_MetaExpr.h.

GEO_MetaExpression::GEO_MetaExpression ( const GEO_Detail gdp,
const GA_PrimitiveGroup primgroup = NULL 
)
inline

Definition at line 40 of file GEO_MetaExpr.h.

GEO_MetaExpression::GEO_MetaExpression ( const GEO_Detail gdp,
const GA_Range prim_range 
)
inline

Definition at line 45 of file GEO_MetaExpr.h.

GEO_MetaExpression::~GEO_MetaExpression ( )

Member Function Documentation

void GEO_MetaExpression::computeAttribute ( const UT_Vector3 pos,
float data,
const GA_ROAttributeRef ref,
int  size 
) const
void GEO_MetaExpression::computeAttributes ( const UT_Vector3 pos,
GA_Offset  result,
const GA_AttributeRefMap map 
) const
void GEO_MetaExpression::computeNormalizedAttributes ( const UT_Vector3 pos,
GA_Offset  result,
const GA_AttributeRefMap map 
) const
void GEO_MetaExpression::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const

Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)

static TS_MetaExpressionPtr GEO_MetaExpression::getExpression ( const GEO_Detail gdp)
static

Create a TS metaball expression given the gdp NOTE: ref() has not been called on the TS_MetaExpression returned.

static TS_MetaExpressionPtr GEO_MetaExpression::getExpression ( const GEO_Detail gdp,
const GA_Range prim_range,
UT_Array< const GEO_Primitive * > *  p = nullptr 
)
static

Create a TS metaball expression given the gdp and primitive range NOTE: ref() has not been called on the TS_MetaExpression returned.

UT_Array<const GEO_Primitive *>& GEO_MetaExpression::getList ( )
inline

Definition at line 100 of file GEO_MetaExpr.h.

const UT_Array<const GEO_Primitive *>& GEO_MetaExpression::getList ( ) const
inline

Definition at line 101 of file GEO_MetaExpr.h.

int64 GEO_MetaExpression::getMemoryUsage ( bool  inclusive) const

Compute memory usage (includes all shared memory)

const TS_MetaExpressionPtr& GEO_MetaExpression::getTSExpression ( ) const
inline

Definition at line 79 of file GEO_MetaExpr.h.

TS_MetaExpressionPtr GEO_MetaExpression::preCompute ( const GEO_Detail gdp,
const GA_PrimitiveGroup prims = nullptr 
)
TS_MetaExpressionPtr GEO_MetaExpression::preCompute ( const GEO_Detail gdp,
const GA_Range prim_range 
)
static void GEO_MetaExpression::serialize ( const TS_MetaExpression expr,
UT_Int32Array opcodes,
exint  nprimitives 
)
inlinestatic

Serialize into an integer array. Nodes in the graph are stored as:

id operator count primlist

Where the id can be used to reference a sub-expression in other expressions. The first id is based on the number of primitives in the gdp. For example: "sum(1, max(0, 1), 2)", in a gdp with 10 primitives will be stored as:

[ TS_SERIALIZE_MAGIC 10 TS_OP_MAX 2 0 1 11 TS_SUM 3 1 10 2 ]

Definition at line 115 of file GEO_MetaExpr.h.

static void GEO_MetaExpression::serialize ( const TS_MetaExpression expr,
UT_Int64Array opcodes,
exint  nprimitives 
)
inlinestatic

Serialize into an integer array. Nodes in the graph are stored as:

id operator count primlist

Where the id can be used to reference a sub-expression in other expressions. The first id is based on the number of primitives in the gdp. For example: "sum(1, max(0, 1), 2)", in a gdp with 10 primitives will be stored as:

[ TS_SERIALIZE_MAGIC 10 TS_OP_MAX 2 0 1 11 TS_SUM 3 1 10 2 ]

Definition at line 119 of file GEO_MetaExpr.h.

void GEO_MetaExpression::sumPointAttributes ( const UT_Vector3 pos,
GA_Offset  resultptoff,
const GA_AttributeRefMap map,
GA_WeightedSum sum 
) const
static bool GEO_MetaExpression::unserialize ( UT_WorkBuffer expr,
const UT_Int32Array opcodes 
)
inlinestatic

Create an expression for the given serialization

Definition at line 126 of file GEO_MetaExpr.h.

static bool GEO_MetaExpression::unserialize ( UT_WorkBuffer expr,
const UT_Int64Array opcodes 
)
inlinestatic

Create an expression for the given serialization

Definition at line 131 of file GEO_MetaExpr.h.

static bool GEO_MetaExpression::unserialize ( UT_WorkBuffer expr,
const int32 array,
exint  size 
)
inlinestatic

Create an expression for the given serialization

Definition at line 136 of file GEO_MetaExpr.h.

static bool GEO_MetaExpression::unserialize ( UT_WorkBuffer expr,
const int64 array,
exint  size 
)
inlinestatic

Create an expression for the given serialization

Definition at line 138 of file GEO_MetaExpr.h.


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