/* acting on visVTK checkbox*/
void MainWnd::SetVisVtk(wxCommandEvent& event)
{
SetVisVtk(_visVtk, m_camFrm,0);
SetVisVtk(_visBGVtk, m_camFrm,1);
SetVisVtk(_visFGVtk, m_camFrm,2);
SetVisVtk(_visSegmVtk, m_camFrm,3);
_vtkWin->Render();
}
/* acting on visVTK checkbox*/
void MainWnd::SetVisVtk(std::vectorvisChkBox, std::vector camFrm, int idx)
{
int i = 0;
std::vector::iterator itCtrl;
std::vector::iterator itCam;
for ( itCtrl = visChkBox.begin(), itCam = camFrm.begin();
itCtrl != visChkBox.end() , itCam != camFrm.end();
itCtrl++, itCam++, i++ )
{
if(!_vtkWin){return;};
(*itCam)->hideDataActVtk( !((*itCtrl)->IsChecked()) , idx);
}
}
The code compiled and ran fine on my windows box, but trying to compile on Mac revealed the error. Renaming the worker function to avoid overloading allowed a succesful compilation.
/* acting on visVTK checkbox*/
void MainWnd::SetVisVtk(wxCommandEvent& event)
{
SetVisVtkIdx(_visVtk, m_camFrm,0);
SetVisVtkIdx(_visBGVtk, m_camFrm,1);
SetVisVtkIdx(_visFGVtk, m_camFrm,2);
SetVisVtkIdx(_visSegmVtk, m_camFrm,3);
_vtkWin->Render();
}
/* acting on visVTK checkbox*/
void MainWnd::SetVisVtkIdx(std::vectorvisChkBox, std::vector camFrm, int idx)
{
int i = 0;
std::vector::iterator itCtrl;
std::vector::iterator itCam;
for ( itCtrl = visChkBox.begin(), itCam = camFrm.begin();
itCtrl != visChkBox.end() , itCam != camFrm.end();
itCtrl++, itCam++, i++ )
{
if(!_vtkWin){return;};
(*itCam)->hideDataActVtk( !((*itCtrl)->IsChecked()) , idx);
}
}
Of course this should have been obvious from the start, but this is why testing on multiple platform is such a pain. The faulty code compiled flawlessly in vs2005.
No comments:
Post a Comment