forked from ngageoint/csm
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from jlaura/master
Updates from upstream
- Loading branch information
Showing
11 changed files
with
500 additions
and
6 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
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,79 @@ | ||
//############################################################################# | ||
// | ||
// FILENAME: MultiNitfIsd.cpp | ||
// | ||
// CLASSIFICATION: Unclassified | ||
// | ||
// DESCRIPTION: | ||
// | ||
// This file contains the implementations for the functions defined in CSM. | ||
// | ||
// LIMITATIONS: None | ||
// | ||
// SOFTWARE HISTORY: | ||
// Date Author Comment | ||
// ----------- ------ ------- | ||
// 28-NOV-2018 JPK Initial Version. | ||
// 29-NOV-2018 SCM Cleanup formatting and added include of Error.h. | ||
// | ||
// NOTES: | ||
// | ||
//############################################################################# | ||
|
||
#ifndef CSM_LIBRARY | ||
#define CSM_LIBRARY | ||
#endif | ||
|
||
#include "MultiNitfIsd.h" | ||
#include "Error.h" | ||
|
||
namespace csm | ||
{ | ||
|
||
//***************************************************************************** | ||
// MultiNitfIsd::MultiNitfIsd | ||
//***************************************************************************** | ||
MultiNitfIsd::MultiNitfIsd(const std::vector<csm::NitfIsd>& isdList) | ||
: | ||
Isd("MULTINITF", ""), | ||
theISDs(isdList) | ||
{ | ||
} | ||
|
||
//***************************************************************************** | ||
// MultiNitfIsd::addIsd | ||
//***************************************************************************** | ||
void MultiNitfIsd::addIsd(const csm::NitfIsd &isd) | ||
{ | ||
theISDs.push_back(isd); | ||
} | ||
|
||
//***************************************************************************** | ||
// MultiNitfIsd::isdList | ||
//***************************************************************************** | ||
const std::vector<csm::NitfIsd>& MultiNitfIsd::isdList() const | ||
{ | ||
return theISDs; | ||
} | ||
|
||
//***************************************************************************** | ||
// MultiNitfIsd::isdList | ||
//***************************************************************************** | ||
std::vector<csm::NitfIsd>& MultiNitfIsd::isdList() | ||
{ | ||
return theISDs; | ||
} | ||
|
||
//***************************************************************************** | ||
// MultiNitfIsd::isd | ||
//***************************************************************************** | ||
const csm::NitfIsd& MultiNitfIsd::isd(std::size_t index) const | ||
{ | ||
if (index < theISDs.size()) return theISDs[index]; | ||
|
||
throw Error(Error::INDEX_OUT_OF_RANGE, | ||
"ISD Index is out of range.", | ||
"csm::MultiNitfIsd::isd"); | ||
} | ||
|
||
} //namespace csm |
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,88 @@ | ||
//############################################################################# | ||
// | ||
// FILENAME: MultiNitfIsd.h | ||
// | ||
// CLASSIFICATION: Unclassified | ||
// | ||
// DESCRIPTION: | ||
// | ||
// Header for the MultiNitfIsd base class. MultiNitfIsd is encapsulated in a | ||
// C++ class for transfer through the CSM (Plugin) interface. MultiNitfIsd | ||
// holds a vector of csm::NitfIsds | ||
// | ||
// LIMITATIONS: None | ||
// | ||
// SOFTWARE HISTORY: | ||
// | ||
// Date Author Comment | ||
// ----------- ------ ------- | ||
// 28-NOV-2018 JPK Initial Version. | ||
// 29-NOV-2018 SCM Cleanup formatting. Use std::size_t for size. | ||
// | ||
// NOTES: | ||
// | ||
//############################################################################# | ||
|
||
#ifndef __CSM_MULTINITFISD_H | ||
#define __CSM_MULTINITFISD_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "csm.h" | ||
#include "NitfIsd.h" | ||
|
||
namespace csm | ||
{ | ||
|
||
class CSM_EXPORT_API MultiNitfIsd : public Isd | ||
{ | ||
public: | ||
MultiNitfIsd() : Isd("MULTINITF", ""), theISDs() {} | ||
//> This constructor makes an empty image support data list. | ||
//< | ||
|
||
explicit MultiNitfIsd(const std::vector<csm::NitfIsd>& isdList); | ||
//> This constructor stores one or more image support data objects. | ||
//< | ||
|
||
const std::string& format() const { return theFormat; } | ||
//> This method returns the format of the image support data (MULTINITF). | ||
//< | ||
|
||
void addIsd(const csm::NitfIsd& isd); | ||
//> This method adds a csm::NitfIsd to the MultiNitfIsd. | ||
//< | ||
|
||
const std::vector<csm::NitfIsd>& isdList() const; | ||
//> This method allows const retrieval of the entire | ||
// vector of available csm::NitfIsd objects. | ||
//< | ||
|
||
std::vector<csm::NitfIsd>& isdList(); | ||
//> This method allows non-const retrieval of the | ||
// vector of available csm::NitfIsd objects, allowing the | ||
// vector to be modified (added to / deleted from). | ||
//< | ||
|
||
void clearAllIsds() { theISDs.clear(); } | ||
//> This method removes all the ISDs added to the vector. | ||
//< | ||
|
||
std::size_t numberOfIsds() const {return theISDs.size();} | ||
//> This method returns the number of available ISDs owned | ||
// by this class. | ||
//< | ||
|
||
const csm::NitfIsd& isd(std::size_t index) const; | ||
//> This method returns the csm::NitfIsd at the specified | ||
// index. | ||
//< | ||
|
||
protected: | ||
std::vector<csm::NitfIsd> theISDs; | ||
}; | ||
|
||
} // namespace csm | ||
|
||
#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
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
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,65 @@ | ||
#!/bin/sh | ||
eval 'exec perl -x $0 ${1+"$@"}' | ||
if 0; # [Construct to start `perl' when we do not know where it is.] | ||
#!perl | ||
############################################################################### | ||
# FILE: mscc | ||
# | ||
# CLASSIFICATION: Unclassified | ||
# | ||
# DESCRIPTION: This is a wrapper script that mutates a Unix | ||
# compile command into the MS Studio equivalent | ||
# | ||
# LIMITATIONS: Requires Cgywin's "cygpath" application to convert paths | ||
# | ||
############################################################################### | ||
|
||
my $debug = 0; | ||
|
||
# *** | ||
# Convert optimization argument to mscc expected format | ||
# Convert paths to Windows format | ||
# *** | ||
my $compile_debug = grep(/^-g$/, @ARGV); | ||
|
||
my @compile_args = (); | ||
foreach (@ARGV) | ||
{ | ||
if ($compile_debug) | ||
{ | ||
s/^\-O[0-9]/\/Od/; | ||
} | ||
else | ||
{ | ||
s/^\-O/\/O/; | ||
} | ||
|
||
if (/^\-I(.+)/) | ||
{ | ||
chomp(my $winPath = `cygpath -w "$1"`); | ||
$_ = "\/I$winPath"; | ||
} | ||
if (/^\-Fo(.+)/) | ||
{ | ||
chomp(my $winPath = `cygpath -w "$1"`); | ||
$_ = "-Fo$winPath"; | ||
} | ||
|
||
if ($_ eq "-g") | ||
{ | ||
push @compile_args, '/Yd'; | ||
push @compile_args, '/Z7'; | ||
$_ = ''; | ||
} | ||
|
||
push @compile_args, $_ if ($_); | ||
} | ||
|
||
# Build the compile command | ||
$compile="cl.exe"; | ||
|
||
warn ">>> compile_args are {" . join(', ', @compile_args) . "}\n" if ($debug); | ||
|
||
# Execute the compile command | ||
print "$compile " . join(' ', @compile_args) . "\n"; | ||
exec $compile, @compile_args or die "Could not exec: $!\n"; |
Oops, something went wrong.