42#ifndef LIBLAS_LASFILTER_HPP_INCLUDED
43#define LIBLAS_LASFILTER_HPP_INCLUDED
48#include <liblas/detail/fwd.hpp>
51#include <boost/function.hpp>
52#include <boost/lexical_cast.hpp>
53#include <boost/shared_ptr.hpp>
108 BoundsFilter(
double minx,
double miny,
double minz,
double maxx,
double maxy,
double maxz);
153 uint32_t thin_amount;
265 bool gt = HasPredicate(filter_string,
">");
266 bool gte = HasPredicate(filter_string,
">=");
267 bool lt = HasPredicate(filter_string,
"<");
268 bool lte = HasPredicate(filter_string,
"<=");
269 bool eq = HasPredicate(filter_string,
"==");
271 std::string::size_type pos=0;
277 c = std::greater_equal<T>();
278 pos = filter_string.find_first_of(
"=") + 1;
283 c = std::greater<T>();
284 pos = filter_string.find_first_of(
">") + 1;
289 c = std::less_equal<T>();
290 pos = filter_string.find_first_of(
"=") +1;
296 pos = filter_string.find_first_of(
"<") + 1;
301 c = std::equal_to<T>();
302 pos = filter_string.find_last_of(
"=") + 1;
306 out = filter_string.substr(pos, filter_string.size());
308 value = boost::lexical_cast<T>(out);
347 bool HasPredicate(std::string
const& parse_string, std::string predicate)
353 for (std::string::const_iterator i = predicate.begin(); i!=predicate.end(); ++i) {
354 std::string::size_type pred = parse_string.find_first_of(*i);
355 if (pred != std::string::npos) {
bool filter(const Point &point)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
BoundsFilter(double minx, double miny, double maxx, double maxy)
BoundsFilter(Bounds< double > const &b)
BoundsFilter(double minx, double miny, double minz, double maxx, double maxy, double maxz)
Definition bounds.hpp:176
bool filter(const Point &point)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
ClassificationFilter(class_list_type classes)
std::vector< liblas::Classification > class_list_type
Definition filter.hpp:125
ColorFilter(liblas::Color const &low, liblas::Color const &high)
bool filter(const Point &point)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
ColorFilter(liblas::Color::value_type low_red, liblas::Color::value_type high_red, liblas::Color::value_type low_blue, liblas::Color::value_type high_blue, liblas::Color::value_type low_green, liblas::Color::value_type high_green)
RGB color container.
Definition color.hpp:56
uint16_t value_type
Definition color.hpp:59
A templated class that allows you to create complex filters using functions that are callable from th...
Definition filter.hpp:198
ContinuousValueFilter(filter_func f, T value, compare_func c)
Construct the filter with a filter_func, a comparison value, and a compare_func.
Definition filter.hpp:228
ContinuousValueFilter(filter_func f, std::string const &filter_string)
Construct the filter with a filter_func and a simple expression.
Definition filter.hpp:260
bool filter(const liblas::Point &p)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
Definition filter.hpp:312
boost::function< T(const Point *)> filter_func
Definition filter.hpp:203
boost::function< bool(T, T)> compare_func
Definition filter.hpp:204
Defines public interface to LAS filter implementation.
Definition filter.hpp:63
virtual ~FilterI()
Definition filter.hpp:86
FilterType GetType() const
Gets the type of filter.
Definition filter.hpp:84
void SetType(FilterType t)
Sets whether the filter is one that keeps data that matches construction criteria or rejects them.
Definition filter.hpp:81
FilterType
Determines whether or not the filter keeps or rejects points that meet filtering criteria.
Definition filter.hpp:69
@ eInclusion
Filter keeps point that meet the criteria of filter(const Point& point)
Definition filter.hpp:71
@ eExclusion
Filter removes point that meet the criteria of filter(const Point& point)
Definition filter.hpp:70
virtual bool filter(const Point &point)=0
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
FilterI(FilterType t)
Base constructor. Initializes the FilterType.
Definition filter.hpp:89
Point data record composed with X, Y, Z coordinates and attributes.
Definition point.hpp:69
std::vector< uint16_t > return_list_type
Definition filter.hpp:163
ReturnFilter(return_list_type returns, bool last_only)
bool filter(const Point &point)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
bool filter(const liblas::Point &point)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
ThinFilter(uint32_t thin)
Default constructor. Keep every thin'th point.
bool filter(const Point &point)
Function called by liblas::Reader::ReadNextPoint to apply the (list) of filter to the point.
#define LAS_DLL
Definition export.hpp:58
Namespace grouping all elements of libLAS public interface.
Definition bounds.hpp:60
boost::shared_ptr< FilterI > FilterPtr
Definition filter.hpp:99