-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial topds4 app and cmake updates to include inja (#4207)
* Removed compile and deprication warnings. Fixes #4110 * temp add of to pds 4 test * Inintal topds4 app and cmake updates to include inja * Delete extra headers * Fixed inja include Co-authored-by: ssides <[email protected]>
- Loading branch information
Showing
6 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# CMake module for find_package(Inja) | ||
# Finds include directory and all applicable libraries | ||
# | ||
# Sets the following: | ||
# INJA_INCLUDE_DIR | ||
# INJA_LIBRARY | ||
|
||
find_path(INJA_INCLUDE_DIR | ||
NAME inja.hpp | ||
PATH_SUFFIXES "inja" | ||
) | ||
|
||
message(STATUS "INJA INCLUDE DIR: " ${INJA_INCLUDE_DIR} ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "Isis.h" | ||
|
||
#include "topds4.h" | ||
|
||
using namespace std; | ||
using namespace Isis; | ||
|
||
void IsisMain() { | ||
UserInterface &ui = Application::GetUserInterface(); | ||
PvlGroup results = topds4(ui); | ||
Application::Log(results); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <iostream> | ||
|
||
#include <inja.hpp> | ||
|
||
#include "topds4.h" | ||
|
||
using namespace std; | ||
using namespace inja; | ||
using json = nlohmann::json; | ||
|
||
|
||
namespace Isis { | ||
|
||
|
||
|
||
PvlGroup topds4(UserInterface &ui) { | ||
Cube *icube = new Cube(); | ||
icube->open(ui.GetFileName("FROM")); | ||
return topds4(icube, ui); | ||
} | ||
|
||
|
||
PvlGroup topds4(Cube *cube, UserInterface &ui) { | ||
Process p; | ||
p.SetInputCube(cube); | ||
|
||
Pvl &label = *cube->label(); | ||
|
||
|
||
|
||
json data; | ||
data["name"] = "world"; | ||
render("Hello {{ name }}!", data); // Returns std::string "Hello world!" | ||
render_to(std::cout, "Hello {{ name }}!", data); // Writes "Hello world!" to stream | ||
|
||
|
||
|
||
|
||
std::cout << label << std::endl; | ||
return label.findGroup("Dimensions", Pvl::Traverse); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef topds4_h | ||
#define topds4_h | ||
|
||
#include "Cube.h" | ||
#include "Pvl.h" | ||
#include "Process.h" | ||
#include "SpecialPixel.h" | ||
#include "LineManager.h" | ||
#include "FileName.h" | ||
#include "IException.h" | ||
#include "UserInterface.h" | ||
|
||
namespace Isis { | ||
extern PvlGroup topds4(Cube* cube, UserInterface &ui); | ||
extern PvlGroup topds4(UserInterface &ui); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<application name="topds4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd"> | ||
<brief> | ||
dummy | ||
</brief> | ||
|
||
<description> | ||
dummy | ||
</description> | ||
|
||
<category> | ||
<categoryItem>Trim and Mask</categoryItem> | ||
</category> | ||
|
||
<history> | ||
<change name="Jeffrey Covington" date="2015-01-15"> | ||
Removed unreachable code. | ||
</change> | ||
</history> | ||
|
||
<groups> | ||
<group name="Files"> | ||
<parameter name="FROM"> | ||
<type>cube</type> | ||
<fileMode>input</fileMode> | ||
<brief> | ||
Input cube | ||
</brief> | ||
<description> | ||
This is the input cube that will be cropped. | ||
</description> | ||
<filter> | ||
*.cub | ||
</filter> | ||
</parameter> | ||
|
||
<parameter name="TEMPLATE"> | ||
<fileMode>input</fileMode> | ||
<brief> | ||
Input template | ||
</brief> | ||
<description> | ||
Input template | ||
</description> | ||
<filter> | ||
* | ||
</filter> | ||
</parameter> | ||
|
||
<parameter name="TO"> | ||
<type>file</type> | ||
<fileMode>output</fileMode> | ||
<brief> | ||
Output PDS4 label | ||
</brief> | ||
<description> | ||
The. | ||
</description> | ||
</parameter> | ||
</group> | ||
</groups> | ||
</application> |