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

#include <GT_GEOVertexRefine.h>

Public Member Functions

 GT_GEOVertexRefine (const GT_GEOPrimitive &prim, const GT_GEOAttributeFilter &filter, bool do_point_attributes, int psize=3, bool user_defined_N=false)
 
 ~GT_GEOVertexRefine ()
 
const GT_AttributeListHandlegetGTAttributes () const
 Get the attribute handle. More...
 
GA_AttributeRefMap bindAttributeHandle (int segment)
 
void extractVertices (int segment, const GA_AttributeRefMap &hlist, const GA_Offset *vertices, GA_Size nvertices)
 
void fillCurveVertices (int segment, const GEO_Curve *curve, const UT_FloatArray &uvals)
 Fill attributes for a curve. More...
 
void setN (int segment, const UT_Vector3 *N, GA_Size nvertices)
 

Detailed Description

Refine points/vertices into unique data arrays (not shared by the detail).

This class can be used to create point/vertex attributes for refined primitives. The way to use this would be to:

GT_GEOVertexRefine vrefine(srcprim, filter, true, 3);
for (int seg = 0; seg < srcprim.getMotionSegments(); ++seg)
{
const GEO_Primitive *prim;
prim = vrefine.bindAttributeHandle(seg, hlist);
vertex_offsets = getRefinedVertices();
for (exint v = 0; v < nvertices; ++v)
prim->evaluate(parms, vertex_offsets[v], hlist);
vrefine.extractVertices(seg, hlist, vertex_offsets, nvertices);
}

Definition at line 48 of file GT_GEOVertexRefine.h.

Constructor & Destructor Documentation

GT_GEOVertexRefine::GT_GEOVertexRefine ( const GT_GEOPrimitive prim,
const GT_GEOAttributeFilter filter,
bool  do_point_attributes,
int  psize = 3,
bool  user_defined_N = false 
)

Create an attribute list for vertices (and optionally points). The psize specifies the tuple size for P and is only valid when adding point attributes too. If user_defined_N is true, the N attribute will be added if it's not found on points/vertices. Also, the N attribute will not be picked up for refinement (relying on the user to set the values properly).

This creates the attribute handle list. Refinement of vertex attributes is a separate process.

GT_GEOVertexRefine::~GT_GEOVertexRefine ( )

Member Function Documentation

GA_AttributeRefMap GT_GEOVertexRefine::bindAttributeHandle ( int  segment)

Bind the attributes to the attribute handle list. The handle list should be cleared of entries before calling this. The method returns the primitive associated with the segment.

void GT_GEOVertexRefine::extractVertices ( int  segment,
const GA_AttributeRefMap hlist,
const GA_Offset vertices,
GA_Size  nvertices 
)

Extract the attribute values from the vertices, creating GT data arrays for the attribute data. This fills out the data arrays on the attribute list handle

void GT_GEOVertexRefine::fillCurveVertices ( int  segment,
const GEO_Curve curve,
const UT_FloatArray uvals 
)

Fill attributes for a curve.

const GT_AttributeListHandle& GT_GEOVertexRefine::getGTAttributes ( ) const
inline

Get the attribute handle.

Definition at line 68 of file GT_GEOVertexRefine.h.

void GT_GEOVertexRefine::setN ( int  segment,
const UT_Vector3 N,
GA_Size  nvertices 
)

Set the N attribute for vertices. This should only be called if user_defined_N was set in the constructor. It must be called after extractVertices.


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