UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GenericOctreePublic.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 GenericOctreePublic.h: Generic octree definition.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10
15{
16public:
17
18 template<typename, typename>
19 friend class TOctree2;
20
23 : NodeIndex(INDEX_NONE)
24 , ElementIndex(INDEX_NONE)
25 {}
26
28 [[nodiscard]] bool IsValidId() const
29 {
30 return NodeIndex != INDEX_NONE;
31 }
32
34 {
35 return NodeIndex;
36 }
37
38private:
39
41 uint32 NodeIndex;
42
44 int32 ElementIndex;
45
48 : NodeIndex(InNodeIndex)
49 , ElementIndex(InElementIndex)
50 {}
51
53 [[nodiscard]] operator int32() const
54 {
55 return ElementIndex;
56 }
57
58 [[nodiscard]] friend FString LexToString(const FOctreeElementId2 ElementId)
59 {
60 return FString::Printf(TEXT("[%s:%s]"), *LexToString(ElementId.NodeIndex), *LexToString(ElementId.ElementIndex));
61 }
62};
63
68{
69public:
70
71 template<typename, typename>
72 friend class TOctree_DEPRECATED;
73
76 : Node(NULL)
77 , ElementIndex(INDEX_NONE)
78 {}
79
81 [[nodiscard]] bool IsValidId() const
82 {
83 return Node != NULL;
84 }
85
86private:
87
89 const void* Node;
90
92 int32 ElementIndex;
93
96 : Node(InNode)
97 , ElementIndex(InElementIndex)
98 {}
99
101 [[nodiscard]] operator int32() const
102 {
103 return ElementIndex;
104 }
105};
#define NULL
Definition oodle2base.h:134
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition GenericOctreePublic.h:15
bool IsValidId() const
Definition GenericOctreePublic.h:28
FOctreeElementId2()
Definition GenericOctreePublic.h:22
friend FString LexToString(const FOctreeElementId2 ElementId)
Definition GenericOctreePublic.h:58
uint32 GetNodeIndex() const
Definition GenericOctreePublic.h:33
Definition GenericOctreePublic.h:68
bool IsValidId() const
Definition GenericOctreePublic.h:81
FOctreeElementId()
Definition GenericOctreePublic.h:75
Definition GenericOctree.h:378
Definition GenericOctree.h:1082