1 #ifndef PCL_VISUALIZATION_SIMPLE_BUFF_H
2 #define PCL_VISUALIZATION_SIMPLE_BUFF_H
4 #include <pcl/visualization/histogram_visualizer.h>
11 namespace visualization
30 initValuesAndVisualization();
39 nb_values_ = nb_values;
43 PCL_WARN(
"Maximum number of values can only be 308 (%d given). Setting back to 308. \n");
49 PCL_WARN(
"Number of values must be at least 2 (%d given). Setting it to default (308). \n");
54 initValuesAndVisualization();
61 displayValues (
const int time = 1)
64 updateValuesToDisplay();
67 if(control_background_color_)
69 if(values_.back() < lowest_threshold_)
71 histo_->setBackgroundColor(255.0, 140.0, 0.0);
75 histo_->setBackgroundColor(255.0, 255.0, 255.0);
80 histo_->updateFeatureHistogram(cloud_, nb_values_);
85 histo_->setGlobalYRange(min_, max_);
96 addValue (
const float val)
102 values_.push_back(val);
116 spinOnce (
const int time = 1)
118 histo_->spinOnce(time);
135 setAutomaticBackgroundColorControl (
const bool value =
true,
const float threshold = 0.0f)
137 control_background_color_ = value;
141 histo_->setBackgroundColor(255.0, 255.0, 255.0);
143 lowest_threshold_ = threshold;
152 setManuallyManageYScale (
const bool value =
false)
154 handle_y_scale_ = value;
162 initValuesAndVisualization ()
164 cloud_.points.resize(1);
166 PCL_WARN(
"Setting buffer size to %d entries.\n", nb_values_);
167 values_.resize(nb_values_);
170 histo_->addFeatureHistogram(cloud_, nb_values_);
178 updateValuesToDisplay ()
180 for(
int i = 0 ; i < nb_values_ ; ++i)
182 cloud_.points[0].histogram[i] = values_[i];
190 control_background_color_ =
false;
191 lowest_threshold_ = 0.0f;
193 handle_y_scale_ =
false;
200 PCLHistogramVisualizer *histo_;
206 std::deque<float> values_;
214 bool control_background_color_;
217 float lowest_threshold_;
220 bool handle_y_scale_;
228 #endif // PCL_VISUALIZATION_SIMPLE_BUFF_H