63 const size_t& child_index)
97 static std::shared_ptr<OctreeNode> ConstructFromJsonValue(
98 const Json::Value& value);
124 static std::shared_ptr<OctreeNodeInfo> GetInsertionNodeInfo(
125 const std::shared_ptr<OctreeNodeInfo>& node_info,
126 const Eigen::Vector3d& point);
128 bool ConvertToJsonValue(Json::Value& value)
const override;
129 bool ConvertFromJsonValue(
const Json::Value& value)
override;
146 virtual std::shared_ptr<OctreeLeafNode> Clone()
const = 0;
156 std::shared_ptr<OctreeLeafNode> Clone()
const override;
161 static std::function<std::shared_ptr<OctreeLeafNode>()> GetInitFunction();
162 static std::function<void(std::shared_ptr<OctreeLeafNode>)>
169 GetUpdateFunction(
const Eigen::Vector3d&
color);
171 bool ConvertToJsonValue(Json::Value& value)
const override;
172 bool ConvertFromJsonValue(
const Json::Value& value)
override;
175 Eigen::Vector3d
color_ = Eigen::Vector3d(0, 0, 0);
196 max_depth_(max_depth) {}
203 const Eigen::Vector3d& origin,
208 max_depth_(max_depth) {}
214 bool IsEmpty()
const override;
215 Eigen::Vector3d GetMinBound()
const override;
216 Eigen::Vector3d GetMaxBound()
const override;
217 Eigen::Vector3d GetCenter()
const override;
220 Octree& Transform(
const Eigen::Matrix4d& transformation)
override;
221 Octree& Translate(
const Eigen::Vector3d& translation,
222 bool relative =
true)
override;
223 Octree& Scale(
const double scale,
const Eigen::Vector3d& center)
override;
224 Octree& Rotate(
const Eigen::Matrix3d& R,
225 const Eigen::Vector3d& center)
override;
226 bool ConvertToJsonValue(Json::Value& value)
const override;
227 bool ConvertFromJsonValue(
const Json::Value& value)
override;
237 double size_expand = 0.01);
240 std::shared_ptr<OctreeNode> root_node_ =
nullptr;
258 const Eigen::Vector3d& point,
259 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
260 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
266 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
267 const std::shared_ptr<OctreeNodeInfo>&)>&
273 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
274 const std::shared_ptr<OctreeNodeInfo>&)>&
277 std::pair<std::shared_ptr<OctreeLeafNode>, std::shared_ptr<OctreeNodeInfo>>
283 LocateLeafNode(
const Eigen::Vector3d& point)
const;
291 static bool IsPointInBound(
const Eigen::Vector3d& point,
292 const Eigen::Vector3d& origin,
299 std::shared_ptr<geometry::VoxelGrid> ToVoxelGrid()
const;
305 static void TraverseRecurse(
306 const std::shared_ptr<OctreeNode>& node,
307 const std::shared_ptr<OctreeNodeInfo>& node_info,
308 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
309 const std::shared_ptr<OctreeNodeInfo>&)>&
312 void InsertPointRecurse(
313 const std::shared_ptr<OctreeNode>& node,
314 const std::shared_ptr<OctreeNodeInfo>& node_info,
315 const Eigen::Vector3d& point,
316 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
317 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
Eigen::Vector3d color_
Definition: PointCloud.cpp:242
OctreeNode()
Default Constructor.
Definition: Octree.h:93
OctreeNodeInfo()
Default Constructor.
Definition: Octree.h:52
OctreeInternalNode class, containing OctreeNode children.
Definition: Octree.h:119
The base geometry class.
Definition: Geometry.h:37
OctreeLeafNode base class.
Definition: Octree.h:142
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:149
~OctreeNodeInfo()
Definition: Octree.h:68
bool operator==(const PointXYZ A, const PointXYZ B)
Definition: Cloud.h:151
OctreeInternalNode()
Default Constructor.
Definition: Octree.h:123
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:54
Octree(const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
Parameterized Constructor.
Definition: Octree.h:202
int size
Definition: FilePCD.cpp:59
Eigen::Vector3d origin_
Definition: Octree.h:244
math::float4 color
Definition: LineSetBuffers.cpp:63
OctreeColorLeafNode class is an OctreeLeafNode containing color.
Definition: Octree.h:152
Octree()
Default Constructor.
Definition: Octree.h:184
OctreeNodeInfo(const Eigen::Vector3d &origin, const double &size, const size_t &depth, const size_t &child_index)
Parameterized Constructor.
Definition: Octree.h:60
Octree(const size_t &max_depth)
Parameterized Constructor.
Definition: Octree.h:192
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
size_t depth_
Depth of the node to the root. The root is of depth 0.
Definition: Octree.h:76
size_t max_depth_
Definition: Octree.h:252
size_t child_index_
Definition: Octree.h:79
std::vector< std::shared_ptr< OctreeNode > > children_
List of children Nodes.
Definition: Octree.h:136
double size_
Definition: Octree.h:248
The base class for octree node.
Definition: Octree.h:89
Definition: PinholeCameraIntrinsic.cpp:35
virtual ~OctreeNode()
Definition: Octree.h:94
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:80
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:42
Octree datastructure.
Definition: Octree.h:181
double size_
Size of the node.
Definition: Octree.h:74
~Octree() override
Definition: Octree.h:210
OctreeNode's information.
Definition: Octree.h:47
Eigen::Vector3d origin_
Origin coordinate of the node.
Definition: Octree.h:72
Definition: IJsonConvertible.h:44