OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpfToc.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 //*************************************************************************
10 // $Id: ossimRpfToc.h 18044 2010-09-06 14:20:52Z dburken $
11 #ifndef osimRpfToc_HEADER
12 #define osimRpfToc_HEADER 1
13 
19 #include <ossim/base/ossimRefPtr.h>
22 
23 #include <vector>
24 #include <iosfwd>
25 
27 class ossimRpfTocEntry;
28 class ossimRpfFrameEntry;
29 
31 {
32 public:
34  const ossimRpfToc& data);
35  ossimRpfToc();
36 
37  virtual ~ossimRpfToc();
38 
45  ossimErrorCode parseFile(const ossimFilename &fileName,
46  bool keepFileHeader = false);
47 
59  void createTocAndCopyFrames( const ossimFilename& dotRpfFile,
60  const ossimFilename& outputDir);
61 
72  const std::string& prefix=std::string(),
73  bool printOverviews=false ) const;
74 
87  std::ostream& printHeader( std::ostream& out,
88  const std::string& prefix=std::string() ) const;
89 
102  std::ostream& printTocEntry( std::ostream& out,
103  ossim_uint32 entryIndex,
104  const std::string& prefix=std::string(),
105  bool printOverviews=false ) const;
106 
107 
108  ossim_uint32 getNumberOfEntries()const;
109 
110  const ossimRpfTocEntry* getTocEntry(ossim_uint32 index)const;
111 
115  ossim_int32 getTocEntryIndex(const ossimRpfTocEntry* entry);
116 
122  const ossimNitfFileHeader* getNitfFileHeader()const;
123 
124  const ossimRpfHeader* getRpfHeader() const;
125 
134  ossim_uint32 getNumberOfFramesHorizontal(ossim_uint32 idx)const;
135 
144  ossim_uint32 getNumberOfFramesVertical(ossim_uint32 idx)const;
145 
155  bool getRpfFrameEntry(ossim_uint32 entryIdx,
156  ossim_uint32 row,
157  ossim_uint32 col,
158  ossimRpfFrameEntry& result)const;
159 
170  const ossimString getRelativeFramePath( ossim_uint32 entryIdx,
171  ossim_uint32 row,
172  ossim_uint32 col)const;
173 
178  void getRootDirectory(ossimFilename& dir) const;
179 
180 private:
181  void deleteAll();
182  void clearAll();
183  void deleteTocEntryList();
184  void buildTocEntryList(ossimRpfHeader* rpfHeader);
185  void allocateTocEntryList(ossim_uint32 numberOfEntries);
186 
188  void getFirstEntry(const ossimRpfTocEntry* rpfTocEntry,
189  ossimRpfFrameEntry& frameEntry) const;
190 
196  void writeFrameFileIndexSection(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
197  std::ifstream& dotRpfStr,
198  std::ofstream& dotTocStr);
199 
205  void copyFrames(std::ifstream& dotRpfStr, const ossimFilename& outputDir);
206 
207 
208 
213  ossim_uint32 getNumberOfFrames(std::ifstream& dotRpfStr) const;
214 
219  ossimFilename getSourceTocFile(std::ifstream& dotRpfStr) const;
220 
225  bool getCorespondingEntry(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
226  std::ifstream& dotRpfStr,
227  ossim_uint32& entry) const;
228 
242  bool getFile(const std::string& line, ossimFilename& file) const;
243 
250  std::vector<ossimRpfTocEntry*> m_tocEntryList;
251 
256 
258 
260 };
261 
262 #endif
ossim_int32 ossimErrorCode
ossimFilename m_filename
Definition: ossimRpfToc.h:255
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
std::vector< ossimRpfTocEntry * > m_tocEntryList
Definition: ossimRpfToc.h:250
ossimRefPtr< const ossimNitfFileHeader > m_nitfFileHeader
Definition: ossimRpfToc.h:257
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
ostream & operator<<(ostream &out, const ossimAxes &axes)
Definition: ossimAxes.h:88
unsigned int ossim_uint32
ossimRefPtr< ossimRpfHeader > m_rpfHeader
Definition: ossimRpfToc.h:259
#define OSSIM_DLL
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32