|
xmsstamper
1.0
|
Raster defined using a non-rotated cartesian axis for use in XmStamper. More...
#include <XmStamperIo.h>
Public Types | |
| enum | XmRasterFormatEnum { RS_ARCINFO_ASCII } |
| /breif enum the identify the format of the raster | |
Public Member Functions | |
| XmStampRaster (const int a_numPixelsX, const int a_numPixelsY, const double a_pixelSizeX, const double a_pixelSizeY, const Pt3d &a_min, const std::vector< double > &a_vals, const int a_noData) | |
| Constructor that sets all the raster values. More... | |
| XmStampRaster () | |
| Default Constructor. | |
| int | GetCellIndexFromColRow (const int a_col, const int a_row) const |
| Gets the zero-based cell index from the given column and row. More... | |
| void | GetColRowFromCellIndex (const int a_index, int &a_col, int &a_row) const |
| Gets the zero-based column and row from the cell index. More... | |
| Pt3d | GetLocationFromCellIndex (const int a_index) const |
| Gets the location of the cell center from the zero-based cell index. More... | |
| void | WriteGridFile (const std::string &a_fileName, const XmRasterFormatEnum a_format) |
| Writes the raster in the given format to the given filename. More... | |
| void | WriteToFile (std::ofstream &a_file, const std::string &a_cardName) const |
| Writes the XmStampRaster class information to a file. More... | |
| bool | ReadFromFile (std::ifstream &a_file) |
| Reads the XmStampRaster class information to a file. More... | |
Public Attributes | |
| int | m_numPixelsX |
| Number of pixels in the X-direction (Required) | |
| int | m_numPixelsY |
| Number of pixels in the Y-direction (Required) | |
| double | m_pixelSizeX |
| Pixel size in the X-direction (Required) | |
| double | m_pixelSizeY |
| Pixel size in the Y-direction (Required) | |
| Pt3d | m_min |
| Minimum (lower left) X, Y coordinate of the raster at the center of the raster cell (Required) | |
| std::vector< double > | m_vals |
| int | m_noData |
| NO DATA value for the raster (typically XM_NODATA) | |
Raster defined using a non-rotated cartesian axis for use in XmStamper.
Definition at line 33 of file XmStamperIo.h.
| xms::XmStampRaster::XmStampRaster | ( | const int | a_numPixelsX, |
| const int | a_numPixelsY, | ||
| const double | a_pixelSizeX, | ||
| const double | a_pixelSizeY, | ||
| const Pt3d & | a_min, | ||
| const std::vector< double > & | a_vals, | ||
| const int | a_noData | ||
| ) |
Constructor that sets all the raster values.
| [in] | a_numPixelsX | number of pixels in x direction |
| [in] | a_numPixelsY | number of pixels in y direction |
| [in] | a_pixelSizeX | size of the pixels in the x direction |
| [in] | a_pixelSizeY | size of the pixels in the y direction |
| [in] | a_min | The bottom left corner (x,y) of the raster |
| [in] | a_vals | The raster values |
| [in] | a_noData | The "no data" (or inactive) value to identify raster pixels where no value exists. |
Definition at line 268 of file XmStamperIo.cpp.
| int xms::XmStampRaster::GetCellIndexFromColRow | ( | const int | a_col, |
| const int | a_row | ||
| ) | const |
Gets the zero-based cell index from the given column and row.
| [in] | a_col | The zero-based column index for the raster. |
| [in] | a_row | The zero-based row index for the raster. |
Definition at line 298 of file XmStamperIo.cpp.
References m_numPixelsX, and m_numPixelsY.
Referenced by XmStampIntermediateTests::test_BuildRasterAndGetCellValue().
| void xms::XmStampRaster::GetColRowFromCellIndex | ( | const int | a_index, |
| int & | a_col, | ||
| int & | a_row | ||
| ) | const |
Gets the zero-based column and row from the cell index.
| [in] | a_index | The zero-based raster cell index. |
| [out] | a_col | The zero-based column index for the raster. |
| [out] | a_row | The zero-based row index for the raster. |
Definition at line 312 of file XmStamperIo.cpp.
References m_numPixelsX, and m_numPixelsY.
Referenced by GetLocationFromCellIndex().
| Pt3d xms::XmStampRaster::GetLocationFromCellIndex | ( | const int | a_index | ) | const |
Gets the location of the cell center from the zero-based cell index.
| [in] | a_index | The zero-based raster cell index. |
Definition at line 326 of file XmStamperIo.cpp.
References GetColRowFromCellIndex(), m_min, m_numPixelsY, m_pixelSizeX, m_pixelSizeY, xms::Pt3< T >::x, and xms::Pt3< T >::y.
| bool xms::XmStampRaster::ReadFromFile | ( | std::ifstream & | a_file | ) |
Reads the XmStampRaster class information to a file.
| [in] | a_file | The input file. |
Definition at line 393 of file XmStamperIo.cpp.
References m_min, m_noData, m_numPixelsX, m_numPixelsY, m_pixelSizeX, m_pixelSizeY, m_vals, stEqualNoCase(), xms::Pt3< T >::x, XM_ENSURE_TRUE, and xms::Pt3< T >::y.
Referenced by xms::XmStamperIo::ReadFromFile(), and TutStampingUnitTests::test_RealDataStamping().
| void xms::XmStampRaster::WriteGridFile | ( | const std::string & | a_fileName, |
| const XmRasterFormatEnum | a_format | ||
| ) |
Writes the raster in the given format to the given filename.
| [in] | a_fileName | The output raster filename. |
| [in] | a_format | The output raster format. |
Definition at line 344 of file XmStamperIo.cpp.
References m_min, m_noData, m_numPixelsX, m_numPixelsY, m_pixelSizeX, m_pixelSizeY, m_vals, xms::Pt3< T >::x, XM_ENSURE_TRUE, and xms::Pt3< T >::y.
Referenced by TutStampingUnitTests::test_RealDataStamping(), TutStampingUnitTests::test_StampCutEmbankment(), TutStampingUnitTests::test_StampFillEmbankment(), TutStampingUnitTests::test_StampGuidebank(), TutStampingUnitTests::test_StampIntersectBathymetry(), TutStampingUnitTests::test_StampSlopedAbutment(), and TutStampingUnitTests::test_StampWingWall().
| void xms::XmStampRaster::WriteToFile | ( | std::ofstream & | a_file, |
| const std::string & | a_cardName | ||
| ) | const |
Writes the XmStampRaster class information to a file.
| [in] | a_file | The output file. |
| [in] | a_cardName | The card name to be written to the output file. |
Definition at line 375 of file XmStamperIo.cpp.
References m_min, m_noData, m_numPixelsX, m_numPixelsY, m_pixelSizeX, m_pixelSizeY, m_vals, xms::Pt3< T >::x, XM_ENSURE_TRUE, and xms::Pt3< T >::y.
Referenced by xms::XmStamperIo::WriteToFile().
| std::vector<double> xms::XmStampRaster::m_vals |
Raster values defined from the top left corner to the bottom right corner (Required) Use the m_noData value to specify a cell value with no data.
Definition at line 46 of file XmStamperIo.h.
Referenced by xms::XmStamperImpl::DoStamp(), ReadFromFile(), XmStampIntermediateTests::test_BuildRasterAndGetCellValue(), WriteGridFile(), and WriteToFile().