Isis 3.0 Object Programmers' Reference
Home
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
PolygonSeederFactory.cpp
Go to the documentation of this file.
1
24
#include "
PolygonSeederFactory.h
"
25
#include "
Plugin.h
"
26
#include "
IException.h
"
27
#include "
FileName.h
"
28
29
namespace
Isis {
52
PolygonSeeder
*
PolygonSeederFactory::Create
(
Pvl
&pvl) {
53
// Get the algorithm name to create
54
PvlGroup
&algo = pvl.
findGroup
(
"PolygonSeederAlgorithm"
,
Pvl::Traverse
);
55
QString algorithm = algo[
"Name"
];
56
57
// Open the factory plugin file
58
Plugin
p;
59
FileName
f(
"PolygonSeeder.plugin"
);
60
if
(f.fileExists()) {
61
p.
read
(
"PolygonSeeder.plugin"
);
62
}
63
else
{
64
p.
read
(
"$ISISROOT/lib/PolygonSeeder.plugin"
);
65
}
66
67
// Get the algorithm specific plugin and return it
68
PolygonSeeder
* (*plugin)(
Pvl
& pvl);
69
plugin = (
PolygonSeeder
* ( *)(
Pvl
& pvl)) p.
GetPlugin
(algorithm);
70
return
(*plugin)(pvl);
71
}
72
}
// end namespace isis