All Frameworks  Class Hierarchy  This Framework  Indexes

SPAds Global Function DM_make_dmod_curve


DS_dmod * DM_make_dmod_curve(int& rtn_err,
DS_pfunc* pfunc,
void* dmod_entity=NULL,
int draw_state= DM_DRAW_SEAMS | DM_DRAW_CSTRNS | DM_DRAW_LOADS,
int tag= 2,
double alpha= 1.0,
double beta= 5.0,
double gamma= 0.0,
double delta= 0.0,
double dt= 1.0,
double mass= 0.0,
double damp= 0.0,
SDM_options* sdmo=NULL)
Creates a deformable curve model and returns a pointer to the deformable model object.

Role: Modifies return_err.

Builds and returns a deformable model of the pfunc shape. The deformable model entity pointer is made available to applications that may want to store data with each deformable model. This pointer is never accessed (and so may be set to NULL) but can be retrieved by an application with the DS_dmod method call DS_dmod->Entity() and it may be changed with the method DS_dmod->Set_entity(entity). draw_state is a bit-array integer which may be used by the application to control which pieces of deformable modeling information are rendered for each deformable model. See the DM_DRAW_...environment variables defined in the file "dmapi.hxx" for a complete list. The draw_state defaults to drawing loads, constraints, and seams. tag is unique identifier for this deformable model. Since this deformable model will act as the root of its own patch hierarchy a good tag value is 2 which is its default value. alpha (default=1) is this deformable model's resistance to stretch parameter value. beta (default=5) is this deformable model's resistance to bending parameter value. delta (default=0) is this deformable model's resistance to displacement from the default shape. DS_solve() (default =1) is the deformable modeling time step size taken with each call to DM_solve(). mass (default 1.0) and damp (default 5) are the dynamic parameters for this deformable model. With mass, a deformable model can overshoot and oscillate on its way to an equilibrium position. With damping the oscillations can diminish over time and the number of time steps until equilibrium is achieved may be increased.

mass (default 1.0) and damp (default 5) are the dynamic parameters for this deformable model. With mass a deformable model can overshoot and oscillate on its way to an equilibrium position. With damping the oscillations can diminish over time and the number of time steps until equilibrium is achieved may be increased.

mallocs is the calling program must free the memory of the returned deformable model pointer with a call to DM_delete_dmod. The pfunc pointer is stored within the deformable model and will be deleted when the deformable model is deleted. Do not call DM_delete_pfunc on that pointer after this call. Do not make a second deformable model with this pfunc pointer. Use DM_copy_pfunc if you want to make another deformable model with this shape.

Errors:
DM_NULL_INPUT_PTR
The pfunc cannot be NULL on input.
DM_BAD_TAG_VALUE
The tag value must be -1, to have the system assign one, or 2 or greater.
DM_BAD_ALPHA_VALUE
The value of alpha must be 0 or positive.
DM_BAD_BETA_VALUE
The value of beta must be 0 or positive.
DM_ZERO_ALPHA_AND_BETA
Both alpha and beta values cannot be 0.
:
DM_BAD_DELTA_VALUE
The value of delta must be positive.
DM_BAD_DT_VALUE
The value of dt must be positive.
DM_BAD_MASS_VALUE
The value of mass must be 0 or positive.
DM_BAD_DAMP_VALUE
The value of damp must be 0 or positive.

Effect: Changes model

Parameters:
rtn_err
out: 0=success or negative err code.
pfunc
in: defines the shape model.
dmod_entity
in: application ptr stored with dmod.
draw_state
in: draw bits for application graphics (draw loads, constraints, and seams).
tag
in: unique id for this object.
alpha
in: resistance to stretch [1.0].
beta
in: resistance to bending [5.0].
gamma
in: resist bending change rate.
delta
in: resistance to moving from default shape.
dt
in: implicit integration time step [1.0].
mass
in: physical param (causes rippling)[1.0].
damp
in: physical param (stable integration) [5.0].
sdmo
in:SDM_options pointer.

This object is included in the file: dmapi.hxx

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