All Frameworks  Class Hierarchy  This Framework  Indexes

SPAds Global Function DM_add_spring_set


int DM_add_spring_set(int& rtn_err,
DS_dmod* dmod,
int tag_flag,
int domain_flag,
int pt_count,
double* domain_pts,
double* free_pts=NULL,
double gain=0.0,
int tag=-1,
SDM_options* sdmo=NULL)
Adds a set of springs to a deformable model and returns a new tag identifier or an error.

Role: Builds and adds to the target deformable model a DS_spring_set using domain_pts and free_pts and the gain input arguments. A DS_spring_set is a set of springs that all share a common gain. When free_pts is NULL each spring's free_pt position is calculated using the spring's domain_pt location and the current shape of the deformable model.

When domain_flag is set to 1, every dpt is given in the unit range and mapped to the dmod's actual domain range by this function. When domain_flag is set to 0, the dpts are given in the dmod's original domain range. When domain_flag is set to 2, the dpts are given in the dmod's pfunc's internal domain range.

tag_flag selects the target deformable model. When tag equals -1 the next available tag number is assigned to the newly created load. Otherwise, the input tag number is used. Other valid values for the tag flag are:

1 active deformable model
2 root deformable model

Otherwise, the target is the deformable model whose tag identifier equals abs(tag_flag)

Returns a newly created DS_load's tag number.

Errors:
DM_parse_tag_flag() errors
DM_scale_unit_dpt_to_pfunc()
errors
DM_BAD_TAG_VALUE
The input tag value must be -1 or positive.
DM_NO_ROOT_DMOD
The the input deformable model cannot be NULL.
DM_NULL_INPUT_PTR
The dpt input pointer cannot be NULL.
DM_BAD_PT_COUNT_VALUE
The pt_count cannot be equal to or less than 0.
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: member of target dmod hierarchy to search.
tag_flag
in: specify tgt dmod 1 = active dmod 2 = root dmod else = member dmod with tag=tag_flag.
domain_flag
in: 0=domain_pts in orig_dmod_space, 1=domain_pts in unit_space, 2=domain_pts in internal_pfunc_space.
pt_count
in: number of springs in spring_set.
domain_pts
i/o: Spring surf end pts 1d=[u0,u1,...un], 2d=[uv0,...,uvN] Sized:[pt_count* domain_dim] ptr:[not-nested].
free_pts
in: Spring free end pts or NULL [xyz0,...,xyzN] Sized:[pt_count* image_dim] ptr:[not-nested].
gain
in: stiffness of all springs.
tag
next tag number else use this tag number.
sdmo
in:SDM_options pointer note: sets active dmod.

This object is included in the file: dmapi.hxx

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