#include <Octree.h>
Definition at line 92 of file Octree.h.
◆ beginInnerNode
Definition at line 816 of file Octree.m.
892{
894
895
898
899
900
901
902
903
904
905
907
908
912}
OOINLINE struct OOOctreeBuildState * State(OOOctreeBuilder *self)
OOINLINE void InsertNode(OOOctreeBuilder *self, int value)
Referenced by BuildSubOctree().
◆ buildOctreeWithRadius:
- (Octree *) buildOctreeWithRadius: |
|
(GLfloat) | radius |
|
Definition at line 816 of file Octree.m.
856 :(GLfloat)radius
857{
858 NSAssert(
State(
self)->remaining == 0 &&
_level == 0,
@"Attempt to produce octree from an octree builder in an incomplete state.");
859
861 int *resized = realloc(
_octree, dataSize);
862 if (resized == NULL) resized =
_octree;
863
864
865
866
867 NSData *data = [NSData dataWithBytesNoCopy:resized
868 length:dataSize
869 freeWhenDone:YES];
870
874
875 return [[[
Octree alloc] initWithData:data radius:radius] autorelease];
876}
◆ dealloc
Definition at line 816 of file Octree.m.
849{
851
852 [super dealloc];
853}
◆ endInnerNode
Definition at line 816 of file Octree.m.
916{
917 NSAssert(
State(
self)->remaining == 0,
@"Attempt to end an inner octree node with fewer than eight children.");
918 NSAssert1(
_level > 0,
@"Unbalanced call to %s", __FUNCTION__);
919
921
922
923
924
925
926
927
928
929
930
931
932
933 NSAssert(
_nodeCount > 8,
@"After ending an inner node, there must be at least eight nodes in buffer.");
935 {
936 if (
_octree[node] != -1)
return;
937 }
938
939
940 _octree[State(self)->insertionPoint - 1] = -1;
942}
Referenced by BuildSubOctree().
◆ init
Definition at line 816 of file Octree.m.
826{
827 if ((
self = [super
init]))
828 {
832 {
833 [self release];
835 }
836
837
838
839
840
843 }
844 return self;
845}
@ kMinimumBuilderCapacity
◆ InsertNode
Definition at line 816 of file Octree.m.
817{
818 NSCAssert(
State(
self)->remaining > 0,
@"Attempt to add node to a full parent in octree builder.");
820
822}
OOINLINE void SetNode(OOOctreeBuilder *self, uint32_t index, int value)
◆ SetNode
Definition at line 802 of file Octree.m.
803{
805 {
806 self->_octree[index] = value;
807 }
808 else
809 {
811 }
812}
static void SetNode_slow(OOOctreeBuilder *self, uint32_t index, int value) NO_INLINE_FUNC
◆ SetNode_slow
Definition at line 946 of file Octree.m.
947{
949 newCapacity =
MAX(newCapacity, index + 1);
950
951 int *newBuffer = realloc(
self->_octree, newCapacity *
sizeof *newBuffer);
953 {
954 [NSException raise:NSMallocException format:@"Failed to allocate memory for octree."];
955 }
956
957 self->_octree = newBuffer;
958 self->_capacity = newCapacity;
959 self->_octree[index] = value;
960}
References EXPECT_NOT, kMinimumBuilderCapacity, MAX, and self.
◆ State
◆ suppressClangStuff
- (BOOL) suppressClangStuff |
|
|
|
|
implementation |
Definition at line 946 of file Octree.m.
968{
970}
struct OOOctreeBuilder::OOOctreeBuildState _stateStack[kMaxOctreeDepth+1]
◆ writeEmpty
◆ writeSolid
◆ _capacity
- (uint_fast32_t) _capacity |
|
private |
◆ _level
◆ _nodeCount
- (uint_fast32_t) _nodeCount |
|
private |
◆ _octree
◆ _stateStack
The documentation for this class was generated from the following files: