Changeset 1614:5a1467085fe5


Ignore:
Timestamp:
03/05/10 11:14:54 (5 months ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Message:

implement compatibility typedefs for #172

Location:
include
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • include/Makefile.am

    r1601 r1614  
    22 
    33nobase_las_HEADERS = \ 
     4    liblas/compatibility.hpp \ 
    45    liblas/cstdint.hpp \ 
    56    liblas/exception.hpp \ 
  • include/liblas/compatibility.hpp

    r1613 r1614  
    33 * 
    44 * Project:  libLAS - http://liblas.org - A BSD library for LAS format data. 
    5  * Purpose:  LAS include file 
    6  * Author:   Mateusz Loskot, mateusz@loskot.net 
     5 * Purpose:  LAS compatibility header 
     6 * Author:   Howard Butler, hobu.inc@gmail.com 
    77 * 
    88 ****************************************************************************** 
    9  * Copyright (c) 2008, Mateusz Loskot 
    10  * Copyright (c) 2008, Phil Vachon 
    11  * Copyright (c) 2008, Howard Butler 
     9 * Copyright (c) 2010, Howard Butler 
    1210 * 
    1311 * All rights reserved. 
     
    4341 
    4442 
    45 #ifndef LIBLAS_HPP_INCLUDED 
    46 #define LIBLAS_HPP_INCLUDED 
     43#ifndef LIBLAS_COMPATIBILITY_HPP_INCLUDED 
     44#define LIBLAS_COMPATIBILITY_HPP_INCLUDED 
    4745 
    48 #include <liblas/cstdint.hpp> 
    4946#include <liblas/detail/fwd.hpp> 
    50 #include <fstream> 
    51 #include <string> 
    5247 
    53 /// Namespace grouping all elements of libLAS public interface. 
    54 /// \note 
    55 /// User's may notice there is namespace \em detail nested 
    56 /// in the \em liblas namespace. The \em detail should be considered as private 
    57 /// namespace dedicated for implementation details, so libLAS users are not 
    58 /// supposed to access it directly, nor included headers from the \em detail 
    59 /// subdirectory of \em liblas include folder. 
    6048namespace liblas 
    6149{ 
    6250 
    63 /// Open file to read in binary mode. 
    64 /// The input file is also attached to input stream. 
    65 /// \param ifs - reference to input file stream to 
    66 /// which opened file is attached 
    67 /// \param filename - name of file to open 
    68 /// \return true if file has been opened with success, false otherwise 
    69 /// \exception No throw 
    70 /// 
    71 inline bool Open(std::ifstream& ifs, std::string const& filename) // throw() 
    72 { 
    73     ifs.open(filename.c_str(), std::ios::in | std::ios::binary); 
    74     return ifs.is_open(); 
    75 } 
    76  
    77 /// Create file and open to write in binary mode. 
    78 /// The output file is also attached to output stream. 
    79 /// \param ofs - reference to output file stream to 
    80 /// which created file is attached 
    81 /// \param filename - name of file to open 
    82 /// \return true if file has been create with success, false otherwise 
    83 /// \exception No throw 
    84 /// 
    85 inline bool Create(std::ofstream& ofs, std::string const& filename) // throw() 
    86 { 
    87     ofs.open(filename.c_str(), std::ios::out | std::ios::binary); 
    88     return ofs.is_open(); 
    89 } 
    90  
    91 /// Check if GDAL support has been built in to libLAS. 
    92 inline bool IsGDALEnabled() 
    93 { 
    94 #ifdef HAVE_GDAL 
    95     return true; 
    96 #else 
    97     return false; 
    98 #endif 
    99 } 
    100  
    101 /// Check if GeoTIFF support has been built in to libLAS. 
    102 inline bool IsLibGeoTIFFEnabled() 
    103 { 
    104 #ifdef HAVE_LIBGEOTIFF 
    105     return true; 
    106 #else 
    107     return false; 
    108 #endif 
    109 } 
    110  
    111 /// Check if libspatialindex support has been built in to libLAS. 
    112 inline bool IsLibSpatialIndexEnabled() 
    113 { 
    114 #ifdef HAVE_SPATIALINDEX 
    115     return true; 
    116 #else 
    117     return false; 
    118 #endif 
    119 } 
    120  
    121 /// Range of allowed ASPRS LAS file format versions. 
    122 enum FormatVersion 
    123 { 
    124     eVersionMajorMin = 1, ///< Minimum of major component 
    125     eVersionMajorMax = 1, ///< Maximum of major component 
    126     eVersionMinorMin = 0, ///< Minimum of minor component 
    127     eVersionMinorMax = 2 ///< Maximum of minor component 
    128 }; 
    129  
    130 /// Versions of point record format. 
    131 enum PointFormatName 
    132 { 
    133     ePointFormat0 = 0, ///< Point Data Format \e 0 
    134     ePointFormat1 = 1, ///< Point Data Format \e 1 
    135     ePointFormat2 = 2, ///< Point Data Format \e 2 
    136     ePointFormat3 = 3,  ///< Point Data Format \e 3 
    137     ePointFormatUnknown = -99 ///< Point Data Format is unknown 
    138 }; 
    139  
    140 /// Number of bytes of point record storage in particular format. 
    141 enum PointSize 
    142 { 
    143     ePointSize0 = 20, ///< Size of point record in data format \e 0 
    144     ePointSize1 = 28, ///< Size of point record in data format \e 1 
    145     ePointSize2 = 26, ///< Size of point record in data format \e 2 
    146     ePointSize3 = 34  ///< Size of point record in data format \e 3 
    147  
    148 }; 
    149  
    150  
    151 class ReaderI 
    152 { 
    153 public: 
    154  
    155     virtual Header const& ReadHeader() = 0; 
    156     virtual Point const& ReadNextPoint(const Header& header) = 0; 
    157     virtual Point const& ReadPointAt(std::size_t n, const Header& header) = 0; 
    158  
    159     virtual void Reset(const Header& header) = 0; 
    160     virtual void SetInputSRS(const SpatialReference& srs) = 0; 
    161     virtual void SetOutputSRS(const SpatialReference& srs, const Header& header) = 0; 
    162  
    163     virtual ~ReaderI() {};     
    164 }; 
    165  
    166 class WriterI 
    167 { 
    168 public: 
    169  
    170     virtual Header const& WriteHeader(const Header& header) = 0; 
    171     virtual void UpdateHeader(const Header& header) = 0; 
    172     virtual void WritePoint(const Point& point, const Header& header) = 0; 
    173  
    174     virtual void SetInputSRS(const SpatialReference& srs) = 0; 
    175     virtual void SetOutputSRS(const SpatialReference& srs, const Header& header) = 0; 
    176  
    177     virtual ~WriterI() {};     
    178  
    179 }; 
    180  
     51typedef liblas::Writer LASWriter; 
     52typedef liblas::Reader LASReader; 
     53typedef liblas::Point LASPoint; 
     54typedef liblas::SpatialReference LASSpatialReference; 
     55typedef liblas::VariableRecord LASVariableRecord; 
     56typedef liblas::Header LASHeader; 
     57typedef liblas::Classification LASClassification; 
     58typedef liblas::Color LASColor; 
     59typedef liblas::Point LASPoint; 
    18160 
    18261 
  • include/liblas/detail/fwd.hpp

    r1613 r1614  
    5353class SpatialReference; 
    5454class PointFormat; 
     55class Classification; 
     56class VariableRecord; 
    5557 
    5658namespace detail { 
  • include/liblas/lasclassification.hpp

    r1613 r1614  
    268268} 
    269269 
    270 // typedef liblas::Classification LASClassification ; 
    271  
    272  
    273270} // namespace liblas 
    274271 
  • include/liblas/lascolor.hpp

    r1613 r1614  
    167167} 
    168168 
    169 // typedef liblas::Color LASColor; 
    170  
    171169} // namespace liblas 
    172170 
  • include/liblas/lasformat.hpp

    r1613 r1614  
    154154} 
    155155 
    156 typedef liblas::PointFormat LASPointFormat ; 
    157156} // namespace liblas 
    158157 
  • include/liblas/lasheader.hpp

    r1613 r1614  
    379379}; 
    380380 
    381 // typedef liblas::Header LASHeader ; 
    382381} // namespace liblas 
    383382 
  • include/liblas/laspoint.hpp

    r1613 r1614  
    361361} 
    362362 
    363 // typedef liblas::Point LASPoint; 
    364  
    365363} // namespace liblas 
    366364 
  • include/liblas/lasreader.hpp

    r1613 r1614  
    157157 
    158158 
    159 // typedef liblas::Reader LASReader; 
    160159 
    161160} // namespace liblas 
  • include/liblas/lasspatialreference.hpp

    r1613 r1614  
    202202}; 
    203203 
    204 // typedef liblas::SpatialReference LASSpatialReference; 
    205204} // namespace liblas 
    206205 
  • include/liblas/lasvariablerecord.hpp

    r1613 r1614  
    156156} 
    157157 
    158 // typedef liblas::VariableRecord LASVariableRecord ; 
    159  
    160158} // namespace liblas 
    161159 
  • include/liblas/laswriter.hpp

    r1613 r1614  
    110110}; 
    111111 
    112 // typedef liblas::Writer LASWriter ; 
    113  
    114112} // namespace liblas 
    115113 
Note: See TracChangeset for help on using the changeset viewer.