Open3D (C++ API)
Public Member Functions | Static Public Member Functions | Data Fields
open3d::geometry::Octree Class Reference

#include <Octree.h>

Inheritance diagram for open3d::geometry::Octree:
open3d::geometry::Geometry3D open3d::utility::IJsonConvertible open3d::geometry::Geometry

Public Member Functions

 Octree ()
 
 Octree (const size_t &max_depth)
 
 Octree (const size_t &max_depth, const Eigen::Vector3d &origin, const double &size)
 
 Octree (const Octree &src_octree)
 
 ~Octree () override
 
void Clear () override
 
bool IsEmpty () const override
 
Eigen::Vector3d GetMinBound () const override
 
Eigen::Vector3d GetMaxBound () const override
 
OctreeTransform (const Eigen::Matrix4d &transformation) override
 
OctreeTranslate (const Eigen::Vector3d &translation) override
 
OctreeScale (const double scale, bool center=true) override
 
OctreeRotate (const Eigen::Vector3d &rotation, bool center=true, RotationType type=RotationType::XYZ) override
 
bool ConvertToJsonValue (Json::Value &value) const override
 
bool ConvertFromJsonValue (const Json::Value &value) override
 
void ConvertFromPointCloud (const geometry::PointCloud &point_cloud, double size_expand=0.01)
 
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. More...
 
void Traverse (const std::function< void(const std::shared_ptr< OctreeNode > &, const std::shared_ptr< OctreeNodeInfo > &)> &f)
 
void Traverse (const std::function< void(const std::shared_ptr< OctreeNode > &, const std::shared_ptr< OctreeNodeInfo > &)> &f) const
 
std::pair< std::shared_ptr< OctreeLeafNode >, std::shared_ptr< OctreeNodeInfo > > LocateLeafNode (const Eigen::Vector3d &point) const
 
bool operator== (const Octree &other) const
 Returns true if the Octree is completely the same, used for testing. More...
 
std::shared_ptr< geometry::VoxelGridToVoxelGrid () const
 Convert to voxel grid. More...
 
void FromVoxelGrid (const geometry::VoxelGrid &voxel_grid)
 Convert from voxel grid. More...
 
- Public Member Functions inherited from open3d::geometry::Geometry3D
 ~Geometry3D () override
 
- Public Member Functions inherited from open3d::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 
int Dimension () const
 
- Public Member Functions inherited from open3d::utility::IJsonConvertible
virtual ~IJsonConvertible ()
 

Static Public Member Functions

static bool IsPointInBound (const Eigen::Vector3d &point, const Eigen::Vector3d &origin, const double &size)
 
- Static Public Member Functions inherited from open3d::utility::IJsonConvertible
static bool EigenVector3dFromJsonArray (Eigen::Vector3d &vec, const Json::Value &value)
 
static bool EigenVector3dToJsonArray (const Eigen::Vector3d &vec, Json::Value &value)
 
static bool EigenVector4dFromJsonArray (Eigen::Vector4d &vec, const Json::Value &value)
 
static bool EigenVector4dToJsonArray (const Eigen::Vector4d &vec, Json::Value &value)
 
static bool EigenMatrix3dFromJsonArray (Eigen::Matrix3d &mat, const Json::Value &value)
 
static bool EigenMatrix3dToJsonArray (const Eigen::Matrix3d &mat, Json::Value &value)
 
static bool EigenMatrix4dFromJsonArray (Eigen::Matrix4d &mat, const Json::Value &value)
 
static bool EigenMatrix4dToJsonArray (const Eigen::Matrix4d &mat, Json::Value &value)
 
static bool EigenMatrix4dFromJsonArray (Eigen::Matrix4d_u &mat, const Json::Value &value)
 
static bool EigenMatrix4dToJsonArray (const Eigen::Matrix4d_u &mat, Json::Value &value)
 
static bool EigenMatrix6dFromJsonArray (Eigen::Matrix6d &mat, const Json::Value &value)
 
static bool EigenMatrix6dToJsonArray (const Eigen::Matrix6d &mat, Json::Value &value)
 
static bool EigenMatrix6dFromJsonArray (Eigen::Matrix6d_u &mat, const Json::Value &value)
 
static bool EigenMatrix6dToJsonArray (const Eigen::Matrix6d_u &mat, Json::Value &value)
 

Data Fields

std::shared_ptr< OctreeNoderoot_node_ = nullptr
 Root of the octree. More...
 
Eigen::Vector3d origin_ = Eigen::Vector3d(0, 0, 0)
 
double size_ = 0
 
size_t max_depth_ = 0
 

Additional Inherited Members

- Public Types inherited from open3d::geometry::Geometry3D
enum  RotationType {
  RotationType::XYZ, RotationType::YZX, RotationType::ZXY, RotationType::XZY,
  RotationType::ZYX, RotationType::YXZ, RotationType::AxisAngle
}
 
- Public Types inherited from open3d::geometry::Geometry
enum  GeometryType {
  GeometryType::Unspecified = 0, GeometryType::PointCloud = 1, GeometryType::VoxelGrid = 2, GeometryType::Octree = 3,
  GeometryType::LineSet = 4, GeometryType::TriangleMesh = 5, GeometryType::HalfEdgeTriangleMesh = 6, GeometryType::Image = 7
}
 
- Protected Member Functions inherited from open3d::geometry::Geometry3D
 Geometry3D (GeometryType type)
 
Eigen::Matrix3d GetRotationMatrix (const Eigen::Vector3d &rotation, RotationType type=RotationType::XYZ) const
 
- Protected Member Functions inherited from open3d::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 

Constructor & Destructor Documentation

◆ Octree() [1/4]

open3d::geometry::Octree::Octree ( )
inline

◆ Octree() [2/4]

open3d::geometry::Octree::Octree ( const size_t &  max_depth)
inline

◆ Octree() [3/4]

open3d::geometry::Octree::Octree ( const size_t &  max_depth,
const Eigen::Vector3d &  origin,
const double &  size 
)
inline

◆ Octree() [4/4]

open3d::geometry::Octree::Octree ( const Octree src_octree)

◆ ~Octree()

open3d::geometry::Octree::~Octree ( )
inlineoverride

Member Function Documentation

◆ Clear()

void open3d::geometry::Octree::Clear ( )
overridevirtual

◆ ConvertFromJsonValue()

bool open3d::geometry::Octree::ConvertFromJsonValue ( const Json::Value &  value)
overridevirtual

◆ ConvertFromPointCloud()

void open3d::geometry::Octree::ConvertFromPointCloud ( const geometry::PointCloud point_cloud,
double  size_expand = 0.01 
)

◆ ConvertToJsonValue()

bool open3d::geometry::Octree::ConvertToJsonValue ( Json::Value &  value) const
overridevirtual

◆ FromVoxelGrid()

void open3d::geometry::Octree::FromVoxelGrid ( const geometry::VoxelGrid voxel_grid)

Convert from voxel grid.

◆ GetMaxBound()

Eigen::Vector3d open3d::geometry::Octree::GetMaxBound ( ) const
overridevirtual

◆ GetMinBound()

Eigen::Vector3d open3d::geometry::Octree::GetMinBound ( ) const
overridevirtual

◆ InsertPoint()

void open3d::geometry::Octree::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.

◆ IsEmpty()

bool open3d::geometry::Octree::IsEmpty ( ) const
overridevirtual

◆ IsPointInBound()

bool open3d::geometry::Octree::IsPointInBound ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  origin,
const double &  size 
)
static

Return true if point within bound, that is, origin <= point < origin + size

◆ LocateLeafNode()

std::pair< std::shared_ptr< OctreeLeafNode >, std::shared_ptr< OctreeNodeInfo > > open3d::geometry::Octree::LocateLeafNode ( const Eigen::Vector3d &  point) const

◆ operator==()

bool open3d::geometry::Octree::operator== ( const Octree other) const

Returns true if the Octree is completely the same, used for testing.

◆ Rotate()

Octree & open3d::geometry::Octree::Rotate ( const Eigen::Vector3d &  rotation,
bool  center = true,
RotationType  type = RotationType::XYZ 
)
overridevirtual

◆ Scale()

Octree & open3d::geometry::Octree::Scale ( const double  scale,
bool  center = true 
)
overridevirtual

◆ ToVoxelGrid()

std::shared_ptr< geometry::VoxelGrid > open3d::geometry::Octree::ToVoxelGrid ( ) const

Convert to voxel grid.

◆ Transform()

Octree & open3d::geometry::Octree::Transform ( const Eigen::Matrix4d &  transformation)
overridevirtual

◆ Translate()

Octree & open3d::geometry::Octree::Translate ( const Eigen::Vector3d &  translation)
overridevirtual

◆ Traverse() [1/2]

void open3d::geometry::Octree::Traverse ( const std::function< void(const std::shared_ptr< OctreeNode > &, const std::shared_ptr< OctreeNodeInfo > &)> &  f)

DFS traversal of Octree from the root, with callback function called for each node

◆ Traverse() [2/2]

void open3d::geometry::Octree::Traverse ( const std::function< void(const std::shared_ptr< OctreeNode > &, const std::shared_ptr< OctreeNodeInfo > &)> &  f) const

Const version of Traverse. DFS traversal of Octree from the root, with callback function called for each node

Field Documentation

◆ max_depth_

size_t open3d::geometry::Octree::max_depth_ = 0

Max depth of octree. The depth is defined as the distance from the deepest leaf node to root. A tree with only the root node has depth 0.

◆ origin_

Eigen::Vector3d open3d::geometry::Octree::origin_ = Eigen::Vector3d(0, 0, 0)

Global min bound (include). A point is within bound iff origin_ <= point < origin_ + size_

◆ root_node_

std::shared_ptr<OctreeNode> open3d::geometry::Octree::root_node_ = nullptr

Root of the octree.

◆ size_

double open3d::geometry::Octree::size_ = 0

Outer bounding box edge size for the whole octree. A point is within bound iff origin_ <= point < origin_ + size_


The documentation for this class was generated from the following files: