@@ -265,32 +265,40 @@ std::map<std::string, bool> engine::getRenderingBackendList()
265
265
// ----------------------------------------------------------------------------
266
266
void engine::loadPlugin (const std::string& pathOrName, const std::vector<fs::path>& searchPaths)
267
267
{
268
- if (pathOrName.empty ())
268
+ std::string localPathOrName = pathOrName;
269
+
270
+ if (localPathOrName.empty ())
269
271
{
270
272
return ;
271
273
}
272
274
275
+ // For easier removal when removing deprecation: F3D_DEPRECATED
276
+ if (localPathOrName == " exodus" ) {
277
+ f3d::log::warn (" The 'exodus' plugin is deprecated, loading 'hdf' instead" );
278
+ localPathOrName = " hdf" ;
279
+ }
280
+
273
281
std::string pluginOrigin = " static" ;
274
282
factory* factory = factory::instance ();
275
283
276
284
// check if the plugin is already loaded
277
285
auto plugs = factory->getPlugins ();
278
- if (std::any_of (plugs.cbegin (), plugs.cend (), [pathOrName ](const plugin* plug)
279
- { return (plug->getName () == pathOrName || plug->getOrigin () == pathOrName ); }))
286
+ if (std::any_of (plugs.cbegin (), plugs.cend (), [localPathOrName ](const plugin* plug)
287
+ { return (plug->getName () == localPathOrName || plug->getOrigin () == localPathOrName ); }))
280
288
{
281
- log::debug (" Plugin \" " , pathOrName , " \" already loaded" );
289
+ log::debug (" Plugin \" " , localPathOrName , " \" already loaded" );
282
290
return ;
283
291
}
284
292
285
293
// check if the plugin is a known static plugin
286
- factory::plugin_initializer_t init_plugin = factory->getStaticInitializer (pathOrName );
294
+ factory::plugin_initializer_t init_plugin = factory->getStaticInitializer (localPathOrName );
287
295
288
296
if (init_plugin == nullptr )
289
297
{
290
298
vtksys::DynamicLoader::LibraryHandle handle = nullptr ;
291
299
try
292
300
{
293
- fs::path fullPath = utils::collapsePath (pathOrName );
301
+ fs::path fullPath = utils::collapsePath (localPathOrName );
294
302
if (fs::exists (fullPath))
295
303
{
296
304
// plugin provided as full path
@@ -313,7 +321,7 @@ void engine::loadPlugin(const std::string& pathOrName, const std::vector<fs::pat
313
321
// Construct the library file name from the plugin name
314
322
std::string libName = vtksys::DynamicLoader::LibPrefix ();
315
323
libName += " f3d-plugin-" ;
316
- libName += pathOrName ;
324
+ libName += localPathOrName ;
317
325
libName += vtksys::DynamicLoader::LibExtension ();
318
326
319
327
// try search paths
@@ -323,7 +331,7 @@ void engine::loadPlugin(const std::string& pathOrName, const std::vector<fs::pat
323
331
if (fs::exists (tryPath))
324
332
{
325
333
log::debug (
326
- " Trying to load \" " , pathOrName , " \" plugin from: \" " , tryPath.string (), " \" " );
334
+ " Trying to load \" " , localPathOrName , " \" plugin from: \" " , tryPath.string (), " \" " );
327
335
handle = vtksys::DynamicLoader::OpenLibrary (tryPath.string ());
328
336
329
337
if (handle)
@@ -346,7 +354,7 @@ void engine::loadPlugin(const std::string& pathOrName, const std::vector<fs::pat
346
354
handle = vtksys::DynamicLoader::OpenLibrary (libName);
347
355
if (!handle)
348
356
{
349
- throw engine::plugin_exception (" Cannot open the library \" " + pathOrName +
357
+ throw engine::plugin_exception (" Cannot open the library \" " + localPathOrName +
350
358
" \" : " + vtksys::DynamicLoader::LastError ());
351
359
}
352
360
else
@@ -365,7 +373,7 @@ void engine::loadPlugin(const std::string& pathOrName, const std::vector<fs::pat
365
373
vtksys::DynamicLoader::GetSymbolAddress (handle, " init_plugin" ));
366
374
if (init_plugin == nullptr )
367
375
{
368
- throw engine::plugin_exception (" Cannot find init_plugin symbol in library \" " + pathOrName +
376
+ throw engine::plugin_exception (" Cannot find init_plugin symbol in library \" " + localPathOrName +
369
377
" \" : " + vtksys::DynamicLoader::LastError ());
370
378
}
371
379
}
0 commit comments