34 #ifndef OCTOMAP_COLOR_OCTREE_H 35 #define OCTOMAP_COLOR_OCTREE_H 55 Color(uint8_t _r, uint8_t _g, uint8_t _b)
56 :
r(_r),
g(_g),
b(_b) {}
58 return (
r==other.
r &&
g==other.
g &&
b==other.
b);
61 return (
r!=other.
r ||
g!=other.
g ||
b!=other.
b);
99 std::istream&
readData(std::istream &s);
100 std::ostream&
writeData(std::ostream &s)
const;
132 uint8_t
g, uint8_t
b);
136 uint8_t g, uint8_t b) {
138 if (!this->coordToKeyChecked(
point3d(x,y,z), key))
return NULL;
139 return setNodeColor(key,r,g,b);
144 uint8_t g, uint8_t b);
148 uint8_t g, uint8_t b) {
150 if (!this->coordToKeyChecked(
point3d(x,y,z), key))
return NULL;
151 return averageNodeColor(key,r,g,b);
156 uint8_t g, uint8_t b);
160 uint8_t g, uint8_t b) {
162 if (!this->coordToKeyChecked(
point3d(x,y,z), key))
return NULL;
163 return integrateNodeColor(key,r,g,b);
167 void updateInnerOccupancy();
170 void writeColorHistogram(std::string filename);
173 void updateInnerOccupancyRecurs(
ColorOcTreeNode* node,
unsigned int depth);
static void registerTreeType(AbstractOcTree *tree)
T value
stored data (payload)
void setColor(uint8_t r, uint8_t g, uint8_t b)
void updateColorChildren()
ColorOcTree * create() const
bool operator!=(const Color &other) const
bool operator==(const Color &other) const
bool operator==(const ColorOcTreeNode &rhs) const
std::ostream & operator<<(std::ostream &out, ColorOcTreeNode::Color const &c)
user friendly output in format (r g b)
ColorOcTreeNode * averageNodeColor(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b)
ColorOcTreeNode::Color getAverageChildColor() const
std::string getTreeType() const
returns actual class name as string for identification
void copyData(const OcTreeDataNode &from)
ColorOcTreeNode * setNodeColor(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b)
octomath::Vector3 point3d
Use Vector3 (float precision) as a point3d in octomap.
Color(uint8_t _r, uint8_t _g, uint8_t _b)
StaticMemberInitializer()
std::ostream & writeData(std::ostream &s) const
std::istream & readData(std::istream &s)
static StaticMemberInitializer colorOcTreeMemberInit
static member to ensure static initialization (only once)
ColorOcTreeNode * integrateNodeColor(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b)
ColorOcTreeNode(const ColorOcTreeNode &rhs)
void copyData(const ColorOcTreeNode &from)