本文整理汇总了C++中Exception::display方法的典型用法代码示例。如果您正苦于以下问题:C++ Exception::display方法的具体用法?C++ Exception::display怎么用?C++ Exception::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exception
的用法示例。
在下文中一共展示了Exception::display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
IUserInterface *userInterface;
try{
if(argc > 1){
userInterface = new CommandArgs(argc,argv);
//ran thru cmd
}else{
userInterface = new CommandLineUI();
}
exec(userInterface);
}catch(Exception *vl_Exception)
{
vl_Exception->display();
delete vl_Exception;
}
catch(...)
{
Exception *unhandledException = new Exception("A runtime exception has occured");
unhandledException->display();
delete unhandledException;
}
return 0;
}
示例2: mode_change_slot
void ODF::mode_change_slot ()
{
ODF_Item* settings = get_image();
if (!settings)
return;
const GUI::DWI::Renderer::mode_t mode = (!type_selector->currentIndex() ? GUI::DWI::Renderer::mode_t::SH :
(type_selector->currentIndex() == 1 ? GUI::DWI::Renderer::mode_t::TENSOR : GUI::DWI::Renderer::mode_t::DIXEL));
if (settings->mode == mode)
return;
auto reset_GUI = [&] (const GUI::DWI::Renderer::mode_t mode) {
switch (mode) {
case GUI::DWI::Renderer::mode_t::SH: type_selector->setCurrentIndex (0); break;
case GUI::DWI::Renderer::mode_t::TENSOR: type_selector->setCurrentIndex (1); break;
case GUI::DWI::Renderer::mode_t::DIXEL: type_selector->setCurrentIndex (2); break;
}
};
// Mode change combobox is now always enabled;
// Need to detect bad selections here and act accordingly
switch (mode) {
case GUI::DWI::Renderer::mode_t::SH:
try {
Math::SH::check (settings->image.header());
} catch (Exception& e) {
e.display();
reset_GUI (settings->mode);
return;
}
renderer->sh.update_mesh (level_of_detail, lmax);
break;
case GUI::DWI::Renderer::mode_t::TENSOR:
if (settings->image.header().size(3) != 6) {
Exception e ("Cannot use image " + settings->image.header().name() + " as tensor overlay; must have 6 volumes");
e.display();
reset_GUI (settings->mode);
return;
}
renderer->tensor.update_mesh (level_of_detail);
break;
case GUI::DWI::Renderer::mode_t::DIXEL:
break;
}
settings->mode = mode;
setup_ODFtype_UI (settings);
if (preview)
preview->render_frame->set_mode (mode);
updateGL();
update_preview();
}