ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvKdTree.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // cloudViewer
11 #include <TrueKdTree.h>
12 
13 // Local
14 #include "ecvHObject.h"
15 
16 // System
17 #include <unordered_set>
18 
20 
22 
25  public ccHObject {
26 public:
28 
30  explicit ccKdTree(ccGenericPointCloud* aCloud);
31 
33 
38  void multiplyBoundingBox(const PointCoordinateType multFactor);
39 
41 
45  void translateBoundingBox(const CCVector3& T);
46 
48  virtual CV_CLASS_ENUM getClassID() const override {
50  }
51 
52  // Inherited from ccHObject
53  virtual ccBBox getOwnBB(bool withGLFeatures = false) override;
54 
56  bool convertCellIndexToSF();
58  bool convertCellIndexToRandomColor();
59 
61  ccBBox getCellBBox(BaseNode* node) const;
62 
64  typedef std::unordered_set<Leaf*> LeafSet;
65 
67  bool getNeighborLeaves(BaseNode* cell,
68  ccKdTree::LeafSet& neighbors,
69  const int* userDataFilter = 0);
70 
73  return m_associatedGenericCloud;
74  }
75 
76 protected:
77  // Inherited from ccHObject
78  virtual void drawMeOnly(CC_DRAW_CONTEXT& context) override;
79 
82 };
ccKdTree
KD-tree structure.
Definition: ecvKdTree.h:24
ccKdTree::getClassID
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvKdTree.h:48
ccKdTree::LeafSet
std::unordered_set< Leaf * > LeafSet
A set of leaves.
Definition: ecvKdTree.h:64
ccKdTree::m_associatedGenericCloud
ccGenericPointCloud * m_associatedGenericCloud
Associated cloud.
Definition: ecvKdTree.h:81
ccBBox
Bounding box structure.
Definition: ecvBBox.h:25
TrueKdTree.h
CV_CLASS_ENUM
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
context
ImGuiContext * context
Definition: Window.cpp:76
ccGenericPointCloud
A 3D cloud interface with associated features (color, normals, octree, etc.)
Definition: ecvGenericPointCloud.h:45
ccKdTree::associatedGenericCloud
ccGenericPointCloud * associatedGenericCloud() const
Returns associated (generic) point cloud.
Definition: ecvKdTree.h:72
Vector3Tpl< PointCoordinateType >
cloudViewer::TrueKdTree::BaseNode
Tree base node.
Definition: TrueKdTree.h:33
CV_TYPES::POINT_KDTREE
@ POINT_KDTREE
Definition: CVTypes.h:111
cloudViewer::TrueKdTree
Proper KD-tree implementation.
Definition: TrueKdTree.h:23
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
ccHObject::getOwnBB
virtual ccBBox getOwnBB(bool withGLFeatures=false)
Returns the entity's own bounding-box.
Definition: ecvHObject.cpp:757
CV_DB_LIB_API
#define CV_DB_LIB_API
Definition: CV_db.h:15
ccGLDrawContext
Display context.
Definition: ecvDrawContext.h:365
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
ecvHObject.h
ccHObject::drawMeOnly
virtual void drawMeOnly(CC_DRAW_CONTEXT &context)
Draws the entity only (not its children)
Definition: ecvHObject.h:655