HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Smooth.h File Reference
#include "GU_API.h"
#include <GA/GA_ElementGroup.h>
#include <GA/GA_Types.h>
#include <UT/UT_Array.h>
#include <UT/UT_Map.h>
+ Include dependency graph for GU_Smooth.h:

Go to the source code of this file.

Classes

struct  GU_SmoothParms
 
struct  GU_ImplicitSmoothParms
 

Typedefs

typedef unsigned int GU_SmoothBoundaryMask
 

Enumerations

enum  GU_SmoothWeightMethod { GU_SMOOTH_WEIGHT_UNIFORM, GU_SMOOTH_WEIGHT_EDGE_LENGTH, GU_SMOOTH_WEIGHT_N }
 
enum  GU_ImplicitSmoothMethod { GU_IMPLICIT_SMOOTH_METHOD_UNIFORM = 0, GU_IMPLICIT_SMOOTH_METHOD_SCALE_DOMINANT, GU_IMPLICIT_SMOOTH_METHOD_CURVATURE_DOMINANT }
 
enum  GU_SmoothBoundaryType { GU_SMOOTH_BOUNDARY_NONE = 0, GU_SMOOTH_BOUNDARY_SURFACE = 1, GU_SMOOTH_BOUNDARY_SELECTION = 2, GU_SMOOTH_BOUNDARY_ALL = 3 }
 

Functions

GU_API bool GUsmooth (GA_Attribute *attrib, float frequency, int iterations, const GA_PrimitiveGroup *primgroup=NULL)
 
GU_API bool GUsmooth (GA_Attribute *attrib, const GA_Range &pointrange, float frequency, int iterations, const UT_Array< GA_OffsetArray > &ringzeropoints, const GA_PrimitiveGroup *primgroup=0)
 
GU_API bool GUsmooth (GA_Attribute *attrib, const GA_Range &pointrange, float weight1, float weight2, int iterations, const UT_Array< GA_OffsetArray > &ringzeropoints, const GA_PrimitiveGroup *primgroup=0)
 
GU_API bool GUsmoothComputeEdgeWeights (UT_Array< UT_Array< fpreal >> &edge_weights, const GU_SmoothWeightMethod method, const GA_Attribute &pt_attrib, const GA_Range &pt_range, const UT_Array< GA_OffsetArray > &pt_ringzero)
 
GU_API bool GUsmoothLaplace (GA_Attribute &pt_attrib, const GU_SmoothParms &parms, const GA_PointGroup *pt_group=nullptr, GA_Attribute *work_attrib=nullptr)
 
GU_API void GUimplicitSmooth (UT_Array< GA_Attribute * > &attribs, const GU_ImplicitSmoothParms &parms, const GA_Group *group)
 
GU_API void GUimplicitSmooth (const GA_Attribute &attrib, const GU_ImplicitSmoothParms &parms, const GA_Group *group, UT_Map< GA_Offset, UT_Vector3 > &edits)
 

Typedef Documentation

typedef unsigned int GU_SmoothBoundaryMask

Definition at line 124 of file GU_Smooth.h.

Enumeration Type Documentation

Enumerator
GU_IMPLICIT_SMOOTH_METHOD_UNIFORM 
GU_IMPLICIT_SMOOTH_METHOD_SCALE_DOMINANT 
GU_IMPLICIT_SMOOTH_METHOD_CURVATURE_DOMINANT 

Definition at line 110 of file GU_Smooth.h.

Enumerator
GU_SMOOTH_BOUNDARY_NONE 
GU_SMOOTH_BOUNDARY_SURFACE 
GU_SMOOTH_BOUNDARY_SELECTION 
GU_SMOOTH_BOUNDARY_ALL 

Definition at line 118 of file GU_Smooth.h.

Enumerator
GU_SMOOTH_WEIGHT_UNIFORM 
GU_SMOOTH_WEIGHT_EDGE_LENGTH 
GU_SMOOTH_WEIGHT_N 

Definition at line 58 of file GU_Smooth.h.

Function Documentation

GU_API void GUimplicitSmooth ( UT_Array< GA_Attribute * > &  attribs,
const GU_ImplicitSmoothParms parms,
const GA_Group group 
)
GU_API void GUimplicitSmooth ( const GA_Attribute attrib,
const GU_ImplicitSmoothParms parms,
const GA_Group group,
UT_Map< GA_Offset, UT_Vector3 > &  edits 
)
GU_API bool GUsmooth ( GA_Attribute attrib,
float  frequency,
int  iterations,
const GA_PrimitiveGroup primgroup = NULL 
)

Returns true iff the attribute is able to be smoothed, (i.e. a point or vertex numeric attribute), and the function is not interrupted. primgroup is used to determine the point range and connectivity.

GU_API bool GUsmooth ( GA_Attribute attrib,
const GA_Range pointrange,
float  frequency,
int  iterations,
const UT_Array< GA_OffsetArray > &  ringzeropoints,
const GA_PrimitiveGroup primgroup = 0 
)

Returns true iff the attribute is able to be smoothed, (i.e. a point or vertex numeric attribute), and the function is not interrupted. primgroup is only used if the attribute is a vertex attribute.

GU_API bool GUsmooth ( GA_Attribute attrib,
const GA_Range pointrange,
float  weight1,
float  weight2,
int  iterations,
const UT_Array< GA_OffsetArray > &  ringzeropoints,
const GA_PrimitiveGroup primgroup = 0 
)

Like the GUsmooth above, except with weights specified explicitly, instead of using frequency.

GU_API bool GUsmoothComputeEdgeWeights ( UT_Array< UT_Array< fpreal >> &  edge_weights,
const GU_SmoothWeightMethod  method,
const GA_Attribute pt_attrib,
const GA_Range pt_range,
const UT_Array< GA_OffsetArray > &  pt_ringzero 
)
GU_API bool GUsmoothLaplace ( GA_Attribute pt_attrib,
const GU_SmoothParms parms,
const GA_PointGroup pt_group = nullptr,
GA_Attribute work_attrib = nullptr 
)

Smooth a point V3 attribute using simple laplacian smoothing via average of point neighbours. This method is faster but causes shrinkage.