OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfSymbolHeaderV2_0.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See top level LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 // Description: Nitf support class
9 //
10 //********************************************************************
11 // $Id: ossimNitfSymbolHeaderV2_0.cpp 9094 2006-06-13 19:12:40Z dburken $
13 #include <ossim/base/ossimString.h>
14 #include <ossim/base/ossimDrect.h>
15 #include <cstring> // for memset
16 #include <istream>
17 
18 RTTI_DEF1(ossimNitfSymbolHeaderV2_0, "ossimNitfSymbolHeaderV2_0", ossimNitfSymbolHeader)
19 
21 {
22  clearFields();
23 }
24 
26 {
27  if(in)
28  {
29  clearFields();
30 
31  in.read(theFilePartType, 2);
32  in.read(theSymbolId, 10);
33  in.read(theSymbolName, 20);
34  in.read(theSymbolSecurityClass, 1);
35  in.read(theSymbolCodewords, 40);
36  in.read(theSymbolControlAndHandling, 40);
37  in.read(theSymbolReleasingInstructions, 40);
39  in.read(theSymbolSecurityControlNum, 20);
40  in.read(theSymbolSecurityDowngrade, 6);
42  {
43  in.read(theSymbolDowngradingEvent, 40);
44  }
45  in.read(theSymbolEncryption, 1);
46  in.read(theSymbolType, 1);
47  in.read(theNumberLinesPerSymbol, 4);
48  in.read(theSymbolNumberPixelsPerLine, 4);
49  in.read(theSymbolLineWidth, 4);
50  in.read(theSymbolNumberBitsPerPixel, 1);
51  in.read(theSymbolDisplayLevel, 3);
52  in.read(theSymbolAttachmentLevel, 3);
53  in.read(theSymbolLocation, 10);
54  in.read(theSecondSymbolLocation, 10);
55  in.read(theSymbolColor, 1);
56  in.read(theSymbolNumber, 6);
57  in.read(theSymbolRotation, 3);
58  in.read(theSymbolNumberOfLutEntries, 3);
59 
60  // do lut here. we will temporarily ignore
61  in.ignore(ossimString(theSymbolNumberOfLutEntries).toLong());
62 
64  in.read(theSymbolSubheaderOverflow, 3);
65 
66  }
67 }
68 
70 {
71 
72  out << "theFilePartType: " << theFilePartType << std::endl
73  << "theSymbolId: " << theSymbolId << std::endl
74  << "theSymbolName: " << theSymbolName << std::endl
75  << "theSymbolSecurityClass: " << theSymbolSecurityClass << std::endl
76  << "theSymbolCodewords: " << theSymbolCodewords << std::endl
77  << "theSymbolControlAndHandling: " << theSymbolControlAndHandling << std::endl
78  << "theSymbolReleasingInstructions: " << theSymbolReleasingInstructions << std::endl
79  << "theSymbolClassificationAuthority: " << theSymbolClassificationAuthority << std::endl
80  << "theSymbolSecurityControlNum: " << theSymbolSecurityControlNum << std::endl
81  << "theSymbolSecurityDowngrade: " << theSymbolSecurityDowngrade << std::endl
82  << "theSymbolDowngradingEvent: " << theSymbolDowngradingEvent << std::endl
83  << "theSymbolEncryption: " << theSymbolEncryption << std::endl
84  << "theSymbolType: " << theSymbolType << std::endl
85  << "theNumberLinesPerSymbol: " << theNumberLinesPerSymbol << std::endl
86  << "theSymbolNumberPixelsPerLine: " << theSymbolNumberPixelsPerLine << std::endl
87  << "theSymbolLineWidth: " << theSymbolLineWidth << std::endl
88  << "theSymbolNumberBitsPerPixel: " << theSymbolNumberBitsPerPixel << std::endl
89  << "theSymbolDisplayLevel: " << theSymbolDisplayLevel << std::endl
90  << "theSymbolAttachmentLevel: " << theSymbolAttachmentLevel << std::endl
91  << "theSymbolLocation: " << theSymbolLocation << std::endl
92  << "theSecondSymbolLocation: " << theSecondSymbolLocation << std::endl
93  << "theSymbolColor: " << theSymbolColor << std::endl
94  << "theSymbolNumber: " << theSymbolNumber << std::endl
95  << "theSymbolRotation: " << theSymbolRotation << std::endl
96  << "theSymbolNumberOfLutEntries: " << theSymbolNumberOfLutEntries << std::endl
97  << "theSymbolExtendedSubheaderDataLength: " << theSymbolExtendedSubheaderDataLength << std::endl
98  << "theSymbolSubheaderOverflow: " << theSymbolSubheaderOverflow << std::endl;
99  return out;
100 }
101 
103 {
105 }
106 
108 {
109  // for now we will return an empty rect. This will be more
110  // complicated to compute a symbol bound. The origin depends
111  // on the symbol and is different for different symbols.
112  // We will implement this one last.
113  return ossimDrect(0,0,0,0);
114 }
115 
116 
118 {
119  memset(theFilePartType, ' ', 2);
120  memset(theSymbolId, ' ', 10);
121  memset(theSymbolName, ' ', 20);
122  memset(theSymbolSecurityClass, ' ', 1);
123  memset(theSymbolCodewords, ' ', 40);
124  memset(theSymbolControlAndHandling, ' ', 40);
125  memset(theSymbolReleasingInstructions, ' ', 40);
126  memset(theSymbolClassificationAuthority, ' ', 20);
127  memset(theSymbolSecurityControlNum, ' ', 20);
128  memset(theSymbolSecurityDowngrade, ' ', 6);
129  memset(theSymbolDowngradingEvent, ' ', 40);
130  memset(theSymbolEncryption, ' ', 1);
131  memset(theSymbolType, ' ', 1);
132  memset(theNumberLinesPerSymbol, ' ', 4);
133  memset(theSymbolNumberPixelsPerLine, ' ', 4);
134  memset(theSymbolLineWidth, ' ', 4);
135  memset(theSymbolNumberBitsPerPixel, ' ', 1);
136  memset(theSymbolDisplayLevel, ' ', 3);
137  memset(theSymbolAttachmentLevel, ' ', 3);
138  memset(theSymbolLocation, ' ', 10);
139  memset(theSecondSymbolLocation, ' ', 10);
140  memset(theSymbolColor, ' ', 1);
141  memset(theSymbolNumber, ' ', 6);
142  memset(theSymbolRotation, ' ', 3);
143  memset(theSymbolNumberOfLutEntries, ' ', 3);
144  memset(theSymbolExtendedSubheaderDataLength, ' ', 5);
145  memset(theSymbolSubheaderOverflow, ' ', 3);
146 
147 
148  theFilePartType[2] = '\0';
149  theSymbolId[10] = '\0';
150  theSymbolName[20] = '\0';
151  theSymbolSecurityClass[1] = '\0';
152  theSymbolCodewords[40] = '\0';
153  theSymbolControlAndHandling[40] = '\0';
156  theSymbolSecurityControlNum[20] = '\0';
157  theSymbolSecurityDowngrade[6] = '\0';
158  theSymbolDowngradingEvent[40] = '\0';
159  theSymbolEncryption[1] = '\0';
160  theSymbolType[1] = '\0';
161  theNumberLinesPerSymbol[4] = '\0';
163  theSymbolLineWidth[4] = '\0';
164  theSymbolNumberBitsPerPixel[1] = '\0';
165  theSymbolDisplayLevel[3] = '\0';
166  theSymbolAttachmentLevel[3] = '\0';
167  theSymbolLocation[10] = '\0';
168  theSecondSymbolLocation[10] = '\0';
169  theSymbolColor[1] = '\0';
170  theSymbolNumber[6] = '\0';
171  theSymbolRotation[3] = '\0';
172  theSymbolNumberOfLutEntries[3] = '\0';
175 }
virtual void parseStream(std::istream &in)
ossim_int32 toInt32() const
virtual ossimDrect getImageRect() const
virtual std::ostream & print(std::ostream &out) const
Generic print method.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
virtual ossim_int32 getDisplayLevel() const
#define RTTI_DEF1(cls, name, b1)
Definition: ossimRtti.h:485
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32