OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Trailer.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
15 
24 
25 namespace ossimplugins
26 {
27 
28 const int Trailer::RadiometricDataID = 8;
30 const int Trailer::AttitudeDataID = 7;
34 const int Trailer::DataQualityID = 3;
35 const int Trailer::DataSetSummaryID = 2;
36 const int Trailer::FileDescriptorID = 1;
37 
39 {
40 }
41 
43 {
44  ClearRecords();
45 }
46 
48 {
49  std::map<int, RadarSatRecord*>::const_iterator it = data._records.begin();
50  while(it != data._records.end())
51  {
52  (*it).second->Write(os);
53  ++it;
54  }
55  return os;
56 
57 }
58 
60 {
61  TrailerFactory factory;
62 
63  data.ClearRecords();
64 
65  RadarSatRecordHeader header;
66  bool eof = false;
67  while(!eof)
68  {
69  is>>header;
70  if(is.eof())
71  {
72  eof = true;
73  }
74  else
75  {
76  RadarSatRecord* record = factory.Instanciate(header.get_rec_seq());
77  if (record != NULL)
78  {
79  record->Read(is);
80  data._records[header.get_rec_seq()] = record;
81  }
82  else
83  {
84  char* buff = new char[header.get_length()-12];
85  is.read(buff, header.get_length()-12);
86  delete[] buff;
87  }
88  }
89  }
90  return is;
91 }
92 
93 
95 {
96  std::map<int, RadarSatRecord*>::const_iterator it = rhs._records.begin();
97  while(it != rhs._records.end())
98  {
99  _records[(*it).first] = (*it).second->Clone();
100  ++it;
101  }
102 }
103 
105 {
106  ClearRecords();
107  std::map<int, RadarSatRecord*>::const_iterator it = rhs._records.begin();
108  while(it != rhs._records.end())
109  {
110  _records[(*it).first] = (*it).second->Clone();
111  ++it;
112  }
113 
114  return *this;
115 }
116 
118 {
119  std::map<int, RadarSatRecord*>::const_iterator it = _records.begin();
120  while(it != _records.end())
121  {
122  delete (*it).second;
123  ++it;
124  }
125  _records.clear();
126 }
127 
129 {
131 }
132 
134 {
136 }
137 
139 {
141 }
142 
144 {
146 }
147 
149 {
151 }
152 
154 {
156 }
157 
159 {
161 }
162 
164 {
166 }
167 
169 {
171 }
172 }
This class is able to read the SAR leader file descriptor record of the leader file.
static const int DataHistogramSignalDataID
Definition: Trailer.h:95
DataQuality * get_DataQuality()
Definition: Trailer.cpp:158
~Trailer()
Destructor.
Definition: Trailer.cpp:42
RadarSatRecord * Instanciate(int id)
Instanciates a new Record.
AttitudeData * get_AttitudeData()
Definition: Trailer.cpp:138
This class is able to read a data quality record.
Definition: DataQuality.h:29
Trailer & operator=(const Trailer &rhs)
Copy operator.
Definition: Trailer.cpp:104
static const int FileDescriptorID
Definition: Trailer.h:98
DataSetSummary * get_DataSetSummary()
Definition: Trailer.cpp:163
DataHistogramProcessedData8 * get_DataHistogramProcessedData8()
Definition: Trailer.cpp:148
static const int RadiometricCompensationDataID
Definition: Trailer.h:91
ProcessingParameters * get_ProcessingParameters()
Definition: Trailer.cpp:143
static const int ProcessingParametersID
Definition: Trailer.h:93
This class is able to read the trailer file of the RadarSat file structure.
Definition: Trailer.h:40
static const int DataSetSummaryID
Definition: Trailer.h:97
This class is the base class of all the record classes.
virtual void Read(std::istream &is)=0
Reads the class data from a stream.
This class is able to read a data histogram record - Signal data.
void ClearRecords()
Removes all the previous records from the Trailer.
Definition: Trailer.cpp:117
static const int AttitudeDataID
Definition: Trailer.h:92
DataHistogramSignalData * get_DataHistogramSignalData()
Definition: Trailer.cpp:153
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
This class is able to read a radiometric data record.
static const int DataHistogramProcessedData8ID
Definition: Trailer.h:94
RadiometricData * get_RadiometricData()
Definition: Trailer.cpp:128
This class is able to read a Radiometric Compensation data record.
Trailer()
Constructor.
Definition: Trailer.cpp:38
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
static const int DataQualityID
Definition: Trailer.h:96
RadiometricCompensationData * get_RadiometricCompensationData()
Definition: Trailer.cpp:133
This class is a factory able to construct Record base classes.
This class is able to read a Detailed processing parameters record.
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
static const int RadiometricDataID
Definition: Trailer.h:90
This class is able to read the SAR leader data set summary record of the leader file.
This class is able to read a record header.
FileDescriptor * get_FileDescriptor()
Definition: Trailer.cpp:168
std::map< int, RadarSatRecord * > _records
Definition: Trailer.h:88
This class is able to read a Attitude data record.
Definition: AttitudeData.h:28
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23