50 const size_t& child_index)
58 Eigen::Vector3d
origin_ = Eigen::Vector3d(0, 0, 0);
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);
135 const Eigen::Vector3d& origin,
138 max_depth_(max_depth),
145 void Clear()
override;
146 bool IsEmpty()
const override;
147 Eigen::Vector3d GetMinBound()
const override;
148 Eigen::Vector3d GetMaxBound()
const override;
149 Octree& Transform(
const Eigen::Matrix4d& transformation)
override;
150 Octree& Translate(
const Eigen::Vector3d& translation)
override;
151 Octree& Scale(
const double scale,
bool center =
true)
override;
152 Octree& Rotate(
const Eigen::Vector3d& rotation,
155 bool ConvertToJsonValue(Json::Value& value)
const override;
156 bool ConvertFromJsonValue(
const Json::Value& value)
override;
160 double size_expand = 0.01);
163 std::shared_ptr<OctreeNode> root_node_ =
nullptr;
167 Eigen::Vector3d
origin_ = Eigen::Vector3d(0, 0, 0);
175 size_t max_depth_ = 0;
179 const Eigen::Vector3d& point,
180 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
181 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
187 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
188 const std::shared_ptr<OctreeNodeInfo>&)>&
194 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
195 const std::shared_ptr<OctreeNodeInfo>&)>&
198 std::pair<std::shared_ptr<OctreeLeafNode>, std::shared_ptr<OctreeNodeInfo>>
199 LocateLeafNode(
const Eigen::Vector3d& point)
const;
203 static bool IsPointInBound(
const Eigen::Vector3d& point,
204 const Eigen::Vector3d& origin,
208 bool operator==(
const Octree& other)
const;
211 std::shared_ptr<geometry::VoxelGrid> ToVoxelGrid()
const;
217 static void TraverseRecurse(
218 const std::shared_ptr<OctreeNode>& node,
219 const std::shared_ptr<OctreeNodeInfo>& node_info,
220 const std::function<
void(
const std::shared_ptr<OctreeNode>&,
221 const std::shared_ptr<OctreeNodeInfo>&)>&
224 void InsertPointRecurse(
225 const std::shared_ptr<OctreeNode>& node,
226 const std::shared_ptr<OctreeNodeInfo>& node_info,
227 const Eigen::Vector3d& point,
228 const std::function<std::shared_ptr<OctreeLeafNode>()>& f_init,
229 const std::function<
void(std::shared_ptr<OctreeLeafNode>)>&
OctreeNode()
Definition: Octree.h:70
OctreeNodeInfo()
Definition: Octree.h:46
Definition: Geometry.h:32
~OctreeNodeInfo()
Definition: Octree.h:55
OctreeInternalNode()
Definition: Octree.h:94
Definition: PointCloud.h:49
Octree(const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
Definition: Octree.h:134
RotationType
Definition: Geometry3D.h:40
int size
Definition: FilePCD.cpp:55
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:132
Definition: Geometry3D.h:38
size_t depth_
Definition: Octree.h:60
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
Definition: PinholeCameraIntrinsic.cpp:34
virtual ~OctreeNode()
Definition: Octree.h:71
Definition: VoxelGrid.h:55
GeometryType
Definition: Geometry.h:34
double size_
Definition: Octree.h:59
~Octree() override
Definition: Octree.h:142
Eigen::Vector3d origin_
Definition: Octree.h:58
Definition: IJsonConvertible.h:42