50 const size_t& child_index)
74 static std::shared_ptr<OctreeNode> ConstructFromJsonValue(
75 const Json::Value& value);
95 static std::shared_ptr<OctreeNodeInfo> GetInsertionNodeInfo(
96 const std::shared_ptr<OctreeNodeInfo>& node_info,
97 const Eigen::Vector3d& point);
99 bool ConvertToJsonValue(Json::Value& value)
const override;
100 bool ConvertFromJsonValue(
const Json::Value& value)
override;
112 virtual std::shared_ptr<OctreeLeafNode> Clone()
const = 0;
118 std::shared_ptr<OctreeLeafNode> Clone()
const override;
119 static std::function<std::shared_ptr<OctreeLeafNode>()> GetInitFunction();
120 static std::function<void(std::shared_ptr<OctreeLeafNode>)>
121 GetUpdateFunction(
const Eigen::Vector3d& color);
123 bool ConvertToJsonValue(Json::Value& value)
const override;
124 bool ConvertFromJsonValue(
const Json::Value& value)
override;
126 Eigen::Vector3d
color_ = Eigen::Vector3d(0, 0, 0);
140 max_depth_(max_depth) {}
142 const Eigen::Vector3d&
origin,
147 max_depth_(max_depth) {}
153 bool IsEmpty()
const override;
154 Eigen::Vector3d GetMinBound()
const override;
155 Eigen::Vector3d GetMaxBound()
const override;
156 Eigen::Vector3d GetCenter()
const override;
159 Octree& Transform(
const Eigen::Matrix4d& transformation)
override;
160 Octree& Translate(
const Eigen::Vector3d& translation,
161 bool relative =
true)
override;
162 Octree& Scale(
const double scale,
bool center =
true)
override;
163 Octree& Rotate(
const Eigen::Matrix3d& R,
bool center =
true)
override;
164 bool ConvertToJsonValue(Json::Value& value)
const override;
165 bool ConvertFromJsonValue(
const Json::Value& value)
override;
169 double size_expand = 0.01);
172 std::shared_ptr<OctreeNode> root_node_ =
nullptr;
188 const Eigen::Vector3d& point,
189 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
190 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
196 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
197 const std::shared_ptr<OctreeNodeInfo>&)>&
203 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
204 const std::shared_ptr<OctreeNodeInfo>&)>&
207 std::pair<std::shared_ptr<OctreeLeafNode>, std::shared_ptr<OctreeNodeInfo>>
208 LocateLeafNode(
const Eigen::Vector3d& point)
const;
212 static bool IsPointInBound(
const Eigen::Vector3d& point,
213 const Eigen::Vector3d&
origin,
217 bool operator==(
const Octree& other)
const;
220 std::shared_ptr<geometry::VoxelGrid> ToVoxelGrid()
const;
226 static void TraverseRecurse(
227 const std::shared_ptr<OctreeNode>& node,
228 const std::shared_ptr<OctreeNodeInfo>& node_info,
229 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
230 const std::shared_ptr<OctreeNodeInfo>&)>&
233 void InsertPointRecurse(
234 const std::shared_ptr<OctreeNode>& node,
235 const std::shared_ptr<OctreeNodeInfo>& node_info,
236 const Eigen::Vector3d& point,
237 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
238 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
OctreeNode()
Definition: Octree.h:70
OctreeNodeInfo()
Definition: Octree.h:46
The base geometry class.
Definition: Geometry.h:35
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:130
~OctreeNodeInfo()
Definition: Octree.h:55
OctreeInternalNode()
Definition: Octree.h:94
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
Definition: PointCloud.h:50
Octree(const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
Definition: Octree.h:141
int size
Definition: FilePCD.cpp:56
Eigen::Vector3d origin_
Definition: Octree.h:176
Octree()
Definition: Octree.h:131
OctreeNodeInfo(const Eigen::Vector3d &origin, const double &size, const size_t &depth, const size_t &child_index)
Definition: Octree.h:47
Octree(const size_t &max_depth)
Definition: Octree.h:136
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
size_t depth_
Definition: Octree.h:60
size_t max_depth_
Definition: Octree.h:184
size_t child_index_
Definition: Octree.h:61
Eigen::Vector3d color_
Definition: DownSample.cpp:81
std::vector< std::shared_ptr< OctreeNode > > children_
Definition: Octree.h:106
double size_
Definition: Octree.h:180
Eigen::Vector3d origin
Definition: FilePLY.cpp:284
Definition: PinholeCameraIntrinsic.cpp:34
virtual ~OctreeNode()
Definition: Octree.h:71
Definition: VoxelGrid.h:65
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:40
double size_
Definition: Octree.h:59
~Octree() override
Definition: Octree.h:149
Eigen::Vector3d origin_
Definition: Octree.h:58
Definition: IJsonConvertible.h:42