All Frameworks  Class Hierarchy  This Framework  Indexes

SPAds Global Function DM_add_curve_patch


int DM_add_curve_patch(int& rtn_err,
DS_dmod* dmod,
int domain_flag,
double min,
double max,
int refinement,
void* patch_entity,
void*[2] seam_data,
SDM_options* sdmo=NULL)
Makes and adds a patch- to-patch hierarchy and returns a new patch tag identifier or an error.

Role: Modifies the target deformable model.

Adds a patch to the input deformable model. The domain of the patch is a span connected to its parent by a seam which consists of two point constraints. The patch may be made to connect to its parent with C0 (position only) or C1 (position and tangent) continuity but is returned by this function with C1 continuity.

The size of the span is specified by the minimum and maximum u values which are given in the parent's domain space. When domain_flag is 1 the min and max u values are specified in a range that varies from 0 to 1 (and is scaled to the parent's dmod domain space in this function), and when domain_flag is 0 the min and max u values are specified in the parent's dmod domain space. When domain_flag is 2, the min and max u values are specified in the parent's pfunc's domain space.

The refinement argument specifies the number of control points in the child patch compared to the parent patch. For example, a refinement value of 2 will double the density of control points in the child compared to the parent. Refinement must be an integer value greater than 0. The patch entity pointer is made available to applications. It is stored with the patch's deformable model data structure but is never accessed. Applications can retrieve this pointer with the deformable model method call, DS_deformable model. Similarly, the seam data pointers are made available to applications to store data with each seam. These pointers are never accessed but can be accessed by applications with the call, DS_deformable model->Seam(ii)->Src_data();

Returns the tag of the newly created patch if successful, or an error.

Errors:
DM_NULL_INPUT_PTR
The deformable model cannot be NULL on entry.
DM_scale_unit_dpt_to_pfunc()
Errors
DM_UNCONTAINED_CHILD
The input patch boundary must be in the range of 0 to 1.
DM_BAD_REFINEMENT_VALUE
The input refinement must be larger than 0.
DM_PATCH_OCCLUDES_ROOT
The input patch completely covers the deformable model.
DM_BAD_DOMAIN_PT_RANGE
The domain point must be completely contained by the deformable model.

Effect: Changes model

Parameters:
rtn_err
out: 0=success or neg err code.
dmod
in: dmod to be theparent.
domain_flag
in : 0=domain_pts in orig_dmod_space, 1=domain_pts in unit_space. 2=domain_pts in internal_pfunc_space.
min
in: min-domain (0 to 1 range).
max
in: max-domain (0 to 1 range).
refinement
in: parent_knot_spacing/ child_knot_spacing.
patch_entity
in: app entity ptr stored with patch.
seam_data
in: app entity data stored with each seam.
sdmo
in:SDM_options pointer.

This object is included in the file: dmapi.hxx

Copyright (c) 1989-2007 by Spatial Corp. All rights reserved.