jeudi 8 août 2019

Generalizing a function

I am doing same step for different variables in my three functions.

 SumPosition_Channel *posChannel;
 bool isLoop;
 cont->GetPositionChannel(&posChannel);
 isLoop = posChannel->getChannelLoop();
 checkBoxChannelLoop->setChecked(isLoop);


SumRotation_Channel *rotChannel;
bool isLoop;
cont->GetRotationChannel(&rotChannel);
isLoop = rotChannel->getChannelLoop();
checkBoxChannelLoop->setChecked(isLoop);


SumScaling_Channel *scaChannel;
bool isLoop;
cont->GetScalingChannel(&scaChannel);
isLoop = scaChannel->getChannelLoop();
checkBoxChannelLoop->setChecked(isLoop);

Can I generalize them into one function?

Aucun commentaire:

Enregistrer un commentaire