OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimTool.h>
Public Member Functions | |
ossimTool () | |
virtual | ~ossimTool () |
virtual bool | initialize (ossimArgumentParser &ap) |
Initializes from command line arguments. More... | |
virtual void | initialize (const ossimKeywordlist &kwl) |
Reads processing params from KWL and prepares for execute. More... | |
virtual void | loadJSON (const Json::Value &json_request) |
Reads processing params from JSON object provided. More... | |
virtual void | saveJSON (Json::Value &json) const |
Fetch product as JSON object when applicable Always returns true since using exception on error. More... | |
virtual bool | execute ()=0 |
Writes product to output file if applicable. More... | |
virtual const std::string & | getResponse () const |
Fetch product as string (typically JSON) when applicable, otherwise passes back empty string. More... | |
virtual void | clear () |
Disconnects and clears the DEM and image layers. More... | |
virtual void | abort () |
Kills current (asynchronous) process. More... | |
virtual void | getKwlTemplate (ossimKeywordlist &kwl) |
Assigns a template keywordlist to string for initializing derived classes. More... | |
void | getAPI (std::string &out) const |
Outputs a JSON representation of the Utility's API. More... | |
std::string | getAPI () const |
virtual ossimString | getClassName () const |
void | getBuildDate (std::string &s) const |
Gets build date. More... | |
void | getRevision (std::string &s) const |
Gets revision. More... | |
void | getVersion (std::string &s) const |
Gets version. More... | |
virtual bool | isChipProcessor () const |
Overrides base class implementation to indicate this class supports getChip() calls. More... | |
void | setOutputStream (std::ostream *os) |
Redirects any console output to the supplied stream for logging or JNI application. More... | |
bool | helpRequested () const |
Returns true when the initialization detects a "--help" option, so caller can avoid subsequent execute() call. More... | |
![]() | |
ossimObject () | |
virtual | ~ossimObject () |
virtual ossimObject * | dup () const |
virtual ossimString | getShortName () const |
virtual ossimString | getLongName () const |
virtual ossimString | getDescription () const |
virtual RTTItypeid | getType () const |
virtual bool | canCastTo (ossimObject *obj) const |
virtual bool | canCastTo (const RTTItypeid &id) const |
virtual bool | canCastTo (const ossimString &parentClassName) const |
virtual bool | saveState (ossimKeywordlist &kwl, const char *prefix=0) const |
virtual bool | loadState (const ossimKeywordlist &kwl, const char *prefix=0) |
virtual std::ostream & | print (std::ostream &out) const |
Generic print method. More... | |
virtual bool | isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const |
virtual void | accept (ossimVisitor &visitor) |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
![]() | |
JsonInterface () | |
virtual | ~JsonInterface () |
Protected Member Functions | |
virtual void | setUsage (ossimArgumentParser &ap) |
Initializes the aurgument parser with expected parameters and options. More... | |
![]() | |
virtual | ~ossimReferenced () |
Protected Attributes | |
ossimKeywordlist | m_kwl |
std::ostream * | m_consoleStream |
bool | m_helpRequested |
std::string | m_response |
Private Member Functions | |
bool | readTextFile (const ossimFilename &filename, std::string &contents) const |
Used for reading text files of template and JSON API from disk ONLY. More... | |
Base class for all OSSIM tool applications. These are utilities providing high-level functionality via the OSSIM library.
Definition at line 22 of file ossimTool.h.
ossimTool::ossimTool | ( | ) |
Definition at line 17 of file ossimTool.cpp.
|
virtual |
Definition at line 24 of file ossimTool.cpp.
|
virtual |
Kills current (asynchronous) process.
Defaults to do nothing.
Reimplemented in ossimChipProcTool.
Definition at line 32 of file ossimTool.cpp.
|
virtual |
Disconnects and clears the DEM and image layers.
Leaves OSSIM initialized.
Reimplemented in ossimChipProcTool, and ossimViewshedTool.
Definition at line 28 of file ossimTool.cpp.
|
pure virtual |
Writes product to output file if applicable.
The product may also beAlways returns true since using exception on error.
Implemented in ossimChipProcTool, ossimInfo, ossimSubImageTool, ossimViewshedTool, ossimHdf5Tool, ossimShorelineTool, ossimHlzTool, ossimPointCloudTool, ATP::ossimAtpTool, ossimDemTool, ossimPotraceTool, ossimBandMergeTool, ossimVerticesFinderTool, and ossimRegTool.
Referenced by ossimDemTool::doOMG(), ossimShorelineTool::execute(), and ossimToolServer::runCommand().
void ossimTool::getAPI | ( | std::string & | out | ) | const |
Outputs a JSON representation of the Utility's API.
string ossimTool::getAPI | ( | ) | const |
void ossimTool::getBuildDate | ( | std::string & | s | ) | const |
Gets build date.
s | String to initialize. |
Definition at line 161 of file ossimTool.cpp.
References OSSIM_BUILD_DATE.
|
virtual |
Reimplemented from ossimObject.
Reimplemented in ossimInfo, ossimViewshedTool, ossimSubImageTool, ossimHdf5Tool, ossimShorelineTool, ossimOrthoTool, ossimSlopeTool, ossimHlzTool, ossimHillshadeTool, ATP::ossimAtpTool, ossimDemTool, ossimPotraceTool, ossimVerticesFinderTool, ossimRegTool, and ossimBandMergeTool.
Definition at line 36 of file ossimTool.cpp.
Referenced by getKwlTemplate(), and ossimChipProcTool::processRemainingArgs().
|
virtual |
Assigns a template keywordlist to string for initializing derived classes.
Reimplemented in ATP::ossimAtpTool, ossimDemTool, ossimPotraceTool, ossimVerticesFinderTool, ossimRegTool, and ossimBandMergeTool.
Definition at line 100 of file ossimTool.cpp.
References ossimKeywordlist::addFile(), ossimFilename::dirCat(), getClassName(), ossimPreferences::instance(), ossimNotify(), and ossimNotifyLevel_WARN.
Referenced by ossimBandMergeTool::getKwlTemplate(), and initialize().
|
inlinevirtual |
Fetch product as string (typically JSON) when applicable, otherwise passes back empty string.
Always returns true since using exception on error.
Definition at line 72 of file ossimTool.h.
void ossimTool::getRevision | ( | std::string & | s | ) | const |
Gets revision.
s | String to initialize. |
Definition at line 170 of file ossimTool.cpp.
References OSSIM_REVISION.
void ossimTool::getVersion | ( | std::string & | s | ) | const |
Gets version.
s | String to initialize. |
Definition at line 179 of file ossimTool.cpp.
References OSSIM_VERSION.
|
inline |
Returns true when the initialization detects a "--help" option, so caller can avoid subsequent execute() call.
If execute() is called, it will return true after trivial execute.
Definition at line 134 of file ossimTool.h.
Referenced by ossimToolServer::runCommand().
|
virtual |
Initializes from command line arguments.
This base class has some common arguments to read. The derived class should call this implementation in addition to setting its own arguments.
ap | Represents command line. |
Reimplemented in ossimChipProcTool, ossimInfo, ossimShorelineTool, ossimHdf5Tool, ossimHillshadeTool, ossimSubImageTool, ossimHlzTool, ossimViewshedTool, ossimOrthoTool, ossimSlopeTool, ossimPointCloudTool, ATP::ossimAtpTool, ossimDemTool, ossimPotraceTool, ossimBandMergeTool, ossimVerticesFinderTool, and ossimRegTool.
Definition at line 58 of file ossimTool.cpp.
References getAPI(), ossimArgumentParser::getApplicationUsage(), getKwlTemplate(), m_helpRequested, ossimNotify(), ossimNotifyLevel_INFO, ossimArgumentParser::read(), setUsage(), and ossimApplicationUsage::write().
Referenced by ossimShorelineTool::execute(), ossimVerticesFinderTool::initialize(), ossimRegTool::initialize(), ossimPotraceTool::initialize(), ATP::ossimAtpTool::initialize(), ossimDemTool::initialize(), ossimSubImageTool::initialize(), ossimChipProcTool::initialize(), and ossimToolServer::runCommand().
|
virtual |
Reads processing params from KWL and prepares for execute.
Returns TRUE if successful.
kwl | Full keyword-list representing state |
Reimplemented in ossimChipProcTool, ossimHdf5Tool, ossimSubImageTool, ossimShorelineTool, ossimOrthoTool, ossimSlopeTool, ossimViewshedTool, ossimHlzTool, ossimPotraceTool, ossimBandMergeTool, ossimVerticesFinderTool, and ossimRegTool.
Definition at line 94 of file ossimTool.cpp.
References m_helpRequested, and m_kwl.
|
inlinevirtual |
Overrides base class implementation to indicate this class supports getChip() calls.
Can be done with dynamic cast and pointer test, but not sure how that is supported in SWIG (OLK 11/2015).
Reimplemented in ossimChipProcTool.
Definition at line 123 of file ossimTool.h.
Referenced by ossimToolServer::runCommand().
|
inlinevirtual |
Reads processing params from JSON object provided.
If all good, the object is ready for subsequent call to execute().
Implements ossim::JsonInterface.
Reimplemented in ATP::ossimAtpTool, ossimDemTool, and ossimPointCloudTool.
Definition at line 52 of file ossimTool.h.
Referenced by ossimDemTool::doOMG().
|
private |
Used for reading text files of template and JSON API from disk ONLY.
Definition at line 131 of file ossimTool.cpp.
References ossimFilename::append(), ossimString::chars(), ossimNotify(), and ossimNotifyLevel_WARN.
|
inlinevirtual |
Fetch product as JSON object when applicable Always returns true since using exception on error.
json | Returns non-empty object if valid response available. |
Implements ossim::JsonInterface.
Reimplemented in ATP::ossimAtpTool, ossimDemTool, and ossimPointCloudTool.
Definition at line 59 of file ossimTool.h.
Referenced by ossimDemTool::doOMG().
|
inline |
Redirects any console output to the supplied stream for logging or JNI application.
Definition at line 128 of file ossimTool.h.
Referenced by ossimShorelineTool::execute().
|
protectedvirtual |
Initializes the aurgument parser with expected parameters and options.
It does not output anything. To see the usage, the caller will need to do something like:
ap.getApplicationUsage()->write(<ostream>);
This base class has some common arguments to add. The derived class should call this implementation in addition to setting its own arguments.
Reimplemented in ossimChipProcTool, ossimInfo, ossimShorelineTool, ossimHillshadeTool, ossimHlzTool, ossimHdf5Tool, ossimViewshedTool, ossimSubImageTool, ossimOrthoTool, ossimSlopeTool, ATP::ossimAtpTool, ossimDemTool, ossimPotraceTool, ossimBandMergeTool, ossimVerticesFinderTool, and ossimRegTool.
Definition at line 41 of file ossimTool.cpp.
References ossimApplicationUsage::addCommandLineOption(), ossimInit::addOptions(), ossimArgumentParser::getApplicationName(), ossimArgumentParser::getApplicationUsage(), ossimInit::instance(), and ossimApplicationUsage::setApplicationName().
Referenced by initialize(), ossimVerticesFinderTool::setUsage(), ossimRegTool::setUsage(), ossimPotraceTool::setUsage(), ATP::ossimAtpTool::setUsage(), ossimDemTool::setUsage(), ossimSubImageTool::setUsage(), and ossimChipProcTool::setUsage().
|
protected |
Definition at line 149 of file ossimTool.h.
Referenced by ossimShorelineTool::execute(), and ossimPotraceTool::writeGeoJSON().
|
protected |
Definition at line 150 of file ossimTool.h.
Referenced by ossimVerticesFinderTool::execute(), ossimHlzTool::execute(), ossimShorelineTool::execute(), ossimViewshedTool::execute(), ossimChipProcTool::execute(), ossimBandMergeTool::initialize(), ossimVerticesFinderTool::initialize(), ATP::ossimAtpTool::initialize(), ossimDemTool::initialize(), initialize(), ossimSlopeTool::initialize(), ossimViewshedTool::initialize(), ossimHlzTool::initialize(), ossimSubImageTool::initialize(), ossimHdf5Tool::initialize(), ossimHillshadeTool::initialize(), ossimShorelineTool::initialize(), and ossimChipProcTool::initialize().
|
protected |
Definition at line 148 of file ossimTool.h.
Referenced by ossimChipProcTool::createInputChain(), ossimChipProcTool::createOutputProjection(), ossimInfo::execute(), ossimChipProcTool::finalizeChain(), ossimChipProcTool::findCenterGpt(), ossimChipProcTool::getBandList(), ossimInfo::getGrd2img(), ossimInfo::getImg2grd(), ossimChipProcTool::getProjectionOrigin(), ossimInfo::getUpIsUpAngle(), ossimBandMergeTool::initialize(), ossimVerticesFinderTool::initialize(), ossimPotraceTool::initialize(), ossimViewshedTool::initialize(), ossimSubImageTool::initialize(), ossimHlzTool::initialize(), ossimHillshadeTool::initialize(), ossimHdf5Tool::initialize(), initialize(), ossimShorelineTool::initialize(), ossimChipProcTool::initialize(), ossimViewshedTool::initializeAOI(), ossimChipProcTool::initializeAOI(), ossimChipProcTool::initializeProjectionGsd(), ossimHillshadeTool::initProcessingChain(), ossimSlopeTool::initProcessingChain(), ossimHlzTool::initProcessingChain(), ossimInfo::keyIsTrue(), ossimChipProcTool::loadDemFiles(), ossimHdf5Tool::loadImageFiles(), ossimChipProcTool::loadImageFiles(), ossimChipProcTool::newUtmProjection(), ossimChipProcTool::newWriter(), ossimInfo::openImageHandler(), ossimChipProcTool::ossimChipProcTool(), ossimHillshadeTool::ossimHillshadeTool(), ossimChipProcTool::processRemainingArgs(), and ossimChipProcTool::setReaderProps().
|
protected |
Definition at line 151 of file ossimTool.h.