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);
132 static std::function<std::shared_ptr<OctreeInternalNode>()>
138 static std::function<void(std::shared_ptr<OctreeInternalNode>)>
141 bool ConvertToJsonValue(Json::Value& value)
const override;
142 bool ConvertFromJsonValue(
const Json::Value& value)
override;
166 static std::function<std::shared_ptr<OctreeInternalNode>()>
173 static std::function<void(std::shared_ptr<OctreeInternalNode>)>
174 GetUpdateFunction(
size_t idx);
176 bool ConvertToJsonValue(Json::Value& value)
const override;
177 bool ConvertFromJsonValue(
const Json::Value& value)
override;
191 virtual std::shared_ptr<OctreeLeafNode> Clone()
const = 0;
202 std::shared_ptr<OctreeLeafNode> Clone()
const override;
208 static std::function<std::shared_ptr<OctreeLeafNode>()> GetInitFunction();
216 static std::function<void(std::shared_ptr<OctreeLeafNode>)>
217 GetUpdateFunction(
const Eigen::Vector3d&
color);
219 bool ConvertToJsonValue(Json::Value& value)
const override;
220 bool ConvertFromJsonValue(
const Json::Value& value)
override;
223 Eigen::Vector3d
color_ = Eigen::Vector3d(0, 0, 0);
235 std::shared_ptr<OctreeLeafNode> Clone()
const override;
241 static std::function<std::shared_ptr<OctreeLeafNode>()> GetInitFunction();
250 static std::function<void(std::shared_ptr<OctreeLeafNode>)>
251 GetUpdateFunction(
size_t index,
const Eigen::Vector3d&
color);
253 bool ConvertToJsonValue(Json::Value& value)
const override;
254 bool ConvertFromJsonValue(
const Json::Value& value)
override;
278 max_depth_(max_depth) {}
285 const Eigen::Vector3d& origin,
290 max_depth_(max_depth) {}
296 bool IsEmpty()
const override;
297 Eigen::Vector3d GetMinBound()
const override;
298 Eigen::Vector3d GetMaxBound()
const override;
299 Eigen::Vector3d GetCenter()
const override;
302 Octree& Transform(
const Eigen::Matrix4d& transformation)
override;
303 Octree& Translate(
const Eigen::Vector3d& translation,
304 bool relative =
true)
override;
305 Octree& Scale(
const double scale,
const Eigen::Vector3d& center)
override;
306 Octree& Rotate(
const Eigen::Matrix3d& R,
307 const Eigen::Vector3d& center)
override;
308 bool ConvertToJsonValue(Json::Value& value)
const override;
309 bool ConvertFromJsonValue(
const Json::Value& value)
override;
319 double size_expand = 0.01);
322 std::shared_ptr<OctreeNode> root_node_ =
nullptr;
350 const Eigen::Vector3d& point,
351 const std::function<std::shared_ptr<OctreeLeafNode>()>& fl_init,
352 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
354 const std::function<std::shared_ptr<OctreeInternalNode>()>&
356 const std::function<
void(std::shared_ptr<OctreeInternalNode>)>&
357 fi_update =
nullptr);
367 const std::function<
bool(
const std::shared_ptr<OctreeNode>&,
368 const std::shared_ptr<OctreeNodeInfo>&)>&
379 const std::function<
bool(
const std::shared_ptr<OctreeNode>&,
380 const std::shared_ptr<OctreeNodeInfo>&)>&
383 std::pair<std::shared_ptr<OctreeLeafNode>, std::shared_ptr<OctreeNodeInfo>>
389 LocateLeafNode(
const Eigen::Vector3d& point)
const;
397 static bool IsPointInBound(
const Eigen::Vector3d& point,
398 const Eigen::Vector3d& origin,
405 std::shared_ptr<geometry::VoxelGrid> ToVoxelGrid()
const;
411 static void TraverseRecurse(
412 const std::shared_ptr<OctreeNode>& node,
413 const std::shared_ptr<OctreeNodeInfo>& node_info,
414 const std::function<
bool(
const std::shared_ptr<OctreeNode>&,
415 const std::shared_ptr<OctreeNodeInfo>&)>&
418 void InsertPointRecurse(
419 const std::shared_ptr<OctreeNode>& node,
420 const std::shared_ptr<OctreeNodeInfo>& node_info,
421 const Eigen::Vector3d& point,
422 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_l_init,
423 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
425 const std::function<std::shared_ptr<OctreeInternalNode>()>&
427 const std::function<
void(std::shared_ptr<OctreeInternalNode>)>&
Eigen::Vector3d color_
Definition: PointCloud.cpp:244
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:187
std::vector< size_t > indices_
Indices of points associated with any children of this node.
Definition: Octree.h:181
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:150
OctreeInternalPointNode()
Default Constructor.
Definition: Octree.h:160
~OctreeNodeInfo()
Definition: Octree.h:68
std::vector< size_t > indices_
Associated point indices with this node.
Definition: Octree.h:257
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
OctreeInternalPointNode class is an OctreeInternalNode containing a list of indices which is the unio...
Definition: Octree.h:156
Octree(const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
Parameterized Constructor.
Definition: Octree.h:284
int size
Definition: FilePCD.cpp:59
Eigen::Vector3d origin_
Definition: Octree.h:326
math::float4 color
Definition: LineSetBuffers.cpp:64
OctreeColorLeafNode class is an OctreeLeafNode containing color.
Definition: Octree.h:197
Octree()
Default Constructor.
Definition: Octree.h:266
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:274
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:334
size_t child_index_
Definition: Octree.h:79
std::vector< std::shared_ptr< OctreeNode > > children_
Definition: Octree.h:149
double size_
Definition: Octree.h:330
OctreePointColorLeafNode class is an OctreeColorLeafNode containing a list of indices corresponding t...
Definition: Octree.h:231
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:263
double size_
Size of the node.
Definition: Octree.h:74
~Octree() override
Definition: Octree.h:292
OctreeNode's information.
Definition: Octree.h:47
Eigen::Vector3d origin_
Origin coordinate of the node.
Definition: Octree.h:72
Definition: IJsonConvertible.h:57