Go to the documentation of this file.
50 const size_t& child_index)
75 const Json::Value& value);
96 const std::shared_ptr<OctreeNodeInfo>& node_info,
97 const Eigen::Vector3d& point);
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>)>
126 Eigen::Vector3d
color_ = Eigen::Vector3d(0, 0, 0);
142 const Eigen::Vector3d&
origin,
156 Eigen::Vector3d
GetCenter()
const override;
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;
169 double size_expand = 0.01);
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>>
213 const Eigen::Vector3d&
origin,
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>)>&
void ConvertFromPointCloud(const geometry::PointCloud &point_cloud, double size_expand=0.01)
Definition: Octree.cpp:392
virtual std::shared_ptr< OctreeLeafNode > Clone() const =0
static std::shared_ptr< OctreeNodeInfo > GetInsertionNodeInfo(const std::shared_ptr< OctreeNodeInfo > &node_info, const Eigen::Vector3d &point)
Definition: Octree.cpp:66
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: Octree.cpp:589
std::shared_ptr< OctreeNode > root_node_
Root of the octree.
Definition: Octree.h:172
virtual bool operator==(const OctreeLeafNode &other) const =0
static bool IsPointInBound(const Eigen::Vector3d &point, const Eigen::Vector3d &origin, const double &size)
Definition: Octree.cpp:484
static std::function< std::shared_ptr< OctreeLeafNode >)> GetInitFunction()
Definition: Octree.cpp:126
OrientedBoundingBox GetOrientedBoundingBox() const override
Returns an oriented bounding box of the geometry.
Definition: Octree.cpp:367
bool operator==(const Octree &other) const
Returns true if the Octree is completely the same, used for testing.
Definition: Octree.cpp:236
static std::shared_ptr< OctreeNode > ConstructFromJsonValue(const Json::Value &value)
Factory function to construct an OctreeNode by parsing the json value.
Definition: Octree.cpp:42
OctreeInternalNode()
Definition: Octree.h:94
bool operator==(const OctreeLeafNode &other) const override
Definition: Octree.cpp:154
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:130
Octree(const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
Definition: Octree.h:141
Octree & Rotate(const Eigen::Matrix3d &R, bool center=true) override
Apply rotation to the geometry coordinates and normals.
Definition: Octree.cpp:387
OctreeNode()
Definition: Octree.h:70
std::pair< std::shared_ptr< OctreeLeafNode >, std::shared_ptr< OctreeNodeInfo > > LocateLeafNode(const Eigen::Vector3d &point) const
Definition: Octree.cpp:546
double size_
Definition: Octree.h:59
std::vector< std::shared_ptr< OctreeNode > > children_
Definition: Octree.h:106
The base geometry class.
Definition: Geometry.h:35
Octree(const size_t &max_depth)
Definition: Octree.h:136
virtual ~OctreeNode()
Definition: Octree.h:71
size_t child_index_
Definition: Octree.h:61
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
const char const char value recording_handle imu_sample void
Definition: K4aPlugin.cpp:255
Octree & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
Definition: Octree.cpp:377
std::shared_ptr< OctreeLeafNode > Clone() const override
Definition: Octree.cpp:148
Eigen::Vector3d origin_
Definition: Octree.h:176
size_t max_depth_
Definition: Octree.h:184
Octree()
Definition: Octree.h:131
bool ConvertToJsonValue(Json::Value &value) const override
Definition: Octree.cpp:575
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:40
int size
Definition: FilePCD.cpp:56
bool ConvertToJsonValue(Json::Value &value) const override
Definition: Octree.cpp:89
void CreateFromVoxelGrid(const geometry::VoxelGrid &voxel_grid)
Convert from voxel grid.
Definition: Octree.cpp:610
double size_
Definition: Octree.h:180
OctreeNodeInfo(const Eigen::Vector3d &origin, const double &size, const size_t &depth, const size_t &child_index)
Definition: Octree.h:47
bool ConvertToJsonValue(Json::Value &value) const override
Definition: Octree.cpp:164
Definition: PointCloud.h:50
Eigen::Vector3d origin
Definition: FilePLY.cpp:284
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: Octree.cpp:169
void Traverse(const std::function< void(const std::shared_ptr< OctreeNode > &, const std::shared_ptr< OctreeNodeInfo > &)> &f)
Definition: Octree.cpp:492
Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
Definition: Octree.cpp:348
Eigen::Vector3d origin_
Definition: Octree.h:58
std::shared_ptr< geometry::VoxelGrid > ToVoxelGrid() const
Convert to voxel grid.
Definition: Octree.cpp:569
Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
Definition: Octree.cpp:340
Definition: PinholeCameraIntrinsic.cpp:34
size_t depth_
Definition: Octree.h:60
~Octree() override
Definition: Octree.h:149
bool IsEmpty() const override
Returns true iff the geometry is empty.
Definition: Octree.cpp:338
Eigen::Vector3d color_
Definition: Octree.h:126
static std::function< void(std::shared_ptr< OctreeLeafNode >)> GetUpdateFunction(const Eigen::Vector3d &color)
Definition: Octree.cpp:133
Octree & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
Definition: Octree.cpp:372
void InsertPoint(const Eigen::Vector3d &point, const std::function< std::shared_ptr< OctreeLeafNode >()> &f_init, const std::function< void(std::shared_ptr< OctreeLeafNode >)> &f_update)
Insert point.
Definition: Octree.cpp:421
AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const override
Returns an axis-aligned bounding box of the geometry.
Definition: Octree.cpp:360
Definition: VoxelGrid.h:65
Definition: IJsonConvertible.h:42
Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
Definition: Octree.cpp:356
Octree & Scale(const double scale, bool center=true) override
Apply scaling to the geometry coordinates.
Definition: Octree.cpp:382
Octree & Clear() override
Clear all elements in the geometry.
Definition: Octree.cpp:330
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: Octree.cpp:105
OctreeNodeInfo()
Definition: Octree.h:46
~OctreeNodeInfo()
Definition: Octree.h:55