~ubuntu-branches/ubuntu/trusty/liblas/trusty-proposed

« back to all changes in this revision

Viewing changes to include/liblas/detail/zippoint.hpp

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2014-01-05 17:00:29 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140105170029-ddtp0j63x5jvck2u
Tags: 1.7.0+dfsg-2
Fixed missing linking of system boost component.
(closes: #733282)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 * $Id$
 
3
 *
 
4
 * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
 
5
 * Purpose:  laszip helper functions for C++ libLAS 
 
6
 * Author:   Michael P. Gerlek (mpg@flaxen.com)
 
7
 *
 
8
 ******************************************************************************
 
9
 * Copyright (c) 2010, Michael P. Gerlek
 
10
 *
 
11
 * All rights reserved.
 
12
 * 
 
13
 * Redistribution and use in source and binary forms, with or without 
 
14
 * modification, are permitted provided that the following 
 
15
 * conditions are met:
 
16
 * 
 
17
 *     * Redistributions of source code must retain the above copyright 
 
18
 *       notice, this list of conditions and the following disclaimer.
 
19
 *     * Redistributions in binary form must reproduce the above copyright 
 
20
 *       notice, this list of conditions and the following disclaimer in 
 
21
 *       the documentation and/or other materials provided 
 
22
 *       with the distribution.
 
23
 *     * Neither the name of the Martin Isenburg or Iowa Department 
 
24
 *       of Natural Resources nor the names of its contributors may be 
 
25
 *       used to endorse or promote products derived from this software 
 
26
 *       without specific prior written permission.
 
27
 * 
 
28
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
29
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 
30
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 
31
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 
32
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 
33
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
 
34
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
 
35
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 
36
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 
37
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
 
38
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
 
39
 * OF SUCH DAMAGE.
 
40
 ****************************************************************************/
 
41
 
 
42
#ifndef LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED
 
43
#define LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED
 
44
 
 
45
 
 
46
#include <liblas/detail/fwd.hpp>
 
47
#include <liblas/liblas.hpp>
 
48
 
 
49
// boost
 
50
#include <boost/cstdint.hpp>
 
51
#include <boost/shared_ptr.hpp>
 
52
#include <boost/scoped_ptr.hpp>
 
53
#include <boost/scoped_array.hpp>
 
54
 
 
55
// liblaszip
 
56
class LASzipper;
 
57
class LASzip;
 
58
 
 
59
namespace liblas { namespace detail { 
 
60
 
 
61
class ZipPoint
 
62
{
 
63
public:
 
64
    ZipPoint(PointFormatName, const std::vector<VariableRecord>& vlrs);
 
65
    ~ZipPoint();
 
66
 
 
67
    void ConstructVLR(VariableRecord&) const;
 
68
 
 
69
    // these will return false iff we find a laszip VLR and it doesn't match
 
70
    // the point format this object wasd constructed with
 
71
    bool ValidateVLR(std::vector<VariableRecord> const& vlrs) const;
 
72
    bool ValidateVLR(const VariableRecord& vlr) const;
 
73
    
 
74
    bool IsZipVLR(const VariableRecord& vlr) const;
 
75
    
 
76
    LASzip* GetZipper() const { return m_zip.get(); }
 
77
 
 
78
private:
 
79
    void ConstructItems();
 
80
 
 
81
public: // for now
 
82
    // LASzip::pack() allocates/sets vlr_data and vlr_num for us, and deletes it for us  ["his"]
 
83
    // LASzip::unpack() just reads from the vlr_data we give it (we allocate and delete)  ["our"]
 
84
    int his_vlr_num;
 
85
    unsigned char* his_vlr_data;
 
86
 
 
87
    boost::scoped_ptr<LASzip> m_zip;
 
88
 
 
89
    unsigned char** m_lz_point;
 
90
    boost::scoped_array<boost::uint8_t> m_lz_point_data;
 
91
    unsigned int m_lz_point_size;
 
92
};
 
93
 
 
94
}} // namespace liblas::detail
 
95
 
 
96
 
 
97
#endif // LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED