OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfAimidbTag.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description: AIMIDB - Additional Image ID Extension Format tag class
10 // definition.
11 //
12 // See document STDI-0002 (version 3), Appendix E, Table E-3 for more info.
13 //
14 //----------------------------------------------------------------------------
15 // $Id
16 
17 #include <cstring>
18 #include <istream>
19 #include <iostream>
20 #include <iomanip>
21 
23 
24 
26 
28  : ossimNitfRegisteredTag(std::string("AIMIDB"), CEL_SIZE)
29 {
30  clearFields();
31 }
32 
34 {
35 }
36 
38 {
39  clearFields();
40 
44  in.read(theFlightNo, FLIGHT_NO_SIZE);
45  in.read(theOpNum, OP_NUM_SIZE);
47  in.read(theReproNum, REPRO_NUM_SIZE);
48  in.read(theReplay, REPLAY_SIZE);
49  in.read(theReserved1, RESERVED_1_SIZE);
54  in.read(theTileRow, END_TILE_ROW_SIZE);
55  in.read(theCountry, COUNTRY_SIZE);
56  in.read(theReserved2, RESERVED_2_SIZE);
57  in.read(theLocation, LOCATION_SIZE);
58  in.read(theReserved3, RESERVED_3_SIZE);
59 }
60 
62 {
66  out.write(theFlightNo, FLIGHT_NO_SIZE);
67  out.write(theOpNum, OP_NUM_SIZE);
69  out.write(theReproNum, REPRO_NUM_SIZE);
70  out.write(theReplay, REPLAY_SIZE);
71  out.write(theReserved1, RESERVED_1_SIZE);
74  out.write(theEndSegment, END_SEGMENT_SIZE);
76  out.write(theTileRow, END_TILE_ROW_SIZE);
77  out.write(theCountry, COUNTRY_SIZE);
78  out.write(theReserved2, RESERVED_2_SIZE);
79  out.write(theLocation, LOCATION_SIZE);
80  out.write(theReserved3, RESERVED_3_SIZE);
81 }
82 
84 {
85  // BCS-N's to '0's, BCS-A's to ' '(spaces)
86 
87  // clear
89  memset(theMissionNumber, ' ', MISSION_NO_SIZE);
91  memset(theFlightNo, ' ', FLIGHT_NO_SIZE);
92  memset(theOpNum, ' ', OP_NUM_SIZE);
94  memset(theReproNum, ' ', REPRO_NUM_SIZE);
95  memset(theReplay, ' ', REPLAY_SIZE);
96  memset(theReserved1, ' ', RESERVED_1_SIZE);
99  memset(theEndSegment, ' ', END_SEGMENT_SIZE);
100  memset(theTileColumn, ' ', END_TILE_COLUMN_SIZE);
101  memset(theTileRow, ' ', END_TILE_ROW_SIZE);
102  memset(theCountry, ' ', COUNTRY_SIZE);
103  memset(theReserved2, ' ', RESERVED_2_SIZE);
104  memset(theLocation, ' ', LOCATION_SIZE);
105  memset(theReserved3, ' ', RESERVED_3_SIZE);
106 
107  // null terminate
111  theFlightNo[FLIGHT_NO_SIZE] = '\0';
112  theOpNum[OP_NUM_SIZE] = '\0';
114  theReproNum[REPRO_NUM_SIZE] = '\0';
115  theReplay[REPLAY_SIZE] = '\0';
122  theCountry[COUNTRY_SIZE] = '\0';
124  theLocation[LOCATION_SIZE] = '\0';
126 }
127 
129  std::ostream& out, const std::string& prefix) const
130 {
131  std::string pfx = prefix;
132  pfx += getTagName();
133  pfx += ".";
134 
135  out << setiosflags(std::ios::left)
136  << pfx << std::setw(24) << "CETAG:"
137  << getTagName() << "\n"
138  << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
139  << pfx << std::setw(24) << "ACQUISITION_DATE:"
140  << theAcquisitionDate << "\n"
141  << pfx << std::setw(24) << "MISSION_NO:"
142  << theMissionNumber << "\n"
143  << pfx << std::setw(24) << "MISSION_IDENTIFICATION:"
144  << theMissionIdentification<< "\n"
145  << pfx << std::setw(24) << "FLIGHT_NO:"
146  << theFlightNo << "\n"
147  << pfx << std::setw(24) << "OP_NUM:"
148  << theOpNum << "\n"
149  << pfx << std::setw(24) << "CURRENT_SEGMENT:"
150  << theCurrentSegment << "\n"
151  << pfx << std::setw(24) << "REPRO_NUM:"
152  << theReproNum<< "\n"
153  << pfx << std::setw(24) << "REPLAY:"
154  << theReplay<< "\n"
155  << pfx << std::setw(24) << "START_TILE_COLUMN:"
156  << theStartTileColumn << "\n"
157  << pfx << std::setw(24) << "START_TILE_ROW:"
158  << theStartTileRow << "\n"
159  << pfx << std::setw(24) << "END_SEGMENT:"
160  << theEndSegment << "\n"
161  << pfx << std::setw(24) << "END_TILE_COLUMN:"
162  << theTileColumn << "\n"
163  << pfx << std::setw(24) << "END_TILE_ROW:"
164  << theTileRow << "\n"
165  << pfx << std::setw(24) << "COUNTRY:"
166  << theCountry << "\n"
167  << pfx << std::setw(24) << "LOCATION:"
168  << theLocation << "\n";
169 
170  return out;
171 }
virtual const std::string & getTagName() const
This will return the name of the registered tag for this user defined header.
char theLocation[LOCATION_SIZE+1]
FIELD: LOCATION.
virtual void clearFields()
Method to clear all fields including null terminating.
char theReserved3[RESERVED_3_SIZE+1]
FIELD: RESERVED_3.
virtual ~ossimNitfAimidbTag()
destructor
ossimNitfAimidbTag()
default constructor
char theReplay[REPLAY_SIZE+1]
FIELD: REPLAY.
char theReserved2[RESERVED_2_SIZE+1]
FIELD: RESERVED_2.
virtual ossim_uint32 getTagLength() const
Returns the length in bytes of the tag from the CEL or REL field.
virtual void writeStream(ossim::ostream &out)
Method to write data to stream.
char theEndSegment[END_SEGMENT_SIZE+1]
FIELD: END_SEGMENT.
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Print method that outputs a key/value type format adding prefix to keys.
char theCountry[COUNTRY_SIZE+1]
FIELD: COUNTRY.
char theMissionNumber[MISSION_NO_SIZE+1]
FIELD: MISSION_NO.
char theReserved1[RESERVED_1_SIZE+1]
FIELD: RESERVED_1.
char theOpNum[OP_NUM_SIZE+1]
FIELD: OP_NUM.
char theCurrentSegment[CURRENT_SEGMENT_SIZE+1]
FIELD: CURRENT_SEGMENT.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
char theStartTileColumn[START_TILE_COLUMN_SIZE+1]
FIELD: START_TILE_COLUMN.
char theAcquisitionDate[ACQUISITION_DATE_SIZE+1]
Type R = Required Type <R> = BCS spaces allowed for entire field.
char theMissionIdentification[MISSION_IDENTIFICATION_SIZE+1]
FIELD: MISSION_IDENTIFICATION.
virtual void parseStream(ossim::istream &in)
Method to parse data from stream.
char theFlightNo[FLIGHT_NO_SIZE+1]
FIELD: FLIGHT_NO.
char theTileColumn[END_TILE_COLUMN_SIZE+1]
FIELD: END_TILE_COLUMN.
RTTI_DEF1(ossimNitfAimidbTag, "ossimNitfAimidbTag", ossimNitfRegisteredTag)
char theReproNum[REPRO_NUM_SIZE+1]
FIELD: REPRO_NUM.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
char theStartTileRow[START_TILE_ROW_SIZE+1]
FIELD: START_TILE_ROW.
char theTileRow[END_TILE_ROW_SIZE+1]
FIELD: END_TILE_ROW.