Statistics
| Revision:

svn-gvsig-desktop / tags / gvsig_topologia-0_1_0-1232 / libraries / libjni-readecw-linux / include / NCSJP2SuperBox.h @ 39764

History | View | Annotate | Download (3.22 KB)

1
/********************************************************
2
** Copyright 2002 Earth Resource Mapping Ltd.
3
** This document contains proprietary source code of
4
** Earth Resource Mapping Ltd, and can only be used under
5
** one of the three licenses as described in the 
6
** license.txt file supplied with this distribution. 
7
** See separate license.txt file for license details 
8
** and conditions.
9
**
10
** This software is covered by US patent #6,442,298,
11
** #6,102,897 and #6,633,688.  Rights to use these patents 
12
** is included in the license agreements.
13
**
14
** FILE:     $Archive: /NCS/Source/include/NCSJP2SuperBox.h $
15
** CREATED:  28/11/2002 3:27:34 PM
16
** AUTHOR:   Simon Cope
17
** PURPOSE:  CNCSJP2SuperBox class header
18
** EDITS:    [xx] ddMmmyy NAME COMMENTS
19
 *******************************************************/
20

    
21
#ifndef NCSJP2SUPERBOX_H
22
#define NCSJP2SUPERBOX_H
23

    
24
// JP2 Box class
25
#ifndef NCSJP2BOX_H
26
#include "NCSJP2Box.h"
27
#endif // NCSJP2BOX_H
28

    
29
/**
30
 * CNCSJP2SuperBox class - a box containing a collection of JP2 file boxes.
31
 * 
32
 * @author       Simon Cope
33
 * @version      $Revision: 1459 $ $Author: igbrotru $ $Date: 2005-02-15 08:52:56 +0100 (Tue, 15 Feb 2005) $ 
34
 */
35
class NCSJPC_EXPORT_ALL CNCSJP2SuperBox: public CNCSJP2Box {
36
public:
37
                /** List of other box(es) that we found in this superbox - UUID, XML etc */
38
        CNCSJP2BoxList m_OtherBoxes;        
39
                /** List of other box(es) that we own and must delete on destruction */
40
        CNCSJP2BoxList m_OwnedBoxes;        
41

    
42
                /** Default constructor */
43
        CNCSJP2SuperBox();
44
                /** Virtual destructor */
45
        virtual ~CNCSJP2SuperBox();
46

    
47
                /** 
48
                 * Set which Box(es) can exist within this superbox
49
                 * @param       pFirst                NULL terminated varargs list of boxes that can exist in this superbox
50
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
51
                 */
52
        virtual CNCSError SetBoxes(CNCSJP2Box *pFirst, ...);
53
                /** 
54
                 * Parse the base box from the JP2 file.
55
                 * @param                JP2File                JP2 file being parsed
56
                 * @param                Stream                IOStream to use to parse file.
57
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
58
                 */
59
        virtual void UpdateXLBox(void);
60

    
61
        virtual CNCSError Parse(class CNCSJP2File &JP2File, CNCSJPCIOStream &Stream);
62
                /** 
63
                 * UnParse the box to the JP2 file.
64
                 * @param                JP2File                JP2 file being parsed
65
                 * @param                Stream                IOStream to use to parse file.
66
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
67
                 */
68
        virtual CNCSError UnParse(class CNCSJP2File &JP2File, CNCSJPCIOStream &Stream);
69

    
70
                /** 
71
                 * Get a box of the specified type from within this superbox.  Recursive.
72
                 * @param                nTBox                JP2 box type to find
73
                 * @param                pLast                Last box returned to iterate.
74
                 * @param                pbSkip                Skip a box.
75
                 * @return      CNCSJP2Box*        Box instance, or NULL on failure.
76
                 */
77
        CNCSJP2Box *GetBox(UINT32 nTBox, CNCSJP2Box *pLast = NULL, bool *pbSkip = NULL);
78
protected:
79
                /** List of box(es) that can exist within this superbox */
80
        CNCSJP2BoxList m_Boxes;        
81

    
82
                /** 
83
                 * Is this box required.  This test is in a separate method to allow derived classes of
84
                 * the superbox to do specific tests, eg for a GeoJP2-style UUID box.
85
                 * 
86
                 * @param                TestBox                Box being tested against
87
                 * @param                ThisBox                Box being tested
88
                 * @return      bool                true/false "Required" test result.
89
                 */
90
        virtual bool Required(CNCSJP2Box &TestBox, CNCSJP2Box &ThisBox);
91
};
92

    
93
#endif // !NCSJP2SUPERBOX_H