Isis 3 Programmer Reference
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 {
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
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:141
File name manipulation and expansion.
Definition: FileName.h:116
This class is used as the base class for all PolygonSeeder objects.
Definition: PolygonSeeder.h:63
Search child objects.
Definition: PvlObject.h:170
Loads plugins from a shared library.
Definition: Plugin.h:71
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
Container for cube-like labels.
Definition: Pvl.h:135
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QFunctionPointer GetPlugin(const QString &group)
This method returns a void pointer to a C function (i.e., the plugin) It does this by looking in itse...
Definition: Plugin.cpp:55
static PolygonSeeder * Create(Pvl &pvl)
Create a PolygonSeeder object using a PVL specification.
void read(const QString &file)
Loads PVL information from a stream.
Definition: Pvl.cpp:76
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:465