OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfCsccgaTag.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 // Description: CSCCGA tag source file
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
12 #include <iomanip>
13 #include <iostream>
14 
16  : ossimNitfRegisteredTag(std::string("CSCCGA"), CEL_SIZE)
17 {
18  clearFields();
19 }
20 
22 {
23  in.read(m_ccgSource, CCG_SOURCE_SIZE);
24  in.read(m_regSensor, REG_SENSOR_SIZE);
31 }
32 
34 {
35  out.write(m_ccgSource, CCG_SOURCE_SIZE);
36  out.write(m_regSensor, REG_SENSOR_SIZE);
37  out.write(m_originLine, ORIGIN_LINE_SIZE);
39  out.write(m_asCellSize, AS_CELL_SIZE_SIZE);
40  out.write(m_csCellSize, CS_CELL_SIZE_SIZE);
41  out.write(m_ccgMaxLine, CCG_MAX_LINE_SIZE);
43 }
44 
46  const std::string& prefix) const
47 {
48  std::string pfx = prefix;
49  pfx += getTagName();
50  pfx += ".";
51  out << setiosflags(ios::left)
52  << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
53  << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
54  << pfx << std::setw(24) << "CCG_SOURCE:" << m_ccgSource << "\n"
55  << pfx << std::setw(24) << "CCG_SOURCE:" << m_regSensor << "\n"
56  << pfx << std::setw(24) << "ORIGIN_LINE:" << m_originLine << "\n"
57  << pfx << std::setw(24) << "ORIGIN_SAMPLE:" << m_originSample << "\n"
58  << pfx << std::setw(24) << "AS_CELL_SIZE:" << m_asCellSize << "\n"
59  << pfx << std::setw(24) << "CS_CELL_SIZE:" << m_csCellSize << "\n"
60  << pfx << std::setw(24) << "CCG_MAX_LINE:" << m_ccgMaxLine << "\n"
61  << pfx << std::setw(24) << "CCG_MAX_SAMPLE:" << m_ccgMaxSample << "\n";
62 
63 
64  return out;
65 }
66 
68 {
69  memset(m_ccgSource,' ', CCG_SOURCE_SIZE);
70  memset(m_regSensor, ' ', REG_SENSOR_SIZE);
71  memset(m_originLine, 0, ORIGIN_LINE_SIZE);
73  memset(m_asCellSize, 0, AS_CELL_SIZE_SIZE);
74  memset(m_csCellSize, 0, CS_CELL_SIZE_SIZE);
75  memset(m_ccgMaxLine, 0, CCG_MAX_LINE_SIZE);
77 
86 }
virtual const std::string & getTagName() const
This will return the name of the registered tag for this user defined header.
char m_originLine[ORIGIN_LINE_SIZE+1]
Field: ORIGIN_LINE.
char m_ccgMaxSample[CCG_MAX_SAMPLE_SIZE+1]
Field: CCG_MAX_SAMPLE.
char m_regSensor[REG_SENSOR_SIZE+1]
Field: REG_SENSOR
virtual ossim_uint32 getTagLength() const
Returns the length in bytes of the tag from the CEL or REL field.
virtual void clearFields()
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Pure virtual print method that outputs a key/value type format adding prefix to keys.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
virtual void writeStream(ossim::ostream &out)
char m_asCellSize[AS_CELL_SIZE_SIZE+1]
Field: AS_CELL_SIZE.
char m_originSample[ORIGIN_SAMPLE_SIZE+1]
Field: ORIGIN_SAMPLE.
char m_csCellSize[CS_CELL_SIZE_SIZE+1]
Field: CS_CELL_SIZE.
virtual void parseStream(ossim::istream &in)
This will allow the user defined data to parse the stream.
char m_ccgMaxLine[CCG_MAX_LINE_SIZE+1]
Field: CCG_MAX_LINE.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
char m_ccgSource[CCG_SOURCE_SIZE+1]
Field: CCG_SOURCE.