Isis 3 Programmer Reference
PolygonSeederFactory.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7
8#include "PolygonSeederFactory.h"
9#include "Plugin.h"
10#include "IException.h"
11#include "FileName.h"
12
13namespace Isis {
37 // Get the algorithm name to create
38 PvlGroup &algo = pvl.findGroup("PolygonSeederAlgorithm", Pvl::Traverse);
39 QString algorithm = algo["Name"];
40
41 // Open the factory plugin file
42 Plugin p;
43 FileName f("PolygonSeeder.plugin");
44 if(f.fileExists()) {
45 p.read("PolygonSeeder.plugin");
46 }
47 else {
48 p.read("$ISISROOT/lib/PolygonSeeder.plugin");
49 }
50
51 // Get the algorithm specific plugin and return it
52 PolygonSeeder* (*plugin)(Pvl & pvl);
53 plugin = (PolygonSeeder * ( *)(Pvl & pvl)) p.GetPlugin(algorithm);
54 return (*plugin)(pvl);
55 }
56} // end namespace isis
File name manipulation and expansion.
Definition FileName.h:100
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition FileName.cpp:449
Loads plugins from a shared library.
Definition Plugin.h:55
static PolygonSeeder * Create(Pvl &pvl)
Create a PolygonSeeder object using a PVL specification.
This class is used as the base class for all PolygonSeeder objects.
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
@ Traverse
Search child objects.
Definition PvlObject.h:158
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16