Go to the documentation of this file.
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);
82 inline void setColor(uint8_t r, uint8_t g, uint8_t 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) {
144 uint8_t g, uint8_t b);
148 uint8_t g, uint8_t b) {
156 uint8_t g, uint8_t b);
160 uint8_t g, uint8_t b) {
std::string getTreeType() const
returns actual class name as string for identification
Definition: ColorOcTree.h:118
bool operator==(const Color &other) const
Definition: ColorOcTree.h:57
virtual bool isNodeCollapsible(const ColorOcTreeNode *node) const
A node is collapsible if all children exist, don't have children of their own and have the same occup...
Definition: ColorOcTree.cpp:127
void updateColorChildren()
Definition: ColorOcTree.cpp:85
Base implementation for Occupancy Octrees (e.g.
Definition: OccupancyOcTreeBase.h:69
ColorOcTree(double resolution)
Default constructor, sets resolution of leafs.
Definition: ColorOcTree.cpp:91
void setColor(uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.h:82
uint8_t b
Definition: ColorOcTree.h:63
virtual bool pruneNode(ColorOcTreeNode *node)
Prunes a node when it is collapsible.
Definition: ColorOcTree.cpp:107
void ensureLinking()
Dummy function to ensure that MSVC does not drop the StaticMemberInitializer, causing this tree faili...
Definition: ColorOcTree.h:195
ColorOcTreeNode * averageNodeColor(const OcTreeKey &key, uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.cpp:146
std::ostream & writeData(std::ostream &s) const
Definition: ColorOcTree.cpp:40
void setColor(Color c)
Definition: ColorOcTree.h:81
T value
stored data (payload)
Definition: OcTreeDataNode.h:128
ColorOcTreeNode * setNodeColor(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.h:134
ColorOcTreeNode()
Definition: ColorOcTree.h:67
Definition: ColorOcTree.h:108
void updateInnerOccupancy()
Definition: ColorOcTree.cpp:188
ColorOcTreeNode * integrateNodeColor(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.h:158
Static member object which ensures that this OcTree's prototype ends up in the classIDMapping only on...
Definition: ColorOcTree.h:182
Color color
Definition: ColorOcTree.h:103
Nodes to be used in OcTree.
Definition: OcTreeNode.h:55
Color & getColor()
Definition: ColorOcTree.h:86
static StaticMemberInitializer colorOcTreeMemberInit
static member to ensure static initialization (only once)
Definition: ColorOcTree.h:198
void copyData(const OcTreeDataNode &from)
Copy the payload (data in "value") from rhs into this node Opposed to copy ctor, this does not clone ...
Definition: OcTreeDataNode.hxx:73
Definition: ColorOcTree.h:48
ColorOcTreeNode * integrateNodeColor(const OcTreeKey &key, uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.cpp:163
bool operator!=(const Color &other) const
Definition: ColorOcTree.h:60
StaticMemberInitializer()
Definition: ColorOcTree.h:184
OcTreeKey is a container class for internal key addressing.
Definition: OcTreeKey.h:70
void copyData(const ColorOcTreeNode &from)
Definition: ColorOcTree.h:75
std::ostream & operator<<(std::ostream &out, ColorOcTreeNode::Color const &c)
user friendly output in format (r g b)
Definition: ColorOcTree.cpp:253
Color(uint8_t _r, uint8_t _g, uint8_t _b)
Definition: ColorOcTree.h:55
static void registerTreeType(AbstractOcTree *tree)
Definition: AbstractOcTree.cpp:205
Color getColor() const
Definition: ColorOcTree.h:80
bool isColorSet() const
Definition: ColorOcTree.h:89
void updateInnerOccupancyRecurs(ColorOcTreeNode *node, unsigned int depth)
Definition: ColorOcTree.cpp:192
void writeColorHistogram(std::string filename)
Definition: ColorOcTree.cpp:208
ColorOcTreeNode::Color getAverageChildColor() const
Definition: ColorOcTree.cpp:54
ColorOcTree * create() const
virtual constructor: creates a new object of same type (Covariant return type requires an up-to-date ...
Definition: ColorOcTree.h:116
ColorOcTreeNode(const ColorOcTreeNode &rhs)
Definition: ColorOcTree.h:69
ColorOcTreeNode * setNodeColor(const OcTreeKey &key, uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.cpp:96
Tables used by the Marching Cubes Algorithm The tables are from Paul Bourke's web page http://paulbou...
bool operator==(const ColorOcTreeNode &rhs) const
Definition: ColorOcTree.h:71
bool coordToKeyChecked(const point3d &coord, OcTreeKey &key) const
Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking.
Definition: OcTreeBaseImpl.hxx:340
uint8_t r
Definition: ColorOcTree.h:63
double resolution
in meters
Definition: OcTreeBaseImpl.h:547
void clearKeyRays()
Clear KeyRay vector to minimize unneeded memory.
Definition: OcTreeBaseImpl.h:120
octomath::Vector3 point3d
Use Vector3 (float precision) as a point3d in octomap.
Definition: octomap_types.h:49
ColorOcTreeNode * averageNodeColor(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b)
Definition: ColorOcTree.h:146
uint8_t g
Definition: ColorOcTree.h:63
Color()
Definition: ColorOcTree.h:54
std::istream & readData(std::istream &s)
Definition: ColorOcTree.cpp:47
Definition: ColorOcTree.h:52