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

« back to all changes in this revision

Viewing changes to include/liblas/reader.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:  LAS reader class 
 
6
* Author:   Mateusz Loskot, mateusz@loskot.net
 
7
*
 
8
******************************************************************************
 
9
* Copyright (c) 2008, Mateusz Loskot
 
10
* Copyright (c) 2008, Phil Vachon
 
11
*
 
12
* All rights reserved.
 
13
 
14
* Redistribution and use in source and binary forms, with or without 
 
15
* modification, are permitted provided that the following 
 
16
* conditions are met:
 
17
 
18
*     * Redistributions of source code must retain the above copyright 
 
19
*       notice, this list of conditions and the following disclaimer.
 
20
*     * Redistributions in binary form must reproduce the above copyright 
 
21
*       notice, this list of conditions and the following disclaimer in 
 
22
*       the documentation and/or other materials provided 
 
23
*       with the distribution.
 
24
*     * Neither the name of the Martin Isenburg or Iowa Department 
 
25
*       of Natural Resources nor the names of its contributors may be 
 
26
*       used to endorse or promote products derived from this software 
 
27
*       without specific prior written permission.
 
28
 
29
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
30
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 
31
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 
32
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 
33
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 
34
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
 
35
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
 
36
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 
37
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 
38
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
 
39
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
 
40
* OF SUCH DAMAGE.
 
41
****************************************************************************/
 
42
 
 
43
#ifndef LIBLAS_LASREADER_HPP_INCLUDED
 
44
#define LIBLAS_LASREADER_HPP_INCLUDED
 
45
 
 
46
#include <liblas/header.hpp>
 
47
#include <liblas/point.hpp>
 
48
#include <liblas/variablerecord.hpp>
 
49
#include <liblas/spatialreference.hpp>
 
50
#include <liblas/transform.hpp>
 
51
#include <liblas/filter.hpp>
 
52
#include <liblas/export.hpp>
 
53
// boost
 
54
#include <boost/cstdint.hpp>
 
55
// std
 
56
#include <cstddef>
 
57
#include <iosfwd>
 
58
#include <memory>
 
59
#include <string>
 
60
#include <vector>
 
61
 
 
62
namespace liblas {
 
63
 
 
64
 
 
65
/// Defines public interface to LAS reader implementation.
 
66
class LAS_DLL Reader
 
67
{
 
68
public:
 
69
 
 
70
    /// Consructor initializes reader with input stream as source of LAS records.
 
71
    /// @param ifs - stream used as source of LAS records.
 
72
    /// @exception std::runtime_error - on failure state of the input stream.
 
73
    Reader(std::istream& ifs);
 
74
    Reader(ReaderIPtr reader);
 
75
 
 
76
    Reader(Reader const& other);
 
77
    Reader& operator=(Reader const& rhs);    
 
78
    
 
79
    
 
80
    /// Destructor.
 
81
    /// @exception nothrow
 
82
    ~Reader();
 
83
    
 
84
    /// Provides read-only access to header of LAS file being read.
 
85
    /// @exception nothrow
 
86
    Header const& GetHeader() const;
 
87
    
 
88
    void SetHeader(Header const& );
 
89
 
 
90
    /// Provides read-only access to current point record.
 
91
    /// @exception nothrow
 
92
    Point const& GetPoint() const;
 
93
 
 
94
    /// Fetches next point record in file.
 
95
    /// @exception may throw std::exception
 
96
    bool ReadNextPoint();
 
97
 
 
98
    /// Fetches n-th point record from file.
 
99
    /// @exception may throw std::exception
 
100
    bool ReadPointAt(std::size_t n);
 
101
 
 
102
    /// Reinitializes state of the reader.
 
103
    /// @exception may throw std::exception
 
104
    void Reset();
 
105
 
 
106
    /// Move to the specified point to start 
 
107
    /// ReadNextPoint operations
 
108
    /// @exception may throw std::exception
 
109
    bool Seek(std::size_t n);
 
110
 
 
111
    /// Provides index-based access to point records.
 
112
    /// The operator is implemented in terms of ReadPointAt method
 
113
    /// and is not const-qualified because it updates file stream position.
 
114
    /// @exception may throw std::exception
 
115
    Point const& operator[](std::size_t n);
 
116
    
 
117
    /// Sets filters that are used to determine whether or not to 
 
118
    /// keep a point that was read from the file.  Filters have *no* 
 
119
    /// effect for reading data at specific locations in the file.  
 
120
    /// They only affect reading ReadNextPoint-style operations
 
121
    /// Filters are applied *before* transforms.
 
122
    void SetFilters(std::vector<liblas::FilterPtr> const& filters);
 
123
    
 
124
    /// Gets the list of filters to be applied to points as they are read
 
125
    std::vector<liblas::FilterPtr> GetFilters() const;
 
126
 
 
127
    /// Sets transforms to apply to points.  Points are transformed in 
 
128
    /// place *in the order* of the transform list.
 
129
    /// Filters are applied *before* transforms.  
 
130
    void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
 
131
 
 
132
    /// Gets the list of transforms to be applied to points as they are read
 
133
    std::vector<liblas::TransformPtr> GetTransforms() const;
 
134
 
 
135
private:
 
136
 
 
137
 
 
138
    void Init(); // throws on error
 
139
 
 
140
    ReaderIPtr m_pimpl;
 
141
 
 
142
 
 
143
};
 
144
 
 
145
} // namespace liblas
 
146
 
 
147
#endif // ndef LIBLAS_LASREADER_HPP_INCLUDED