TinyURDF 1.0.0
Loading...
Searching...
No Matches
color_parser.h
Go to the documentation of this file.
1#ifndef INCLUDE_TINYURDF_INTERNAL_COLOR_PARSER_H_
2#define INCLUDE_TINYURDF_INTERNAL_COLOR_PARSER_H_
3
4// Copyright 2025 Wissem CHIHA
5
7#include "core/color.h"
8#include "utility/utils.h"
9
10/***
11 * \brief Base parser for color description element
12 * \note This is an elementary base parser.
13 * \example <color rgba="1.0 0.01 0.0 1.0"/>
14 * \note There is no other acceptable format for color definition!
15 */
16class ColorParser final : public ParserBase<Color> {
17public:
19 std::string toString() const override;
20 bool empty() const override;
21 void clear() override;
22 const char* getTypename() const override;
23 bool isA(const char* name) const override;
24 void parse(const tinyxml2::XMLElement* xml) override;
25 std::shared_ptr<Color> get() override;
26private:
27 std::shared_ptr<Color> p_;
28};
29#endif // INCLUDE_TINYURDF_INTERNAL_COLOR_PARSER_H_
Definition color_parser.h:16
ColorParser()
Definition color_parser.cc:3
bool empty() const override
Definition color_parser.cc:15
void parse(const tinyxml2::XMLElement *xml) override
Definition color_parser.cc:31
const char * getTypename() const override
Definition color_parser.cc:23
std::string toString() const override
Definition color_parser.cc:7
bool isA(const char *name) const override
Definition color_parser.cc:27
void clear() override
Definition color_parser.cc:19
std::shared_ptr< Color > get() override
Definition color_parser.cc:37
Definition parser_base.h:12