MCPcopy Create free account
hub / github.com/Kitware/TeleSculptor / execute

Method execute

gui/tools/SaveKeyFrameTool.cxx:65–113  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

63
64//-----------------------------------------------------------------------------
65bool SaveKeyFrameTool::execute(QWidget* window)
66{
67 QTE_D();
68
69 if (!this->hasTracks() || !this->hasVideoSource())
70 {
71 QMessageBox::information(
72 window, "Insufficient data",
73 "This operation requires tracks and a video source.");
74 return false;
75 }
76
77 if (!video_input::check_nested_algo_configuration(
78 BLOCK_VR, this->data()->config))
79 {
80 QMessageBox::critical(
81 window, "Configuration error",
82 "An error was found in the video source algorithm configuration.");
83 return false;
84 }
85
86 // Merge project config with default config file
87 auto const config = readConfig("gui_keyframe_image_writer.conf");
88
89 // Check configuration
90 if (!config)
91 {
92 QMessageBox::critical(
93 window, "Configuration error",
94 "No configuration data was found. Please check your installation.");
95 return false;
96 }
97
98 config->merge_config(this->data()->config);
99 if (!image_io::check_nested_algo_configuration(BLOCK_IW, config))
100 {
101 QMessageBox::critical(
102 window, "Configuration error",
103 "An error was found in the image writer algorithm configuration.");
104 return false;
105 }
106
107 video_input::set_nested_algo_configuration(
108 BLOCK_VR, this->data()->config, d->video_reader);
109 image_io::set_nested_algo_configuration(
110 BLOCK_IW, config, d->image_writer);
111
112 return AbstractTool::execute(window);
113}
114
115//-----------------------------------------------------------------------------
116void SaveKeyFrameTool::run()

Callers

nothing calls this directly

Calls 2

readConfigFunction · 0.85
dataMethod · 0.80

Tested by

no test coverage detected