returns class name of all objects or nullopt if they are of different types
| 1242 | |
| 1243 | /// returns class name of all objects or nullopt if they are of different types |
| 1244 | static std::optional<std::string> commonClassName( const std::vector<std::shared_ptr<Object>>& objs ) |
| 1245 | { |
| 1246 | if ( objs.empty() ) |
| 1247 | return {}; |
| 1248 | |
| 1249 | auto cn = objs[0]->className(); |
| 1250 | if ( objs.size() == 1 ) |
| 1251 | return cn; |
| 1252 | |
| 1253 | for ( int i = 1; i < objs.size(); ++i ) |
| 1254 | if ( cn != objs[i]->className() ) |
| 1255 | return {}; |
| 1256 | |
| 1257 | return objs[0]->classNameInPlural(); |
| 1258 | } |
| 1259 | |
| 1260 | bool Viewer::loadFiles( const std::vector<std::filesystem::path>& filesList ) |
| 1261 | { |