xmsstamper  1.0
XmStamperIo.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
10 
11 // 3. Standard library headers
12 
13 // 4. External library headers
14 #include <xmscore/stl/vector.h>
16 
17 // 5. Shared code headers
18 
19 //----- Forward declarations ---------------------------------------------------
20 
21 //----- Namespace declaration --------------------------------------------------
22 
23 namespace xms
24 {
25 //----- Constants / Enumerations -----------------------------------------------
26 
27 //----- Structs / Classes ------------------------------------------------------
28 class TrTin;
29 
34 {
35 public:
36  XmStampRaster(const int a_numPixelsX, const int a_numPixelsY, const double a_pixelSizeX,
37  const double a_pixelSizeY, const Pt3d &a_min, const std::vector<double> &a_vals, const int a_noData);
38  XmStampRaster();
40  enum XmRasterFormatEnum {RS_ARCINFO_ASCII};
43  double m_pixelSizeX;
44  double m_pixelSizeY;
46  std::vector<double> m_vals;
47  int m_noData;
49  int GetCellIndexFromColRow(const int a_col, const int a_row) const;
50  void GetColRowFromCellIndex(const int a_index, int & a_col, int & a_row) const;
51  Pt3d GetLocationFromCellIndex(const int a_index) const;
52  void WriteGridFile(const std::string &a_fileName, const XmRasterFormatEnum a_format);
53  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
54  bool ReadFromFile(std::ifstream & a_file);
55 };
56 
61 {
62 public:
63  XmWingWall()
64  : m_wingWallAngle(0)
65  {
66  }
67 
68  double m_wingWallAngle;
69 
70  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
71  bool ReadFromFile(std::ifstream & a_file);
72 };
73 
78 {
79 public:
81  : m_maxX(0)
82  , m_slope()
83  {
84  }
85 
86  double m_maxX;
88 
89  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
90  bool ReadFromFile(std::ifstream & a_file);
91 };
92 
97 {
98 public:
99  XmGuidebank()
100  : m_side(0)
101  , m_radius1(0)
102  , m_radius2(0)
103  , m_width(0)
104  , m_nPts(10)
105  {
106  }
107 
108  int m_side;
109  double m_radius1;
110  double m_radius2;
111  double m_width;
112  int m_nPts;
113 
114  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
115  bool ReadFromFile(std::ifstream & a_file);
116 };
121 {
122 public:
124  : m_type(2)
125  , m_angle(0)
126  {
127  }
128  // TODO: Make this string a string for type?
129  int m_type;
130  double m_angle;
134 
135  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
136  bool ReadFromFile(std::ifstream & a_file);
137 };
138 
143 {
144 public:
146  : m_left()
147  , m_leftMax(0.0)
148  , m_idxLeftShoulder(0)
149  , m_right()
150  , m_rightMax(0.0)
151  , m_idxRightShoulder(0)
152  {
153  }
154 
157  double m_leftMax;
159  VecPt3d m_right;
161  double m_rightMax;
163 
164  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
165  bool ReadFromFile(std::ifstream & a_file);
166 };
167 
172 {
173 public:
176  : m_centerLine()
177  , m_stampingType(0)
178  , m_cs()
179  , m_firstEndCap()
180  , m_lastEndCap()
181  , m_bathymetry()
182  , m_outTin()
183  , m_outBreakLines()
184  {
185  }
186 
193  std::vector<XmStampCrossSection> m_cs;
199  BSHP<TrTin> m_bathymetry;
200 
203  BSHP<TrTin> m_outTin;
208 
209  bool ReadFromFile(std::ifstream &a_file);
210  void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const;
211  void SetPrecisionForOutput(int a_precision);
212 }; // XmStamperIo
213 
214 //----- Function prototypes ----------------------------------------------------
215 
216 } // namespace xms
Abutment definition for feature stamp end cap.
Definition: XmStamperIo.h:77
bool ReadFromFile(std::ifstream &a_file)
Reads the XmStampCrossSection class information to a file.
BSHP< TrTin > m_bathymetry
underlying bathymetry
Definition: XmStamperIo.h:199
int m_numPixelsY
Number of pixels in the Y-direction (Required)
Definition: XmStamperIo.h:42
VecPt3d m_left
left side of the cross section
Definition: XmStamperIo.h:156
int m_idxRightShoulder
index to the shoulder point in the m_right vector
Definition: XmStamperIo.h:162
VecInt2d m_outBreakLines
break lines that are honored in the TIN
Definition: XmStamperIo.h:205
double m_radius2
second radius (R2) for guidebank creation
Definition: XmStamperIo.h:110
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmStamperEndCap class information to a file.
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmWingWall class information to a file.
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmStampCrossSection class information to a file.
Pt3d GetLocationFromCellIndex(const int a_index) const
Gets the location of the cell center from the zero-based cell index.
XmStamperEndCap m_firstEndCap
end cap at beginnig of polyline
Definition: XmStamperIo.h:195
double m_leftMax
max x value for left side
Definition: XmStamperIo.h:157
bool ReadFromFile(std::ifstream &a_file)
Reads the XmStampRaster class information to a file.
void GetColRowFromCellIndex(const int a_index, int &a_col, int &a_row) const
Gets the zero-based column and row from the cell index.
double m_pixelSizeX
Pixel size in the X-direction (Required)
Definition: XmStamperIo.h:43
End cap definition for feature stamp.
Definition: XmStamperIo.h:120
XmStampRaster m_raster
Input/output raster to stamp the resulting elevations onto this raster.
Definition: XmStamperIo.h:207
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmSlopedAbutment class information to a file.
int GetCellIndexFromColRow(const int a_col, const int a_row) const
Gets the zero-based cell index from the given column and row.
int m_numPixelsX
Number of pixels in the X-direction (Required)
Definition: XmStamperIo.h:41
bool ReadFromFile(std::ifstream &a_file)
Reads the XmWingWall class information to a file.
double m_maxX
max distance from center line
Definition: XmStamperIo.h:86
std::vector< VecInt > VecInt2d
XmStamperEndCap m_lastEndCap
end cap at end of polyline
Definition: XmStamperIo.h:197
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmGuidebank class information to a file.
void WriteGridFile(const std::string &a_fileName, const XmRasterFormatEnum a_format)
Writes the raster in the given format to the given filename.
double m_pixelSizeY
Pixel size in the Y-direction (Required)
Definition: XmStamperIo.h:44
bool ReadFromFile(std::ifstream &a_file)
Reads the XmStamperIo class information from a file.
int m_noData
NO DATA value for the raster (typically XM_NODATA)
Definition: XmStamperIo.h:48
int m_side
position of guidebank relative to center line, 0-left, 1-right
Definition: XmStamperIo.h:108
Pt3d m_min
Minimum (lower left) X, Y coordinate of the raster at the center of the raster cell (Required) ...
Definition: XmStamperIo.h:45
XmWingWall m_wingWall
wing wall definition
Definition: XmStamperIo.h:133
XmGuidebank m_guidebank
guidebank definition
Definition: XmStamperIo.h:131
double m_wingWallAngle
degrees from 0 to 60
Definition: XmStamperIo.h:68
std::vector< double > m_vals
Definition: XmStamperIo.h:46
double m_rightMax
max x value for right side
Definition: XmStamperIo.h:161
BSHP< TrTin > m_outTin
Definition: XmStamperIo.h:203
VecPt3d m_right
right side of the cross section
Definition: XmStamperIo.h:160
int m_type
type of end cap: 0- guidebank, 1- sloped abutment, 2- wing wall
Definition: XmStamperIo.h:129
Wing wall definition for feature stamp end cap.
Definition: XmStamperIo.h:60
XmStampRaster()
Default Constructor.
Stamping inputs/outputs class.
Definition: XmStamperIo.h:171
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmStamperIo class information to a file.
void SetPrecisionForOutput(int a_precision)
Sets the precision for stamper output.
int m_nPts
number of points created along the center line to create the guidebank
Definition: XmStamperIo.h:112
void WriteToFile(std::ofstream &a_file, const std::string &a_cardName) const
Writes the XmStampRaster class information to a file.
Cross section definition for stamping.
Definition: XmStamperIo.h:142
XmStamperIo()
Constructor.
Definition: XmStamperIo.h:175
std::vector< XmStampCrossSection > m_cs
cross sections along the polyLine
Definition: XmStamperIo.h:193
double m_angle
degrees from -45 to 45
Definition: XmStamperIo.h:130
Raster defined using a non-rotated cartesian axis for use in XmStamper.
Definition: XmStamperIo.h:33
VecPt3d m_slope
x,y pairs defining slope from center line
Definition: XmStamperIo.h:87
bool ReadFromFile(std::ifstream &a_file)
Reads the XmSlopedAbutment class information to a file.
Guidebank definition for feature stamp end cap.
Definition: XmStamperIo.h:96
bool ReadFromFile(std::ifstream &a_file)
Reads the XmGuidebank class information to a file.
XmRasterFormatEnum
/breif enum the identify the format of the raster
Definition: XmStamperIo.h:40
double m_width
width of guidebank about the center line
Definition: XmStamperIo.h:111
int m_stampingType
Stamping type 0 - Cut, 1 - Fill, 2 - Both.
Definition: XmStamperIo.h:191
XmSlopedAbutment m_slopedAbutment
sloped abutment definition
Definition: XmStamperIo.h:132
bool ReadFromFile(std::ifstream &a_file)
Reads the XmStamperEndCap class information to a file.
std::vector< Pt3d > VecPt3d
double m_radius1
first radius (R1) for guidebank creation
Definition: XmStamperIo.h:109
VecPt3d m_centerLine
Definition: XmStamperIo.h:189