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> 77 virtual bool filter(
const Point& point) = 0;
107 BoundsFilter(
double minx,
double miny,
double maxx,
double maxy);
108 BoundsFilter(
double minx,
double miny,
double minz,
double maxx,
double maxy,
double maxz);
110 bool filter(
const Point& point);
128 bool filter(
const Point& point);
132 class_list_type m_classes;
153 uint32_t thin_amount;
166 bool filter(
const Point& point);
170 return_list_type m_returns;
183 bool filter(
const Point& point);
196 template <
typename T>
263 compare_func compare;
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);
320 if (GetType() == eInclusion) {
328 if (GetType() == eInclusion) {
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) {
381 bool filter(
const Point& point);
395 #endif // ndef LIBLAS_LASFILTER_HPP_INCLUDED A filter for keeping or rejecting a list of return ids.
Definition: filter.hpp:159
#define LAS_DLL
Definition: export.hpp:58
FilterI(FilterType t)
Base constructor. Initializes the FilterType.
Definition: filter.hpp:89
std::vector< liblas::Classification > class_list_type
Definition: filter.hpp:125
A filter for keeping or rejecting points that fall within a specified bounds.
Definition: filter.hpp:103
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
Defines public interface to LAS filter implementation.
Definition: filter.hpp:62
virtual ~FilterI()
Definition: filter.hpp:86
boost::shared_ptr< FilterI > FilterPtr
Definition: filter.hpp:99
A templated class that allows you to create complex filters using functions that are callable from th...
Definition: filter.hpp:197
A filter simple decimation.
Definition: filter.hpp:139
std::vector< uint16_t > return_list_type
Definition: filter.hpp:163
Definition: filter.hpp:178
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:68
FilterType GetType() const
Gets the type of filter.
Definition: filter.hpp:84
boost::function< bool(T, T)> compare_func
Definition: filter.hpp:204
ContinuousValueFilter(filter_func f, std::string const &filter_string)
Construct the filter with a filter_func and a simple expression.
Definition: filter.hpp:260
Namespace grouping all elements of libLAS public interface.
Definition: bounds.hpp:60
Point data record composed with X, Y, Z coordinates and attributes.
Definition: point.hpp:68
A filter for keeping or rejecting a list of classification ids.
Definition: filter.hpp:121
boost::function< T(const Point *)> filter_func
Definition: filter.hpp:203
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
A filter for color ranges.
Definition: filter.hpp:368
RGB color container.
Definition: color.hpp:55
uint16_t value_type
Definition: color.hpp:59