Providing a Name and Dimension for the Parameters

The developer must provide a name for each parameter used in a parameter block. This name is needed because the animated parameters show up in the track view and must be labeled. The parameter block takes care of displaying them in the track view, but has no idea of the name for each one, it only knows them by index. The developer provides the name to display by implementing the method GetParameterName() and returning the name of the parameter whose index into the parameter block is passed.

TSTR SphereObject::GetParameterName(int pbIndex)
 {
 switch (pbIndex) {
  casePB_RADIUS:
   return TSTR(_T("Radius"));
  casePB_HEMI:
   return TSTR(_T("Hemisphere"));
  casePB_SEGS:
   return TSTR(_T("Segments"));
  casePB_SMOOTH:
   return TSTR(_T("Smooth"));
  default:
   return TSTR(_T(""));
  }
 }

The developer must provide a dimension for each parameter used in a parameter block. This dimension is basically the type and magnitude of the value stored in the parameter block. Pre-defined constants are used as the return values. For more information, see the Reference section on ParamDimension.

ParamDimension *SphereObject::GetParameterDim(int pbIndex)
 {
 switch (pbIndex) {
  casePB_RADIUS:
   return stdWorldDim;
  casePB_HEMI:
   return stdNormalizedDim;
  casePB_SEGS:
   return stdSegmentsDim;
  casePB_SMOOTH:
   return stdNormalizedDim;
  default:
   return defaultDim;
  }
 }