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::Vector3d& rotation,
166 bool ConvertToJsonValue(Json::Value& value)
const override;
167 bool ConvertFromJsonValue(
const Json::Value& value)
override;
171 double size_expand = 0.01);
174 std::shared_ptr<OctreeNode> root_node_ =
nullptr;
190 const Eigen::Vector3d& point,
191 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
192 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
198 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
199 const std::shared_ptr<OctreeNodeInfo>&)>&
205 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
206 const std::shared_ptr<OctreeNodeInfo>&)>&
209 std::pair<std::shared_ptr<OctreeLeafNode>, std::shared_ptr<OctreeNodeInfo>>
210 LocateLeafNode(
const Eigen::Vector3d& point)
const;
214 static bool IsPointInBound(
const Eigen::Vector3d& point,
215 const Eigen::Vector3d& origin,
219 bool operator==(
const Octree& other)
const;
222 std::shared_ptr<geometry::VoxelGrid> ToVoxelGrid()
const;
228 static void TraverseRecurse(
229 const std::shared_ptr<OctreeNode>& node,
230 const std::shared_ptr<OctreeNodeInfo>& node_info,
231 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
232 const std::shared_ptr<OctreeNodeInfo>&)>&
235 void InsertPointRecurse(
236 const std::shared_ptr<OctreeNode>& node,
237 const std::shared_ptr<OctreeNodeInfo>& node_info,
238 const Eigen::Vector3d& point,
239 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
240 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
OctreeNode()
Definition: Octree.h:70
OctreeNodeInfo()
Definition: Octree.h:46
Definition: Geometry.h:32
Definition: BoundingVolume.h:90
~OctreeNodeInfo()
Definition: Octree.h:55
OctreeInternalNode()
Definition: Octree.h:94
Definition: BoundingVolume.h:38
Definition: PointCloud.h:50
Octree(const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
Definition: Octree.h:141
RotationType
Definition: Geometry3D.h:43
int size
Definition: FilePCD.cpp:55
Eigen::Vector3d origin_
Definition: Octree.h:178
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
Definition: Geometry3D.h:41
size_t depth_
Definition: Octree.h:60
size_t max_depth_
Definition: Octree.h:186
size_t child_index_
Definition: Octree.h:61
Eigen::Vector3d color_
Definition: DownSample.cpp:80
std::vector< std::shared_ptr< OctreeNode > > children_
Definition: Octree.h:106
char type
Definition: FilePCD.cpp:56
double size_
Definition: Octree.h:182
Definition: PinholeCameraIntrinsic.cpp:34
virtual ~OctreeNode()
Definition: Octree.h:71
Definition: VoxelGrid.h:62
GeometryType
Definition: Geometry.h:34
double size_
Definition: Octree.h:59
~Octree() override
Definition: Octree.h:149
Eigen::Vector3d origin_
Definition: Octree.h:58
Definition: IJsonConvertible.h:42