Oolite
Loading...
Searching...
No Matches
OOCacheManager(Octree) Category Reference

#include <OOMesh.h>

Class Methods

(Octree *) + octreeForModel:
(void) + setOctree:forModel:
(static void) + VFRAddFace [implementation]
(static NSUInteger) + VFRGetCount [implementation]
(static NSUInteger) + VFRGetFaceAtIndex [implementation]

Detailed Description

Definition at line 185 of file OOMesh.h.

Method Documentation

◆ octreeForModel:

+ (Octree *) octreeForModel: (NSString*) inKey

Extends class OOCacheManager.

Definition at line 2024 of file OOMesh.m.

2024 :(NSString*)inKey
2025{
2026 NSDictionary* dict = nil;
2027 Octree* result = nil;
2028
2029 if (inKey == nil)
2030 return nil;
2031
2032 dict = [[self sharedCache] objectForKey:inKey inCache:kOOCacheOctrees];
2033 if (dict != nil) {
2034 result = [[Octree alloc] initWithDictionary:dict];
2035 [result autorelease];
2036 }
2037
2038 return result;
2039}
return nil

References nil, OOCacheManager::objectForKey:inCache:, and OOCacheManager::sharedCache.

Here is the call graph for this function:

◆ setOctree:forModel:

+ (void) setOctree: (Octree*) inOctree
forModel: (NSString*) inKey 

Extends class OOCacheManager.

Definition at line 2041 of file OOMesh.m.

2041 :(Octree*)inOctree forModel:(NSString*)inKey
2042{
2043 if (inOctree != nil && inKey != nil) {
2044 [[self sharedCache] setObject:[inOctree dictionaryRepresentation] forKey:inKey inCache:kOOCacheOctrees];
2045 }
2046}
NSDictionary * dictionaryRepresentation()
Definition Octree.m:626

References Octree::dictionaryRepresentation, nil, OOCacheManager::setObject:forKey:inCache:, and OOCacheManager::sharedCache.

Here is the call graph for this function:

◆ VFRAddFace

+ (void) VFRAddFace (VertexFaceRef *) vfr
(NSUInteger) index 
implementation

Extends class OOCacheManager.

Definition at line 2048 of file OOMesh.m.

2049{
2050 NSCParameterAssert(vfr != NULL);
2051
2052 if (index < UINT16_MAX && vfr->internCount < kVertexFaceDefInternalCount) {
2053 vfr->internFaces[vfr->internCount++] = index;
2054 } else {
2055 if (vfr->extra == nil)
2056 vfr->extra = [NSMutableArray array];
2057 [vfr->extra addObject:[NSNumber numberWithInteger:index]];
2058 }
2059}
@ kVertexFaceDefInternalCount
Definition OOMesh.m:110
uint16_t internFaces[kVertexFaceDefInternalCount]
Definition OOMesh.m:116
NSMutableArray * extra
Definition OOMesh.m:117

References VertexFaceRef::extra, VertexFaceRef::internFaces, kVertexFaceDefInternalCount, and nil.

◆ VFRGetCount

+ (NSUInteger) VFRGetCount (VertexFaceRef *) vfr
implementation

Extends class OOCacheManager.

Definition at line 2061 of file OOMesh.m.

2062{
2063 NSCParameterAssert(vfr != NULL);
2064
2065 return vfr->internCount + [vfr->extra count];
2066}
unsigned count
uint16_t internCount
Definition OOMesh.m:115

References VertexFaceRef::internCount.

◆ VFRGetFaceAtIndex

+ (NSUInteger) VFRGetFaceAtIndex (VertexFaceRef *) vfr
(NSUInteger) index 
implementation

Extends class OOCacheManager.

Definition at line 2068 of file OOMesh.m.

2069{
2070 NSCParameterAssert(vfr != NULL && index < VFRGetCount(vfr));
2071
2072 if (index < vfr->internCount)
2073 return vfr->internFaces[index];
2074 else
2075 return [vfr->extra oo_unsignedIntegerAtIndex:index - vfr->internCount];
2076}
static NSUInteger VFRGetCount(VertexFaceRef *vfr)
Definition OOMesh.m:2061

References VertexFaceRef::internFaces, and VFRGetCount().

Here is the call graph for this function:

The documentation for this category was generated from the following files: