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 };
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
#define CV_DB_LIB_API
Definition: CV_db.h:15
Bounding box structure.
Definition: ecvBBox.h:25
A 3D cloud interface with associated features (color, normals, octree, etc.)
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
virtual void drawMeOnly(CC_DRAW_CONTEXT &context)
Draws the entity only (not its children)
Definition: ecvHObject.h:655
virtual ccBBox getOwnBB(bool withGLFeatures=false)
Returns the entity's own bounding-box.
Definition: ecvHObject.cpp:757
KD-tree structure.
Definition: ecvKdTree.h:25
std::unordered_set< Leaf * > LeafSet
A set of leaves.
Definition: ecvKdTree.h:64
ccGenericPointCloud * m_associatedGenericCloud
Associated cloud.
Definition: ecvKdTree.h:81
ccGenericPointCloud * associatedGenericCloud() const
Returns associated (generic) point cloud.
Definition: ecvKdTree.h:72
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvKdTree.h:48
Proper KD-tree implementation.
Definition: TrueKdTree.h:23
ImGuiContext * context
Definition: Window.cpp:76
@ POINT_KDTREE
Definition: CVTypes.h:111
Display context.