Features

 

VX has a strictly variational sketcher but it has hybrid modeler in the sense that it is both variational and parametric. Most operations in the modeler correspond to a single historical object called a "feature." In VX a feature represents some collective operation which resulted in a modified database. When a parametric REGEN occurs each of these features is re-executed in their historical order (typically this is the order they were created).
 

Unless your new application is strictly a query or analysis operation, you will want to create a feature in the database which corresponding to this operation.
 

In order to create a feature in VX you need a unique name. You may either create your own naming scheme or use the following function to generate one.
 

 

int CdTargObjName

(

VeCdObjName class, /* i: name class */

OmName name /* o: null-terminated ascii name */

)

 

 

Many of the VX operations have a final prompt which allows the user to name the feature whatever they wish. This final prompt also gives the user one last chance to apply changes before applying the operation. This is particularly useful when dynamic echoing is used (see Advanced Tools for more information on this). Then logic such as the following occurs:
 

 

OmName acFtrName;

/* See if a name was collected by input object in field id=idFld.*/

err = VxInpStr( idx_in, idFld, sizeof(OmName), acFtrName ) if (err)

{

/* No name was entered by user so create one. */

err = CdTargObjName( V_ftr_type, acFtrName );

if (err) goto END;

}

 

 

As you make your database changes you will need to keep a list of indices to new objects you have created. When you are done with your operation then you are ready to create your feature using the following OpenVX function:
 

 

int CdTargAddFtr

(

int idx_in, /* i: input VDATA object (located in PRJ_BIN) */

char *name, /* i: optional feature name (or "") */

int cnt, /* i: count of objects associated w/feature */

VsObjHandle *list, /* i: list of objects associated w/feature */

VsObjHandle *oh_ftr /* o: feature handle */

);

 

 

This will create a feature in the VX database and assign your modifications to it. The database index of the new feature is returned in the object handle "oh_ftr".
 

The source file openvx/src/ovxSph3Pt.c provides an example of this process.

Return to VX CAD/CAM Index