tesseract v5.3.3.20231005
tesseract::KDNODE Struct Reference

#include <kdtree.h>

Public Member Functions

 KDNODE ()=default
 
 KDNODE (KDTREE *tree, float key[], CLUSTER *data, int Index)
 
 ~KDNODE ()
 

Public Attributes

float * Key
 
CLUSTERData
 
float BranchPoint
 
float LeftBranch
 
float RightBranch
 
KDNODELeft
 
KDNODERight
 

Detailed Description

Definition at line 41 of file kdtree.h.

Constructor & Destructor Documentation

◆ KDNODE() [1/2]

tesseract::KDNODE::KDNODE ( )
default

This routine allocates memory for a new K-D tree node and places the specified Key and Data into it. The left and right subtree pointers for the node are initialized to empty subtrees.

Parameters
treeThe tree to create the node for
KeyAccess key for new node in KD tree
Dataptr to data to be stored in new node
Indexindex of Key to branch on

◆ KDNODE() [2/2]

tesseract::KDNODE::KDNODE ( KDTREE tree,
float  key[],
CLUSTER data,
int  Index 
)
inline

Definition at line 85 of file kdtree.h.

85 {
86 Key = key;
87 Data = data;
88 BranchPoint = Key[Index];
89 LeftBranch = tree->KeyDesc[Index].Min;
90 RightBranch = tree->KeyDesc[Index].Max;
91 Left = nullptr;
92 Right = nullptr;
93}
float * Key
Definition: kdtree.h:57
KDNODE * Right
Definition: kdtree.h:63
float LeftBranch
Definition: kdtree.h:60
KDNODE * Left
Definition: kdtree.h:62
float RightBranch
Definition: kdtree.h:61
CLUSTER * Data
Definition: kdtree.h:58
float BranchPoint
Definition: kdtree.h:59

◆ ~KDNODE()

tesseract::KDNODE::~KDNODE ( )
inline

Definition at line 52 of file kdtree.h.

52 {
53 delete Left;
54 delete Right;
55 }

Member Data Documentation

◆ BranchPoint

float tesseract::KDNODE::BranchPoint

needed to make deletes work efficiently

Definition at line 59 of file kdtree.h.

◆ Data

CLUSTER* tesseract::KDNODE::Data

data that corresponds to key

Definition at line 58 of file kdtree.h.

◆ Key

float* tesseract::KDNODE::Key

search key

Definition at line 57 of file kdtree.h.

◆ Left

KDNODE* tesseract::KDNODE::Left

ptrs for KD tree structure

Definition at line 62 of file kdtree.h.

◆ LeftBranch

float tesseract::KDNODE::LeftBranch

used to optimize search pruning

Definition at line 60 of file kdtree.h.

◆ Right

KDNODE* tesseract::KDNODE::Right

Definition at line 63 of file kdtree.h.

◆ RightBranch

float tesseract::KDNODE::RightBranch

used to optimize search pruning

Definition at line 61 of file kdtree.h.


The documentation for this struct was generated from the following file: