21 #include "glog/logging.h" 26 std::unique_ptr<ColoringPointsProcessor>
30 const std::string frame_id = dictionary->
GetString(
"frame_id");
31 const std::vector<double> color_values =
32 dictionary->
GetDictionary(
"color")->GetArrayValuesAsDoubles();
34 static_cast<uint8>(color_values[1]),
35 static_cast<uint8>(color_values[2])}};
36 return common::make_unique<ColoringPointsProcessor>(
ToFloatColor(color),
41 const std::string& frame_id,
47 batch->colors.clear();
48 for (
size_t i = 0; i < batch->points.size(); ++i) {
49 batch->colors.push_back(
color_);
virtual void Process(std::unique_ptr< PointsBatch > points_batch)=0
std::string GetString(const std::string &key)
const std::string frame_id_
FloatColor ToFloatColor(const Uint8Color &color)
void Process(std::unique_ptr< PointsBatch > batch) override
FlushResult Flush() override
std::array< uint8, 3 > Uint8Color
std::array< float, 3 > FloatColor
virtual FlushResult Flush()=0
PointsProcessor *const next_
ColoringPointsProcessor(const FloatColor &color, const std::string &frame_id, PointsProcessor *next)
std::unique_ptr< LuaParameterDictionary > GetDictionary(const std::string &key)
static std::unique_ptr< ColoringPointsProcessor > FromDictionary(common::LuaParameterDictionary *dictionary, PointsProcessor *next)