July 2001
Beginner to intermediate
368 pages
6h 52m
English
// segment of code that instantiates the features // no error checking provided--for illustration // purposes only // each feature object needs to know the model number // and feature ID it corresponds to in order to retrieve // information when requested. Note how this information // is passed into each object's constructor // open model modelNum= V1OpenModel( modelName); nElements= V1GetNumberofElements(modelNum); Feature *features[MAXFEATURES]; // do for each feature in the model for (i= 0; i < nElements; i++) { // determine feature present and create // appropriate feature object switch( V1GetType( modelNum, i)) { case SLOT: features[i]= new V1Slot( ... |