HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDK_Sample::GU_Copy Namespace Reference

Namespaces

 NeededTransforms
 

Functions

void GUremoveUnnecessaryAttribs (GU_Detail *output_geo, const GU_Detail *source, const GU_Detail *target, GU_CopyToPointsCache *cache, const GU_CopyToPointsCache::TargetAttribInfoMap *target_attrib_info, const GU_CopyToPointsCache::TargetAttribInfoMap *target_group_info)
 
void GUsetupPointTransforms (GU_PointTransformCache *cache, const GA_OffsetListRef &target_point_list, const GU_Detail *target, const bool transform_using_more_than_P, const bool allow_implicit_N, bool &transforms_changed)
 
void GUaddAttributesFromSourceOrTarget (GU_Detail *output_geo, const GU_Detail *source, exint *num_source_attribs, bool has_transform_matrices, bool *needed_transforms, const GU_Detail *target, GU_CopyToPointsCache::TargetAttribInfoMap *target_attrib_info, GU_CopyToPointsCache::TargetAttribInfoMap *target_group_info, exint *num_target_attribs)
 
void GUcomputeTransformTypeCaches (GU_PointTransformCache *cache, exint num_target_points, bool transforms_changed, const bool needed_transforms[NeededTransforms::num_needed_transforms])
 
void GUcreateGeometryFromSource (GU_Detail *output_geo, const GU_Detail *const source, const GA_OffsetList &source_point_list_cache, const GA_OffsetList &source_vertex_list_cache, const GA_OffsetList &source_prim_list_cache, const exint ncopies)
 NOTE: This does not clear output_geo. More...
 
void GUcreatePointOrPrimList (GA_OffsetList &offset_list, const GU_Detail *const detail, const GA_ElementGroup *const group, const GA_AttributeOwner owner)
 
void GUcreateVertexListAndGeometryFromSource (GU_Detail *output_geo, const GU_Detail *const source, const exint source_point_count, const exint source_vertex_count, const exint source_prim_count, const GA_OffsetList &source_point_list_cache, GA_OffsetList &source_vertex_list_cache, const GA_OffsetList &source_prim_list_cache, const GA_PointGroup *const source_pointgroup, const GA_PrimitiveGroup *const source_primgroup, const exint ncopies)
 
void GUcreateEmptyPackedGeometryPrims (GU_Detail *const output_geo, const exint num_packed_prims)
 
void GUcopyAttributesFromSource (GU_Detail *const output_geo, const GA_SplittableRange *const output_splittable_ranges, const GU_Detail *const source, const exint num_target_points, GU_CopyToPointsCache *const cache, const GA_OffsetList *const source_offset_lists, const exint *const num_source_attribs, const bool no_transforms, const bool had_transform_matrices, const bool has_transform_matrices, const bool topology_changed, const bool transforms_changed, const GU_Detail *const target, const GU_CopyToPointsCache::TargetAttribInfoMap *const target_attrib_info, const GU_CopyToPointsCache::TargetAttribInfoMap *const target_group_info, const exint *const target_to_piecei, const UT_Array< exint > *const owner_piece_offset_starts, const GU_CopyToPointsCache::PieceData *const piece_data)
 
void GUcopyAttributesFromTarget (GU_Detail *const output_geo, const GA_SplittableRange *const output_splittable_ranges, const exint ncopies, GU_CopyToPointsCache *const cache, const exint source_point_count, const exint source_vertex_count, const exint source_prim_count, const exint *const num_target_attribs, const GA_OffsetListRef &target_point_list, const GU_Detail *const target, GU_CopyToPointsCache::TargetAttribInfoMap &target_attrib_info, GU_CopyToPointsCache::TargetAttribInfoMap &target_group_info, const bool topology_changed, const exint *const target_to_piecei, const UT_Array< exint > *const owner_piece_offset_starts, const GU_CopyToPointsCache::PieceData *const piece_data)
 
void GUupdatePackedPrimTransforms (GU_Detail *output_geo, GU_CopyToPointsCache *cache, const bool had_transform_matrices, const exint num_packed_prims, const UT_Vector3 *const constant_pivot)
 
void GUhandleTargetAttribsForPackedPrims (GU_Detail *output_geo, GU_CopyToPointsCache *cache, const bool topology_changed, const bool had_transform_matrices, const GU_Detail *const target, const GA_OffsetListRef &target_point_list, GU_CopyToPointsCache::TargetAttribInfoMap &target_attrib_info, GU_CopyToPointsCache::TargetAttribInfoMap &target_group_info, const UT_Vector3 *const constant_pivot)
 
void GUcopyPackAllSame (GU_Detail *output_geo, const GEO_ViewportLOD lod, const GU_CopyToPointsCache::PackedPivot pivot_type, GU_CopyToPointsCache *cache, const GU_ConstDetailHandle source_handle, const GU_Detail *source, const GA_PointGroup *source_pointgroup, const GA_PrimitiveGroup *source_primgroup, bool source_topology_changed, bool had_transform_matrices, bool transforms_changed, const exint num_packed_prims, const GU_Detail *target, const GA_OffsetListRef *target_point_list, GU_CopyToPointsCache::TargetAttribInfoMap *target_attrib_info, GU_CopyToPointsCache::TargetAttribInfoMap *target_group_info)
 

Function Documentation

void HDK_Sample::GU_Copy::GUaddAttributesFromSourceOrTarget ( GU_Detail output_geo,
const GU_Detail source,
exint num_source_attribs = nullptr,
bool  has_transform_matrices = false,
bool *  needed_transforms = nullptr,
const GU_Detail target = nullptr,
GU_CopyToPointsCache::TargetAttribInfoMap target_attrib_info = nullptr,
GU_CopyToPointsCache::TargetAttribInfoMap target_group_info = nullptr,
exint num_target_attribs = nullptr 
)

Adds to output_geo any missing attributes from source or target as needed. Also optionally computes what transform caches are needed for source attributes.

If an attribute is in both source and target_attrib_info/target_group_info, it will be taken from target if myCombineMethod is COPY, and will be taken from source if MULTIPLY, ADD, or SUBTRACT.

If there is only a source, e.g. if output_geo is the internal detail of a packed geometry primitive, omit target, target_attrib_info, target_group_info, and num_target_attribs.

If there is only a target, pass nullptr for source, and then num_source_attribs, has_transform_matrices, and needed_transforms will be ignored.

NOTE: num_source_attribs or num_target_attribs, if non-null, should be an array long enough to support GA_ATTRIB_VERTEX, GA_ATTRIB_POINT, and GA_ATTRIB_PRIMITIVE as indices, (3 at the moment, since they come first in GA_AttributeOwner). NOTE: needed_transforms, if non-null, should be an array of length NeededTransforms::num_needed_transforms.

Definition at line 457 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcomputeTransformTypeCaches ( GU_PointTransformCache cache,
exint  num_target_points,
bool  transforms_changed,
const bool  needed_transforms[NeededTransforms::num_needed_transforms] 
)

Definition at line 738 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcopyAttributesFromSource ( GU_Detail *const  output_geo,
const GA_SplittableRange *const  output_splittable_ranges,
const GU_Detail *const  source,
const exint  num_target_points,
GU_CopyToPointsCache *const  cache,
const GA_OffsetList *const  source_offset_lists,
const exint *const  num_source_attribs,
const bool  no_transforms,
const bool  had_transform_matrices,
const bool  has_transform_matrices,
const bool  topology_changed,
const bool  transforms_changed,
const GU_Detail *const  target,
const GU_CopyToPointsCache::TargetAttribInfoMap *const  target_attrib_info,
const GU_CopyToPointsCache::TargetAttribInfoMap *const  target_group_info,
const exint *const  target_to_piecei,
const UT_Array< exint > *const  owner_piece_offset_starts,
const GU_CopyToPointsCache::PieceData *const  piece_data 
)

Definition at line 2012 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcopyAttributesFromTarget ( GU_Detail *const  output_geo,
const GA_SplittableRange *const  output_splittable_ranges,
const exint  ncopies,
GU_CopyToPointsCache *const  cache,
const exint  source_point_count,
const exint  source_vertex_count,
const exint  source_prim_count,
const exint *const  num_target_attribs,
const GA_OffsetListRef target_point_list,
const GU_Detail *const  target,
GU_CopyToPointsCache::TargetAttribInfoMap target_attrib_info,
GU_CopyToPointsCache::TargetAttribInfoMap target_group_info,
const bool  topology_changed,
const exint *const  target_to_piecei,
const UT_Array< exint > *const  owner_piece_offset_starts,
const GU_CopyToPointsCache::PieceData *const  piece_data 
)

Definition at line 2699 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcopyPackAllSame ( GU_Detail output_geo,
const GEO_ViewportLOD  lod,
const GU_CopyToPointsCache::PackedPivot  pivot_type,
GU_CopyToPointsCache cache,
const GU_ConstDetailHandle  source_handle,
const GU_Detail source,
const GA_PointGroup source_pointgroup,
const GA_PrimitiveGroup source_primgroup,
bool  source_topology_changed,
bool  had_transform_matrices,
bool  transforms_changed,
const exint  num_packed_prims,
const GU_Detail target = nullptr,
const GA_OffsetListRef target_point_list = nullptr,
GU_CopyToPointsCache::TargetAttribInfoMap target_attrib_info = nullptr,
GU_CopyToPointsCache::TargetAttribInfoMap target_group_info = nullptr 
)

Uses the transforms in cache and geometry from source to create num_packed_prims packed geometry primitives referencing the same geometry. If the source groups are null, source_handle will be used to create the packed geometry primitives.

If target and the later parameters are non-null, target attributes in target_attrib_info and target_group_info will be copied from the points in target_point_list.

NOTE: This will clear output_geo if the topology has changed since the previous cook.

Definition at line 3401 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcreateEmptyPackedGeometryPrims ( GU_Detail *const  output_geo,
const exint  num_packed_prims 
)

Definition at line 1978 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcreateGeometryFromSource ( GU_Detail output_geo,
const GU_Detail *const  source,
const GA_OffsetList source_point_list_cache,
const GA_OffsetList source_vertex_list_cache,
const GA_OffsetList source_prim_list_cache,
const exint  ncopies 
)

NOTE: This does not clear output_geo.

Definition at line 1689 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcreatePointOrPrimList ( GA_OffsetList offset_list,
const GU_Detail *const  detail,
const GA_ElementGroup *const  group,
const GA_AttributeOwner  owner 
)

Definition at line 1897 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUcreateVertexListAndGeometryFromSource ( GU_Detail output_geo,
const GU_Detail *const  source,
const exint  source_point_count,
const exint  source_vertex_count,
const exint  source_prim_count,
const GA_OffsetList source_point_list_cache,
GA_OffsetList source_vertex_list_cache,
const GA_OffsetList source_prim_list_cache,
const GA_PointGroup *const  source_pointgroup,
const GA_PrimitiveGroup *const  source_primgroup,
const exint  ncopies 
)

NOTE: This does not clear output_geo. NOTE: The point and primitive lists must be created with GUcreatePointOrPrimList.

Definition at line 1921 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUhandleTargetAttribsForPackedPrims ( GU_Detail output_geo,
GU_CopyToPointsCache cache,
const bool  topology_changed,
const bool  had_transform_matrices,
const GU_Detail *const  target,
const GA_OffsetListRef target_point_list,
GU_CopyToPointsCache::TargetAttribInfoMap target_attrib_info,
GU_CopyToPointsCache::TargetAttribInfoMap target_group_info,
const UT_Vector3 *const  constant_pivot 
)

This sets the packed primitive local transforms, sets P based on the translations and pivots, (i.e. it first calls GUupdatePackedPrimTransforms), then removes unnecessary attributes, adds needed attributes from target, and copies target attribute values.

NOTE: constant_pivot being null means to get pivots from the primitives.

Definition at line 3331 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUremoveUnnecessaryAttribs ( GU_Detail output_geo,
const GU_Detail source,
const GU_Detail target,
GU_CopyToPointsCache cache,
const GU_CopyToPointsCache::TargetAttribInfoMap target_attrib_info,
const GU_CopyToPointsCache::TargetAttribInfoMap target_group_info 
)

Definition at line 137 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUsetupPointTransforms ( GU_PointTransformCache cache,
const GA_OffsetListRef target_point_list,
const GU_Detail target,
const bool  transform_using_more_than_P,
const bool  allow_implicit_N,
bool &  transforms_changed 
)

NOTE: transforms_changed must be initialized in advance to the condition of whether there are external factors that lead the transforms to need to be recomputed, e.g. the target point list changing from the previous cook.

Definition at line 304 of file GU_Copy2.C.

void HDK_Sample::GU_Copy::GUupdatePackedPrimTransforms ( GU_Detail output_geo,
GU_CopyToPointsCache cache,
const bool  had_transform_matrices,
const exint  num_packed_prims,
const UT_Vector3 *const  constant_pivot 
)

This sets the packed primitive local transforms, and sets P based on the translations and pivots.

Definition at line 3203 of file GU_Copy2.C.