Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
filter.h
1
2
/***************************************************************************
3
* filter.h - Laser data filter interface
4
*
5
* Created: Fri Oct 10 17:11:04 2008
6
* Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
7
****************************************************************************/
8
9
/* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU Library General Public License for more details.
18
*
19
* Read the full text in the LICENSE.GPL file in the doc directory.
20
*/
21
22
#ifndef __PLUGINS_LASER_FILTER_FILTER_H_
23
#define __PLUGINS_LASER_FILTER_FILTER_H_
24
25
#include <vector>
26
#include <string>
27
28
class
LaserDataFilter
29
{
30
public
:
31
class
Buffer
{
32
public
:
33
Buffer
(
size_t
num_values = 0);
34
std::string
frame
;
///< reference coordinate frame ID
35
float
*
values
;
///< values
36
};
37
38
LaserDataFilter
(
unsigned
int
in_data_size
,
39
std::vector<Buffer *> &
in
,
unsigned
int
out_size);
40
virtual
~LaserDataFilter
();
41
42
virtual
std::vector<Buffer *> &
get_out_vector
();
43
virtual
void
set_out_vector
(std::vector<Buffer *> &
out
);
44
virtual
unsigned
int
get_out_data_size
();
45
46
virtual
void
filter
() = 0;
47
48
void
set_array_ownership
(
bool
own_in,
bool
own_out);
49
/** Check if input arrays are owned by filter.
50
* @return true if arrays are owned by this filter, false otherwise. */
51
bool
owns_in
()
const
{
return
__own_in; };
52
/** Check if output arrays are owned by filter.
53
* @return true if arrays are owned by this filter, false otherwise. */
54
bool
owns_out
()
const
{
return
__own_out; };
55
56
protected
:
57
virtual
void
set_out_data_size
(
unsigned
int
data_size);
58
59
void
reset_outbuf
(Buffer *b);
60
void
copy_to_outbuf
(Buffer *outbuf,
const
Buffer *inbuf);
61
62
63
protected
:
64
unsigned
int
out_data_size
;
65
unsigned
int
in_data_size
;
66
std::vector<Buffer *>
in
;
67
std::vector<Buffer *>
out
;
68
69
private
:
70
bool
__own_in;
71
bool
__own_out;
72
};
73
74
75
#endif
src
plugins
laser-filter
filters
filter.h
Generated by
1.8.3.1